@@ -13,7 +13,7 @@ import Link from "next/link";
1313import { useRouter } from "next/router" ;
1414import { Fragment , useEffect , useState } from "react" ;
1515
16- import { ContextMenu } from "@radix-ui/themes" ;
16+ import { Button , ContextMenu } from "@radix-ui/themes" ;
1717import useTranslation from "next-translate/useTranslation" ;
1818import { useUser } from "../store/session" ;
1919
@@ -76,6 +76,39 @@ export default function NewLayout({ children }: any) {
7676 // },
7777 ] ;
7878
79+ const admin_settings = [
80+ {
81+ name : t ( "sl_users" ) ,
82+ href : "/admin/users/internal" ,
83+ current : location . pathname === "/admin/users/internal" ,
84+ } ,
85+ {
86+ name : t ( "sl_clients" ) ,
87+ href : "/admin/clients" ,
88+ current : location . pathname === "/admin/clients" ,
89+ } ,
90+ {
91+ name : "Email Queues" ,
92+ href : "/admin/email-queues" ,
93+ current : location . pathname === "/admin/email-queues" ,
94+ } ,
95+ {
96+ name : "Webhooks" ,
97+ href : "/admin/webhooks" ,
98+ current : location . pathname === "/admin/webhooks" ,
99+ } ,
100+ {
101+ name : "Outbound Emails" ,
102+ href : "/admin/email" ,
103+ current : location . pathname === "/admin/email" ,
104+ } ,
105+ {
106+ name : "SSO" ,
107+ href : "/admin/sso" ,
108+ current : location . pathname === "/admin/sso" ,
109+ } ,
110+ ] ;
111+
79112 // async function getQueues() {
80113 // const res = await fetch(
81114 // `/api/v1/email-queues/all`,
@@ -118,8 +151,8 @@ export default function NewLayout({ children }: any) {
118151 // }, [user]);
119152
120153 // useEffect(() => {
121- // location.push(`${locale}/${location.pathname}` );
122- // }, [user, location]);
154+ // getQueues( );
155+ // }, [user])
123156
124157 // const handleKeyPress = useCallback((event: any, location: any) => {
125158 // console.log(location);
@@ -260,12 +293,13 @@ export default function NewLayout({ children }: any) {
260293 </ Transition . Child >
261294 { /* Sidebar component, swap this element with another sidebar if you like */ }
262295 < div className = "flex grow flex-col gap-y-5 overflow-y-auto bg-white px-6 pb-4" >
263- < div className = "flex h-16 shrink-0 items-center" >
264- < img
265- className = "h-8 w-auto"
266- src = "https://tailwindui.com/img/logos/mark.svg?color=indigo& shade = 600 "
267- alt = "Your Company"
268- />
296+ < div className = "flex align-middle flex-row h-14 items-center border-b-[1px]" >
297+ { /* <img className="h-8 w-auto" src="/logo.svg" alt="Workflow" /> */ }
298+ < Link href = "https://peppermint.sh" >
299+ < span className = "text-3xl ml-2 hover:text-green-600 font-bold " >
300+ Peppermint
301+ </ span >
302+ </ Link >
269303 </ div >
270304 < nav className = "flex flex-1 flex-col" >
271305 < ul role = "list" className = "flex flex-1 flex-col gap-y-7" >
@@ -295,11 +329,6 @@ export default function NewLayout({ children }: any) {
295329 < span className = "whitespace-nowrap" >
296330 { item . name }
297331 </ span >
298- < div className = "flex w-full justify-end float-right" >
299- < span className = "flex h-6 w-6 shrink-0 items-center justify-center rounded-lg border border-gray-700 bg-gray-800 text-[0.625rem] font-medium text-gray-400 group-hover:text-white" >
300- { item . initial }
301- </ span >
302- </ div >
303332 </ Link >
304333 </ li >
305334 ) : (
@@ -363,6 +392,100 @@ export default function NewLayout({ children }: any) {
363392 </ ul >
364393 </ li >
365394
395+ { user . isAdmin && (
396+ < li >
397+ < span className = "mb-2 text-sm font-bold" >
398+ Admin Settings
399+ </ span >
400+ < ul role = "list" className = "-mx-2 space-y-1" >
401+ { admin_settings . map ( ( item : any ) =>
402+ ! item . children ? (
403+ < li key = { item . name } >
404+ < Link
405+ href = { item . href }
406+ className = { classNames (
407+ item . current
408+ ? "bg-gray-50 text-indigo-600"
409+ : "text-gray-700 hover:text-indigo-600 hover:bg-gray-50" ,
410+ "group flex gap-x-3 rounded-md p-2 text-sm leading-6 font-semibold"
411+ ) }
412+ >
413+ { /* <item.icon
414+ className={classNames(
415+ item.current
416+ ? "text-indigo-600"
417+ : "text-gray-400 group-hover:text-indigo-600",
418+ "h-6 w-6 shrink-0"
419+ )}
420+ aria-hidden="true"
421+ /> */ }
422+ < span className = "whitespace-nowrap" >
423+ { item . name }
424+ </ span >
425+ </ Link >
426+ </ li >
427+ ) : (
428+ < Disclosure
429+ as = "div"
430+ key = { item . name }
431+ className = "space-y-1"
432+ >
433+ { ( { open } ) => (
434+ < >
435+ { queues . length > 0 && (
436+ < >
437+ < Disclosure . Button
438+ className = { classNames (
439+ item . current
440+ ? "bg-green-400 text-white"
441+ : "bg-gray-900 text-white hover:bg-green-400 hover:text-white" ,
442+ "group w-full flex items-center pl-2 pr-2 py-2 text-left text-sm font-medium rounded-md focus:outline-none"
443+ ) }
444+ >
445+ < svg
446+ className = { classNames (
447+ open
448+ ? "text-white rotate-90"
449+ : "text-white" ,
450+ "mr-2 flex-shrink-0 h-5 w-5 transform group-hover:text-white transition-colors ease-in-out duration-150"
451+ ) }
452+ viewBox = "0 0 20 20"
453+ aria-hidden = "true"
454+ >
455+ < path
456+ d = "M6 6L14 10L6 14V6Z"
457+ fill = "currentColor"
458+ />
459+ </ svg >
460+ { item . name }
461+ </ Disclosure . Button >
462+ < Disclosure . Panel className = "space-y-1" >
463+ { item . children . map (
464+ ( subItem : any ) => (
465+ < Link
466+ href = { `/queue/${ subItem . name } ` }
467+ >
468+ < Disclosure . Button
469+ key = { subItem . name }
470+ className = "group w-full flex items-center pl-10 pr-2 py-2 text-sm font-medium text-white rounded-md hover:text-white hover:bg-green-400 focus:outline-none"
471+ >
472+ { subItem . name }
473+ </ Disclosure . Button >
474+ </ Link >
475+ )
476+ ) }
477+ </ Disclosure . Panel >
478+ </ >
479+ ) }
480+ </ >
481+ ) }
482+ </ Disclosure >
483+ )
484+ ) }
485+ </ ul >
486+ </ li >
487+ ) }
488+
366489 < li className = "mt-auto" >
367490 < a
368491 href = "#"
@@ -569,11 +692,14 @@ export default function NewLayout({ children }: any) {
569692 < div className = "sticky top-0 z-10 flex h-14 shrink-0 items-center gap-x-4 border-b border-gray-200 bg-white dark:bg-[#0A090C] px-4 sm:gap-x-6" >
570693 < button
571694 type = "button"
572- className = "-m-2.5 p-2.5 text-white lg:hidden"
695+ className = "-m-2.5 p-2.5 text-black dark:text- white lg:hidden"
573696 onClick = { ( ) => setSidebarOpen ( true ) }
574697 >
575698 < span className = "sr-only" > Open sidebar</ span >
576- < Bars3Icon className = "h-6 w-6 text-white" aria-hidden = "true" />
699+ < Bars3Icon
700+ className = "h-6 w-6 text-black dark:text-white"
701+ aria-hidden = "true"
702+ />
577703 </ button >
578704
579705 { /* Separator */ }
@@ -697,6 +823,15 @@ export default function NewLayout({ children }: any) {
697823 </Popover.Panel>
698824 </Popover> */ }
699825 { /* Profile dropdown */ }
826+ < Link
827+ href = "https://github.com/Peppermint-Lab/peppermint/discussions"
828+ target = "_blank"
829+ className = "hover:cursor-pointer"
830+ >
831+ < Button variant = "outline" className = "hover:cursor-pointer" >
832+ Send Feedback
833+ </ Button >
834+ </ Link >
700835 < Menu as = "div" className = "relative" >
701836 < Menu . Button className = "z-50 flex items-center p-1.5" >
702837 < span className = "sr-only" > Open user menu</ span >
0 commit comments