-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(sidebar): updates sidebar to use material ui
Updates the sidebar to use Material UI for its components re #143
- Loading branch information
Showing
7 changed files
with
92 additions
and
73 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import { Story } from '@storybook/react'; | ||
import { SessionProvider } from 'next-auth/react'; | ||
import { profileQuery } from '@components/molecules/AccountLink'; | ||
import SideBar from './SideBar'; | ||
|
||
export default { | ||
title: 'Oraganisms/SideBar', | ||
component: SideBar, | ||
}; | ||
|
||
const Template: Story = (args) => ( | ||
<SessionProvider session={{ expires: '' }}> | ||
<SideBar {...args} /> | ||
</SessionProvider> | ||
); | ||
|
||
export const Default = Template.bind({}); | ||
|
||
Default.args = { | ||
open: true, | ||
}; | ||
|
||
Default.parameters = { | ||
apolloClient: { | ||
mocks: [ | ||
{ | ||
request: { | ||
query: profileQuery, | ||
}, | ||
result: { | ||
data: { | ||
profile: { | ||
firstName: 'John', | ||
lastName: 'Doe', | ||
avatar: { | ||
filepath: 'https://i.pravatar.cc/300', | ||
}, | ||
}, | ||
}, | ||
}, | ||
}, | ||
], | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import { Toolbar, Divider, Drawer } from '@mui/material'; | ||
import { AppMenu } from '@components/molecules/AppMenu'; | ||
|
||
interface SideBarProps { | ||
open?: boolean; | ||
onClose?: () => void; | ||
} | ||
|
||
function SideBar({ open = false, onClose = () => {} }: SideBarProps) { | ||
return ( | ||
<Drawer | ||
data-testid="app-sidebar" | ||
variant="persistent" | ||
anchor="left" | ||
open={open} | ||
sx={{ | ||
width: 240, | ||
flexShrink: 0, | ||
'& .MuiDrawer-paper': { | ||
width: 240, | ||
boxSizing: 'border-box', | ||
backgroundColor: (theme) => theme.palette.primary.main, | ||
color: (theme) => theme.palette.primary.contrastText, | ||
}, | ||
}} | ||
onClose={onClose} | ||
> | ||
<Toolbar /> | ||
<Divider /> | ||
<AppMenu /> | ||
</Drawer> | ||
); | ||
} | ||
|
||
export default SideBar; |
File renamed without changes.