Skip to content

Commit 4404bb6

Browse files
committed
Add sidebar. Typography pages
1 parent 2d8c1ef commit 4404bb6

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+3570
-89
lines changed

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,15 @@
3131
"formik": "2.2.9",
3232
"history": "4.10.1",
3333
"jsonwebtoken": "^8.5.1",
34+
"line-awesome": "^1.3.0",
3435
"moment": "2.29.1",
3536
"query-string": "7.1.0",
3637
"react": "^17.0.2",
3738
"react-dom": "^17.0.2",
3839
"react-redux": "^7.2.4",
3940
"react-router-dom": "^5.2.0",
4041
"react-scripts": "3.4.3",
42+
"react-swipeable-views": "^0.14.0",
4143
"react-syntax-highlighter": "^11.0.2",
4244
"recharts": "^2.1.10",
4345
"redux": "^4.0.5",

src/components/App.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,14 @@ import useStyles from './styles';
88
import Layout from './Layout';
99
import Documentation from './Documentation/Documentation';
1010

11+
1112
// pages
1213
import Starter from '../pages/starter';
1314
import Error from '../pages/error';
1415
import Login from '../pages/login';
1516
import Verify from '../pages/verify';
1617
import Reset from '../pages/reset';
18+
import Profile from '../pages/profile';
1719

1820
// context
1921
import { useUserState } from '../context/UserContext';
@@ -45,6 +47,7 @@ export default function App() {
4547
path='/admin'
4648
render={() => <Redirect to='/admin/dashboard' />}
4749
/>
50+
4851
<Route path='/documentation' component={Documentation} />
4952
<PrivateRoute path='/admin' component={Layout} />
5053
<PublicRoute path='/starter' component={Starter} />

src/components/Layout/Layout.js

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,15 @@ import { Link } from '../Wrappers';
2020
import ColorChangeThemePopper from './components/ColorChangeThemePopper';
2121

2222
import EditUser from '../../pages/user/EditUser';
23+
import AddUser from '../../pages/CRUD/Users/form/UsersForm';
24+
2325

2426
// pages
2527
import Dashboard from '../../pages/dashboard';
28+
import Profile from '../../pages/profile'
29+
import TypographyPage from '../../pages/typography'
30+
import ColorsPage from '../../pages/colors'
31+
import GridPage from '../../pages/grid'
2632
import BreadCrumbs from '../../components/BreadCrumbs';
2733

2834
// context
@@ -31,6 +37,9 @@ import { useLayoutState } from '../../context/LayoutContext';
3137
import UsersFormPage from 'pages/CRUD/Users/form/UsersFormPage';
3238
import UsersTablePage from 'pages/CRUD/Users/table/UsersTablePage';
3339

40+
//Sidebar structure
41+
import structure from '../Sidebar/SidebarStructure'
42+
3443
const Redirect = (props) => {
3544
useEffect(() => window.location.replace(props.url));
3645
return <span>Redirecting...</span>;
@@ -52,7 +61,7 @@ function Layout(props) {
5261
return (
5362
<div className={classes.root}>
5463
<Header history={props.history} />
55-
<Sidebar />
64+
<Sidebar structure={structure}/>
5665
<div
5766
className={classnames(classes.content, {
5867
[classes.contentShift]: layoutState.isSidebarOpened,
@@ -62,10 +71,14 @@ function Layout(props) {
6271
<BreadCrumbs />
6372
<Switch>
6473
<Route path='/admin/dashboard' component={Dashboard} />
74+
<Route path="/admin/profile" component={Profile} />
6575
<Route path='/admin/user/edit' component={EditUser} />
66-
<Route
67-
path={'/admin/api-docs'}
68-
exact
76+
{/*TypographyPage*/}
77+
<Route path="/admin/core/typography" component={TypographyPage} />
78+
<Route path="/admin/core/colors" component={ColorsPage} />
79+
<Route path="/admin/core/grid" component={GridPage} />
80+
81+
<Route path={'/admin/api-docs'} exact
6982
component={(props) => (
7083
<Redirect
7184
url={
@@ -79,7 +92,7 @@ function Layout(props) {
7992
/>
8093

8194
<Route path={'/admin/users'} exact component={UsersTablePage} />
82-
<Route path={'/admin/users/new'} exact component={UsersFormPage} />
95+
<Route path={'/admin/user/new'} exact component={AddUser} />
8396
<Route
8497
path={'/admin/users/:id/edit'}
8598
exact

src/components/Sidebar/Sidebar.js

Lines changed: 9 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -92,75 +92,15 @@ function Sidebar({ location, structure }) {
9292
className={classes.sidebarList}
9393
classes={{ padding: classes.padding }}
9494
>
95-
<SidebarLink
96-
label='Dashboard'
97-
link='/admin/dashboard'
98-
location={location}
99-
isSidebarOpened={isSidebarOpenedWrapper}
100-
icon={<HomeIcon />}
101-
toggleDrawer={toggleDrawer(true)}
102-
/>
103-
104-
<SidebarLink
105-
label='Edit User'
106-
link='/admin/user/edit'
107-
location={location}
108-
isSidebarOpened={isSidebarOpenedWrapper}
109-
icon={<ProfileIcon />}
110-
toggleDrawer={toggleDrawer(true)}
111-
/>
112-
113-
<SidebarLink
114-
label='Users'
115-
link='/admin/users'
116-
location={location}
117-
isSidebarOpened={isSidebarOpenedWrapper}
118-
icon={<CoreIcon />}
119-
toggleDrawer={toggleDrawer(true)}
120-
/>
121-
122-
<SidebarLink
123-
label='Documentation'
124-
link='/documentation'
125-
location={location}
126-
isSidebarOpened={isSidebarOpenedWrapper}
127-
icon={<DocumentationIcon />}
128-
toggleDrawer={toggleDrawer(true)}
129-
children={[
130-
{
131-
label: 'Getting Started',
132-
link: '/documentation/getting-started',
133-
children: [
134-
{
135-
label: 'Quick start',
136-
link: '/documentation/getting-started/quick-start',
137-
},
138-
],
139-
},
140-
{
141-
label: 'Components',
142-
link: '/documentation/components',
143-
children: [
144-
{
145-
label: 'Typography',
146-
link: '/documentation/components/typography',
147-
},
148-
{
149-
label: 'Header',
150-
link: '/documentation/components/header',
151-
},
152-
{
153-
label: 'Sidebar',
154-
link: '/documentation/components/sidebar',
155-
},
156-
{
157-
label: 'Buttons',
158-
link: '/documentation/components/buttons',
159-
},
160-
],
161-
},
162-
]}
163-
/>
95+
{structure.map(link => (
96+
<SidebarLink
97+
key={link.id}
98+
location={location}
99+
isSidebarOpened={!isPermanent ? !isSidebarOpened : isSidebarOpened}
100+
{...link}
101+
toggleDrawer={toggleDrawer(true)}
102+
/>
103+
))}
164104

165105
<SidebarLink
166106
label='API docs'

src/components/Sidebar/SidebarStructure.js

Lines changed: 27 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ import { makeStyles } from '@mui/styles';
2525
import Dot from './components/Dot';
2626

2727
const structure = [
28-
{ id: 100, label: 'Profile', link: '/app/profile', icon: <ProfileIcon /> },
29-
{ id: 0, label: 'Dashboard', link: '/app/dashboard', icon: <HomeIcon /> },
28+
{ id: 100, label: 'Profile', link: '/admin/profile', icon: <ProfileIcon /> },
29+
{ id: 0, label: 'Dashboard', link: '/admin/dashboard', icon: <HomeIcon /> },
3030
{
3131
id: 1,
3232
label: 'E-commerce',
@@ -59,15 +59,15 @@ const structure = [
5959
children: [
6060
{
6161
label: 'User List',
62-
link: '/app/user/list',
62+
link: '/admin/users',
6363
},
6464
{
6565
label: 'User Add',
66-
link: '/app/user/add',
66+
link: '/admin/user/new',
6767
},
6868
{
6969
label: 'User Edit',
70-
link: '/app/user/edit',
70+
link: '/admin/user/edit',
7171
},
7272
],
7373
},
@@ -77,6 +77,28 @@ const structure = [
7777
link: '/documentation',
7878
icon: <DocumentationIcon />,
7979
},
80+
{ id: 4, type: 'divider' },
81+
{ id: 5, type: 'title', label: 'TEMPLATE' },
82+
{
83+
id: 6,
84+
label: 'Core',
85+
link: '/admin/core',
86+
icon: <CoreIcon />,
87+
children: [
88+
{
89+
label: 'Typography',
90+
link: '/admin/core/typography',
91+
},
92+
{
93+
label: 'Colors',
94+
link: '/admin/core/colors',
95+
},
96+
{
97+
label: 'Grid',
98+
link: '/admin/core/grid',
99+
},
100+
],
101+
},
80102
];
81103

82104
export default structure;

src/images/profile/BehanceIcon.svg

Lines changed: 8 additions & 0 deletions
Loading

src/images/profile/DribbleIcon.svg

Lines changed: 5 additions & 0 deletions
Loading

src/images/profile/FacebookIcon.svg

Lines changed: 5 additions & 0 deletions
Loading

src/images/profile/FolderBlueDark.svg

Lines changed: 13 additions & 0 deletions
Loading
Lines changed: 14 additions & 0 deletions
Loading

0 commit comments

Comments
 (0)