@@ -12,6 +12,7 @@ import {
1212 MenuItems ,
1313} from "@headlessui/react" ;
1414import { Bars3Icon , BellIcon , XMarkIcon , CameraIcon as CameraOutlineIcon } from "@heroicons/react/24/outline" ;
15+ import { HomeIcon , Squares2X2Icon , LinkIcon , UserCircleIcon } from "@heroicons/react/24/outline" ;
1516import { Link , useNavigate } from "react-router-dom" ;
1617import Loading from "./Loading" ;
1718import QRCode from "qrcode.react" ;
@@ -53,6 +54,13 @@ const navigation = [
5354 { name : "Links" , href : "/links" , current : false } ,
5455] ;
5556
57+
58+ const mobileNavIcons : Record < string , React . ElementType > = {
59+ Home : HomeIcon ,
60+ Dashboard : Squares2X2Icon ,
61+ Links : LinkIcon ,
62+ } ;
63+
5664function classNames ( ...classes : Array < string | false | undefined > ) {
5765 return classes . filter ( Boolean ) . join ( " " ) ;
5866}
@@ -501,7 +509,7 @@ const CreateLink: React.FC = () => {
501509 </ Menu >
502510 </ >
503511 ) : (
504- < Link to = "/signup " className = "sl-btn sl-btn--primary sl-btn--sm sl-nav-cta" >
512+ < Link to = "/login " className = "sl-btn sl-btn--primary sl-btn--sm sl-nav-cta" >
505513 Get Started
506514 </ Link >
507515 ) }
@@ -520,17 +528,41 @@ const CreateLink: React.FC = () => {
520528 </ nav >
521529
522530 < DisclosurePanel transition className = "sl-mobile-panel" >
523- { navigation . map ( ( item ) => (
524- < DisclosureButton
525- key = { item . name }
526- as = { Link }
527- to = { item . href }
528- aria-current = { item . current ? "page" : undefined }
529- className = "sl-mobile-link"
530- >
531- { item . name }
532- </ DisclosureButton >
533- ) ) }
531+ < div className = "sl-mobile-nav-list" >
532+ { navigation . map ( ( item ) => {
533+ const Icon = mobileNavIcons [ item . name ] || HomeIcon ;
534+ return (
535+ < DisclosureButton
536+ key = { item . name }
537+ as = { Link }
538+ to = { item . href }
539+ aria-current = { item . current ? "page" : undefined }
540+ className = "sl-mobile-nav-item"
541+ >
542+ < Icon aria-hidden = "true" />
543+ < span > { item . name } </ span >
544+ </ DisclosureButton >
545+ ) ;
546+ } ) }
547+ </ div >
548+
549+ { ! isLoggedIn && (
550+ < >
551+ < hr className = "sl-mobile-divider" />
552+ < div className = "sl-mobile-bottom-row" >
553+ < span className = "sl-mobile-avatar-circle" >
554+ < UserCircleIcon aria-hidden = "true" />
555+ </ span >
556+ < DisclosureButton
557+ as = { Link }
558+ to = "/login"
559+ className = "sl-btn sl-btn--primary sl-btn--sm"
560+ >
561+ Get Started
562+ </ DisclosureButton >
563+ </ div >
564+ </ >
565+ ) }
534566 </ DisclosurePanel >
535567 </ >
536568 ) }
0 commit comments