You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
54 lines
1.3 KiB
54 lines
1.3 KiB
import { |
|
Box, |
|
Drawer, |
|
Toolbar, |
|
Divider, |
|
Typography, |
|
Button, |
|
} from '@mui/material'; |
|
import { useAppContext } from '../Contexts/AppContext'; |
|
|
|
export function Channels({ drawerWidth, showChannels, setShowChannels }) { |
|
const { channels, setCurrentChannel } = useAppContext(); |
|
|
|
return ( |
|
<Box sx={{ display: 'flex' }}> |
|
<Drawer |
|
PaperProps={{ |
|
sx: { |
|
width: 300, |
|
}, |
|
}} |
|
anchor="left" |
|
open={showChannels} |
|
onClose={() => setShowChannels(false)} |
|
sx={{ |
|
width: drawerWidth, |
|
flexShrink: 0, |
|
'& .MuiDrawer-paper': { |
|
width: drawerWidth, |
|
}, |
|
}} |
|
variant="persistent" |
|
> |
|
<Toolbar variant="dense" sx={{ flexDirection: 'row' }}> |
|
<Box sx={{ flexGrow: 1 }}> |
|
<Typography |
|
variant="subtitle2" |
|
component="div" |
|
sx={{ flexGrow: 1, textTransform: 'uppercase' }} |
|
> |
|
channels |
|
</Typography> |
|
</Box> |
|
</Toolbar> |
|
<Divider /> |
|
{channels.map((channel) => ( |
|
<Button onClick={() => setCurrentChannel(channel)} key={channel.id}> |
|
{channel.slug} |
|
</Button> |
|
))} |
|
</Drawer> |
|
</Box> |
|
); |
|
}
|
|
|