Skip to content

Commit f925482

Browse files
committed
remove header
1 parent 2a3ffa5 commit f925482

File tree

3 files changed

+63
-26
lines changed

3 files changed

+63
-26
lines changed

apps/postgres-new/components/layout.tsx

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -30,16 +30,16 @@ export default function Layout({ children }: LayoutProps) {
3030
</div>
3131
)}
3232

33-
<main className="flex-1 flex flex-col">
34-
<Header />
35-
<div className="flex-1 flex flex-col lg:flex-row min-h-0">
36-
{/* TODO: make sidebar available on mobile */}
37-
{!isSmallBreakpoint && <Sidebar />}
38-
<m.div layout="position" className="w-full h-full min-w-0 min-h-0">
39-
{children}
40-
</m.div>
41-
</div>
33+
{/* <main className="flex-1 flex flex-col"> */}
34+
{/* <Header /> */}
35+
<main className="flex-1 flex flex-col lg:flex-row min-h-0">
36+
{/* TODO: make sidebar available on mobile */}
37+
{!isSmallBreakpoint && <Sidebar />}
38+
<m.div layout="position" className="w-full h-full min-w-0 min-h-0">
39+
{children}
40+
</m.div>
4241
</main>
42+
{/* </main> */}
4343
</div>
4444
</TooltipProvider>
4545
</LazyMotion>

apps/postgres-new/components/sidebar.tsx

Lines changed: 22 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ import {
3737
DropdownMenuSeparator,
3838
DropdownMenuTrigger,
3939
} from './ui/dropdown-menu'
40+
import UserDropdown from './user-dropdown'
4041

4142
export default function Sidebar() {
4243
const { user, signOut } = useApp()
@@ -133,6 +134,7 @@ export default function Sidebar() {
133134
)}
134135
</div>
135136
)}
137+
<UserDropdown />
136138
{user && (
137139
<Button
138140
className="flex flex-row gap-2 items-center mx-2 hover:bg-black/10"
@@ -188,23 +190,26 @@ export default function Sidebar() {
188190
</TooltipContent>
189191
</Tooltip>
190192
</div>
191-
<Tooltip>
192-
<TooltipTrigger asChild>
193-
<m.div layout="position" layoutId="sign-out-button">
194-
<Button
195-
className="bg-inherit justify-end justify-self-end hover:bg-neutral-200 text-sm flex gap-3"
196-
onClick={async () => {
197-
await signOut()
198-
}}
199-
>
200-
<LogOut size={18} strokeWidth={3} />
201-
</Button>
202-
</m.div>
203-
</TooltipTrigger>
204-
<TooltipContent side="right" className="bg-black text-white">
205-
<p>Sign out</p>
206-
</TooltipContent>
207-
</Tooltip>
193+
<div>
194+
<UserDropdown />
195+
<Tooltip>
196+
<TooltipTrigger asChild>
197+
<m.div layout="position" layoutId="sign-out-button">
198+
<Button
199+
className="bg-inherit justify-end justify-self-end hover:bg-neutral-200 text-sm flex gap-3"
200+
onClick={async () => {
201+
await signOut()
202+
}}
203+
>
204+
<LogOut size={18} strokeWidth={3} />
205+
</Button>
206+
</m.div>
207+
</TooltipTrigger>
208+
<TooltipContent side="right" className="bg-black text-white">
209+
<p>Sign out</p>
210+
</TooltipContent>
211+
</Tooltip>
212+
</div>
208213
</div>
209214
)}
210215
</>
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
'use client'
2+
3+
import { Moon, Sun } from 'lucide-react'
4+
import { Button } from './ui/button'
5+
import {
6+
DropdownMenu,
7+
DropdownMenuContent,
8+
DropdownMenuItem,
9+
DropdownMenuTrigger,
10+
} from './ui/dropdown-menu'
11+
import { useTheme } from 'next-themes'
12+
13+
export default function UserDropdown() {
14+
const { setTheme } = useTheme()
15+
16+
return (
17+
<DropdownMenu>
18+
<DropdownMenuTrigger asChild>
19+
<Button variant="outline" size="icon">
20+
<Sun className="h-[1.2rem] w-[1.2rem] rotate-0 scale-100 transition-all dark:-rotate-90 dark:scale-0" />
21+
<Moon className="absolute h-[1.2rem] w-[1.2rem] rotate-90 scale-0 transition-all dark:rotate-0 dark:scale-100" />
22+
<span className="sr-only">Toggle theme</span>
23+
</Button>
24+
</DropdownMenuTrigger>
25+
<DropdownMenuContent align="end">
26+
<DropdownMenuItem onClick={() => setTheme('light')}>Light</DropdownMenuItem>
27+
<DropdownMenuItem onClick={() => setTheme('dark')}>Dark</DropdownMenuItem>
28+
<DropdownMenuItem onClick={() => setTheme('system')}>System</DropdownMenuItem>
29+
</DropdownMenuContent>
30+
</DropdownMenu>
31+
)
32+
}

0 commit comments

Comments
 (0)