File tree Expand file tree Collapse file tree 3 files changed +63
-26
lines changed
apps/postgres-new/components Expand file tree Collapse file tree 3 files changed +63
-26
lines changed Original file line number Diff line number Diff line change @@ -30,16 +30,16 @@ export default function Layout({ children }: LayoutProps) {
30
30
</ div >
31
31
) }
32
32
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 >
42
41
</ main >
42
+ { /* </main> */ }
43
43
</ div >
44
44
</ TooltipProvider >
45
45
</ LazyMotion >
Original file line number Diff line number Diff line change @@ -37,6 +37,7 @@ import {
37
37
DropdownMenuSeparator ,
38
38
DropdownMenuTrigger ,
39
39
} from './ui/dropdown-menu'
40
+ import UserDropdown from './user-dropdown'
40
41
41
42
export default function Sidebar ( ) {
42
43
const { user, signOut } = useApp ( )
@@ -133,6 +134,7 @@ export default function Sidebar() {
133
134
) }
134
135
</ div >
135
136
) }
137
+ < UserDropdown />
136
138
{ user && (
137
139
< Button
138
140
className = "flex flex-row gap-2 items-center mx-2 hover:bg-black/10"
@@ -188,23 +190,26 @@ export default function Sidebar() {
188
190
</ TooltipContent >
189
191
</ Tooltip >
190
192
</ 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 >
208
213
</ div >
209
214
) }
210
215
</ >
Original file line number Diff line number Diff line change
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
+ }
You can’t perform that action at this time.
0 commit comments