Skip to content

Commit

Permalink
add logout button to nav drawer (commaai#33)
Browse files Browse the repository at this point in the history
  • Loading branch information
incognitojam authored Jun 16, 2024
1 parent f935c86 commit 0a748b1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/components/material/Drawer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@ const Drawer: ParentComponent<DrawerProps> = (props) => {
return (
<>
<nav
class="hide-scrollbar fixed inset-y-0 left-0 w-screen touch-pan-y overflow-y-auto overscroll-y-contain transition-drawer duration-500"
class="hide-scrollbar fixed inset-y-0 left-0 h-full w-screen touch-pan-y overflow-y-auto overscroll-y-contain transition-drawer duration-500"
style={{
left: props.open ? 0 : `${-PEEK}px`,
opacity: props.open ? 1 : 0.5,
width: `${drawerWidth}px`,
}}
>
<div class="size-full rounded-r-lg bg-surface-container-low text-on-surface-variant sm:rounded-r-none">
<div class="flex size-full flex-col rounded-r-lg bg-surface-container-low text-on-surface-variant sm:rounded-r-none">
{props.drawer}
</div>
</nav>
Expand Down
4 changes: 4 additions & 0 deletions src/pages/dashboard/Dashboard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import { getDevices } from '~/api/devices'
import { getProfile } from '~/api/profile'
import type { Device } from '~/types'

import Button from '~/components/material/Button'
import Drawer from '~/components/material/Drawer'
import IconButton from '~/components/material/IconButton'
import TopAppBar from '~/components/material/TopAppBar'
Expand Down Expand Up @@ -49,6 +50,9 @@ const DashboardDrawer = (props: {
<Show when={props.devices} keyed>
{(devices: Device[]) => <DeviceList class="p-2" devices={devices} />}
</Show>
<div class="grow" />
<hr class="mx-4 opacity-20" />
<Button class="m-4" href="/logout">Sign out</Button>
</>
)
}
Expand Down

0 comments on commit 0a748b1

Please sign in to comment.