MCPcopy
hub / github.com/futantan/OpenGpt / MobileNavigation

Function MobileNavigation

src/components/Header.tsx:90–137  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

88}
89
90function MobileNavigation() {
91 const HEADER_LINKS = useHeaders()
92 return (
93 <Popover>
94 <Popover.Button
95 className="relative z-10 flex h-8 w-8 items-center justify-center [&:not(:focus-visible)]:focus:outline-none"
96 aria-label="Toggle Navigation"
97 >
98 {({ open }) => <MobileNavIcon open={open} />}
99 </Popover.Button>
100 <Transition.Root>
101 <Transition.Child
102 as={Fragment}
103 enter="duration-150 ease-out"
104 enterFrom="opacity-0"
105 enterTo="opacity-100"
106 leave="duration-150 ease-in"
107 leaveFrom="opacity-100"
108 leaveTo="opacity-0"
109 >
110 <Popover.Overlay className="fixed inset-0 bg-slate-300/50" />
111 </Transition.Child>
112 <Transition.Child
113 as={Fragment}
114 enter="duration-150 ease-out"
115 enterFrom="opacity-0 scale-95"
116 enterTo="opacity-100 scale-100"
117 leave="duration-100 ease-in"
118 leaveFrom="opacity-100 scale-100"
119 leaveTo="opacity-0 scale-95"
120 >
121 <Popover.Panel
122 as="div"
123 className="absolute inset-x-0 top-full mt-4 flex origin-top flex-col rounded-2xl bg-white p-4 text-lg tracking-tight text-slate-900 shadow-xl ring-1 ring-slate-900/5"
124 >
125 {HEADER_LINKS.map(({ href, label, target }) => (
126 <MobileNavLink key={label} href={href} target={target}>
127 {label}
128 </MobileNavLink>
129 ))}
130 <hr className="m-2 border-slate-300/40" />
131 {/* <MobileNavLink href="/login">Sign in</MobileNavLink> */}
132 </Popover.Panel>
133 </Transition.Child>
134 </Transition.Root>
135 </Popover>
136 )
137}
138
139export function Header() {
140 const HEADER_LINKS = useHeaders()

Callers

nothing calls this directly

Calls 1

useHeadersFunction · 0.85

Tested by

no test coverage detected