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

Builded a navigations system

parent dd75e632
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
...@@ -28,9 +28,14 @@ import ListItemText from '@material-ui/core/ListItemText'; ...@@ -28,9 +28,14 @@ import ListItemText from '@material-ui/core/ListItemText';
import MenuIcon from '@material-ui/icons/Menu'; import MenuIcon from '@material-ui/icons/Menu';
import Fab from '@material-ui/core/Fab'; import Fab from '@material-ui/core/Fab';
import { TabsItens } from '../AdminLabelTabs/LabelTabs'; import { TabsItens } from '../AdminLabelTabs/LabelTabs';
import DisplayContent from '../../Components/Components/DisplayContent'; import { Store } from '../../../Store';
import { Store } from '../../../Store'; import { BrowserRouter, Switch, Route, Link } from 'react-router-dom';
import Unauthorized from '../../Components/Components/Unauthorized'; import Unauthorized from '../../Components/Components/Unauthorized';
import Welcome from '../../Components/Components/Welcome';
import NoteVariables from './SubPages/NoteVariables';
import Institution from './SubPages/Institutions';
import SendEmail from './SubPages/SendEmail';
import Inframe from './SubPages/Inframe';
const useStyles = makeStyles({ const useStyles = makeStyles({
list: { list: {
...@@ -84,40 +89,62 @@ export default function Admin() { ...@@ -84,40 +89,62 @@ export default function Admin() {
> >
<List> <List>
{TabsItens.map((text, index) => ( {TabsItens.map((text, index) => (
<ListItem button key={text.label} onClick={() => setIndexIcon(index)}> <Link to={text.href} key={text.label}>
<IconButton> <ListItem button key={text.label} onClick={() => setIndexIcon(index)}>
<DisplayIcon i={index} /> <IconButton>
</IconButton> <DisplayIcon i={index} />
<ListItemText primary={text.label} /> </IconButton>
</ListItem> <ListItemText primary={text.label} />
</ListItem>
</Link>
))} ))}
</List> </List>
</div> </div>
); );
return ( return (
<div> <BrowserRouter>
{/**************** Begin of the Drawer ****************/} <Switch>
<div style={{ paddingTop: '2em', paddingLeft: '2em', paddingRight: '2em', paddingBottom: '2em', backgroundColor: ' #D3D3D3' }}>
<Route path='/admin/home' component={Welcome}/>
<Route path='/admin/intitution' component={Institution}/>
<Route path='/admin/sendEmail' component={SendEmail}/>
<Route path='/admin/inframe' component={Inframe}/>
<Route path='/admin/noteVar' component={NoteVariables} />
</div>
</Switch>
<React.Fragment> <React.Fragment>
<Drawer anchor={'left'} open={State['left']} onClose={toggleDrawer('left', false)}> <Drawer anchor={'left'} open={State['left']} onClose={toggleDrawer('left', false)}>
{list('left')} {list('left')}
</Drawer> </Drawer>
</React.Fragment> </React.Fragment>
{/**************** End of the Drawer****************/}
{/**************** Begin of the Content ****************/}
<div style={{ paddingTop: '2em', paddingLeft: '2em', paddingRight: '2em', paddingBottom: '2em', backgroundColor: ' #D3D3D3' }}>
<DisplayContent i={IndexIcon} />
</div>
{/**************** End of the Content ****************/}
{/**************** 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 />
</Fab> </Fab>
</div> </BrowserRouter>
// <div>
// {/**************** Begin of the Drawer ****************/}
// <React.Fragment>
// <Drawer anchor={'left'} open={State['left']} onClose={toggleDrawer('left', false)}>
// {list('left')}
// </Drawer>
// </React.Fragment>
// {/**************** End of the Drawer****************/}
// {/**************** Begin of the Content ****************/}
// <div style={{ paddingTop: '2em', paddingLeft: '2em', paddingRight: '2em', paddingBottom: '2em', backgroundColor: ' #D3D3D3' }}>
// <DisplayContent i={IndexIcon} />
// </div>
// {/**************** End of the Content ****************/}
// {/**************** FLoating action Button ****************/}
// <Fab color="primary" aria-label="add" style={fab} onClick={toggleDrawer('left', true)}>
// <MenuIcon />
// </Fab>
// </div>
); );
// if (state.userIsLoggedIn) { // if (state.userIsLoggedIn) {
// var obj = { ...(state.currentUser.roles)[0] } // var obj = { ...(state.currentUser.roles)[0] }
// if (obj.id === 3 || obj.id === 7) { // if (obj.id === 3 || obj.id === 7) {
......
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