Skip to content
Snippets Groups Projects
Commit 5264698d authored by lfr20's avatar lfr20
Browse files

Improved the Drawer

parent 6e91ab19
No related branches found
No related tags found
4 merge requests!57Merge of develop into master,!56Fixed buttons reportar, seguir, compartilhar, guardar and entrar (in comments...,!40merge admin into develop,!37Merge sistema_admin into Update_Admin_System
...@@ -56,7 +56,7 @@ export default function Admin() { ...@@ -56,7 +56,7 @@ export default function Admin() {
}); });
const [IndexIcon, setIndexIcon] = useState(0); const [IndexIcon, setIndexIcon] = useState(0);
{/**************** Controlls the state of the Drawer ****************/} {/**************** Controlls the state of the Drawer ****************/ }
const toggleDrawer = (anchor, open) => (event) => { const toggleDrawer = (anchor, open) => (event) => {
if (event.type === 'keydown' && (event.key === 'Tab' || event.key === 'Shift')) { if (event.type === 'keydown' && (event.key === 'Tab' || event.key === 'Shift')) {
return; return;
...@@ -65,7 +65,7 @@ export default function Admin() { ...@@ -65,7 +65,7 @@ export default function Admin() {
setState({ ...state, [anchor]: open }); setState({ ...state, [anchor]: open });
}; };
{/**************** Dsiplay the itens of the Drawer ****************/} {/**************** Dsiplay the itens of the Drawer ****************/ }
const list = (anchor) => ( const list = (anchor) => (
<div <div
className={clsx(classes.list, { className={clsx(classes.list, {
...@@ -91,21 +91,19 @@ export default function Admin() { ...@@ -91,21 +91,19 @@ export default function Admin() {
return ( return (
<div> <div>
{/**************** Begin of the Drawer ****************/} {/**************** Begin of the Drawer ****************/}
{['left'].map((anchor) => ( <React.Fragment>
<React.Fragment key={anchor}> <Drawer anchor={'left'} open={state['left']} onClose={toggleDrawer('left', false)}>
<Drawer anchor={anchor} open={state[anchor]} onClose={toggleDrawer(anchor, false)}> {list('left')}
{list(anchor)} </Drawer>
</Drawer> </React.Fragment>
</React.Fragment> {/**************** End of the Drawer****************/}
))}
{/**************** End of the Drawer****************/}
{/**************** Begin of the Content ****************/} {/**************** Begin of the Content ****************/}
<div style={{ paddingTop: '2em', paddingLeft: '2em', paddingRight: '2em', paddingBottom: '2em', backgroundColor: ' #D3D3D3' }}> <div style={{ paddingTop: '2em', paddingLeft: '2em', paddingRight: '2em', paddingBottom: '2em', backgroundColor: ' #D3D3D3' }}>
<DisplayContent selectedIcon={IndexIcon} /> <DisplayContent selectedIcon={IndexIcon} />
</div> </div>
{/**************** End of the Content ****************/} {/**************** End of the Content ****************/}
{/**************** FLoating action Button ****************/} {/**************** FLoating action Button ****************/}
<Fab color="primary" aria-label="add" style={fab} onClick={toggleDrawer('left', true)}> <Fab color="primary" aria-label="add" style={fab} onClick={toggleDrawer('left', true)}>
<MenuIcon /> <MenuIcon />
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment