feat: create navigation pages and update routesConfig
This commit is contained in:
@@ -2,19 +2,17 @@ import FuseUtils from '@fuse/utils';
|
||||
import FuseLoading from '@fuse/core/FuseLoading';
|
||||
import { Navigate } from 'react-router-dom';
|
||||
import settingsConfig from 'app/configs/settingsConfig';
|
||||
import SignInConfig from '../main/sign-in/SignInConfig';
|
||||
import SignUpConfig from '../main/sign-up/SignUpConfig';
|
||||
import SignOutConfig from '../main/sign-out/SignOutConfig';
|
||||
import Error404Page from '../main/404/Error404Page';
|
||||
import ExampleConfig from '../main/example/ExampleConfig';
|
||||
import navigationPagesConfigs from '../main/navigationPages/navigationPagesConfig';
|
||||
import authPagesConfig from '../main/authPages/authPagesConfig';
|
||||
|
||||
const routeConfigs = [ExampleConfig, SignOutConfig, SignInConfig, SignUpConfig];
|
||||
const routeConfigs = [...navigationPagesConfigs, ...authPagesConfig];
|
||||
|
||||
const routes = [
|
||||
...FuseUtils.generateRoutesFromConfigs(routeConfigs, settingsConfig.defaultAuth),
|
||||
{
|
||||
path: '/',
|
||||
element: <Navigate to="/example" />,
|
||||
element: <Navigate to="/" />,
|
||||
auth: settingsConfig.defaultAuth,
|
||||
},
|
||||
{
|
||||
|
||||
0
src/app/main/home/HomePage.js
Normal file
0
src/app/main/home/HomePage.js
Normal file
41
src/app/main/navigationPages/dashboard/Dashboard.js
Normal file
41
src/app/main/navigationPages/dashboard/Dashboard.js
Normal file
@@ -0,0 +1,41 @@
|
||||
import { styled } from '@mui/material/styles';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import FusePageSimple from '@fuse/core/FusePageSimple';
|
||||
import DemoContent from '@fuse/core/DemoContent';
|
||||
|
||||
const Root = styled(FusePageSimple)(({ theme }) => ({
|
||||
'& .FusePageSimple-header': {
|
||||
backgroundColor: theme.palette.background.paper,
|
||||
borderBottomWidth: 1,
|
||||
borderStyle: 'solid',
|
||||
borderColor: theme.palette.divider,
|
||||
},
|
||||
'& .FusePageSimple-toolbar': {},
|
||||
'& .FusePageSimple-content': {},
|
||||
'& .FusePageSimple-sidebarHeader': {},
|
||||
'& .FusePageSimple-sidebarContent': {},
|
||||
}));
|
||||
|
||||
function DashboardPage(props) {
|
||||
const { t } = useTranslation('dashboardPage');
|
||||
|
||||
return (
|
||||
<Root
|
||||
header={
|
||||
<div className="p-24">
|
||||
<h4>{t('TITLE')}</h4>
|
||||
</div>
|
||||
}
|
||||
content={
|
||||
<div className="p-24">
|
||||
<h4>Content</h4>
|
||||
<br />
|
||||
<DemoContent />
|
||||
</div>
|
||||
}
|
||||
scroll="content"
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
export default DashboardPage;
|
||||
47
src/app/main/navigationPages/dashboard/DashboardConfig.js
Normal file
47
src/app/main/navigationPages/dashboard/DashboardConfig.js
Normal file
@@ -0,0 +1,47 @@
|
||||
import i18next from 'i18next';
|
||||
|
||||
import Dashboard from './Dashboard';
|
||||
import en from './i18n/en';
|
||||
|
||||
i18next.addResourceBundle('en', 'dashboardPage', en);
|
||||
|
||||
const DashboardConfig = {
|
||||
settings: {
|
||||
layout: {
|
||||
config: {},
|
||||
},
|
||||
},
|
||||
routes: [
|
||||
{
|
||||
path: 'dashboard',
|
||||
element: <Dashboard />,
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
export default DashboardConfig;
|
||||
|
||||
/**
|
||||
* Lazy load Example
|
||||
*/
|
||||
/*
|
||||
import React from 'react';
|
||||
|
||||
const Example = lazy(() => import('./Example'));
|
||||
|
||||
const ExampleConfig = {
|
||||
settings: {
|
||||
layout: {
|
||||
config: {},
|
||||
},
|
||||
},
|
||||
routes: [
|
||||
{
|
||||
path: 'example',
|
||||
element: <Example />,
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
export default ExampleConfig;
|
||||
*/
|
||||
3
src/app/main/navigationPages/dashboard/i18n/en.js
Normal file
3
src/app/main/navigationPages/dashboard/i18n/en.js
Normal file
@@ -0,0 +1,3 @@
|
||||
const locale = {};
|
||||
|
||||
export default locale;
|
||||
41
src/app/main/navigationPages/favorites/Favorites.js
Normal file
41
src/app/main/navigationPages/favorites/Favorites.js
Normal file
@@ -0,0 +1,41 @@
|
||||
import { styled } from '@mui/material/styles';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import FusePageSimple from '@fuse/core/FusePageSimple';
|
||||
import DemoContent from '@fuse/core/DemoContent';
|
||||
|
||||
const Root = styled(FusePageSimple)(({ theme }) => ({
|
||||
'& .FusePageSimple-header': {
|
||||
backgroundColor: theme.palette.background.paper,
|
||||
borderBottomWidth: 1,
|
||||
borderStyle: 'solid',
|
||||
borderColor: theme.palette.divider,
|
||||
},
|
||||
'& .FusePageSimple-toolbar': {},
|
||||
'& .FusePageSimple-content': {},
|
||||
'& .FusePageSimple-sidebarHeader': {},
|
||||
'& .FusePageSimple-sidebarContent': {},
|
||||
}));
|
||||
|
||||
function FavoritesPage(props) {
|
||||
const { t } = useTranslation('favoritesPage');
|
||||
|
||||
return (
|
||||
<Root
|
||||
header={
|
||||
<div className="p-24">
|
||||
<h4>{t('TITLE')}</h4>
|
||||
</div>
|
||||
}
|
||||
content={
|
||||
<div className="p-24">
|
||||
<h4>Content</h4>
|
||||
<br />
|
||||
<DemoContent />
|
||||
</div>
|
||||
}
|
||||
scroll="content"
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
export default FavoritesPage;
|
||||
47
src/app/main/navigationPages/favorites/FavoritesConfig.js
Normal file
47
src/app/main/navigationPages/favorites/FavoritesConfig.js
Normal file
@@ -0,0 +1,47 @@
|
||||
import i18next from 'i18next';
|
||||
|
||||
import en from './i18n/en';
|
||||
import Favorites from './Favorites';
|
||||
|
||||
i18next.addResourceBundle('en', 'favoritesPage', en);
|
||||
|
||||
const FavoritesConfig = {
|
||||
settings: {
|
||||
layout: {
|
||||
config: {},
|
||||
},
|
||||
},
|
||||
routes: [
|
||||
{
|
||||
path: 'favorites',
|
||||
element: <Favorites />,
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
export default FavoritesConfig;
|
||||
|
||||
/**
|
||||
* Lazy load Example
|
||||
*/
|
||||
/*
|
||||
import React from 'react';
|
||||
|
||||
const Example = lazy(() => import('./Example'));
|
||||
|
||||
const ExampleConfig = {
|
||||
settings: {
|
||||
layout: {
|
||||
config: {},
|
||||
},
|
||||
},
|
||||
routes: [
|
||||
{
|
||||
path: 'example',
|
||||
element: <Example />,
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
export default ExampleConfig;
|
||||
*/
|
||||
3
src/app/main/navigationPages/favorites/i18n/en.js
Normal file
3
src/app/main/navigationPages/favorites/i18n/en.js
Normal file
@@ -0,0 +1,3 @@
|
||||
const locale = {};
|
||||
|
||||
export default locale;
|
||||
41
src/app/main/navigationPages/history/History.js
Normal file
41
src/app/main/navigationPages/history/History.js
Normal file
@@ -0,0 +1,41 @@
|
||||
import { styled } from '@mui/material/styles';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import FusePageSimple from '@fuse/core/FusePageSimple';
|
||||
import DemoContent from '@fuse/core/DemoContent';
|
||||
|
||||
const Root = styled(FusePageSimple)(({ theme }) => ({
|
||||
'& .FusePageSimple-header': {
|
||||
backgroundColor: theme.palette.background.paper,
|
||||
borderBottomWidth: 1,
|
||||
borderStyle: 'solid',
|
||||
borderColor: theme.palette.divider,
|
||||
},
|
||||
'& .FusePageSimple-toolbar': {},
|
||||
'& .FusePageSimple-content': {},
|
||||
'& .FusePageSimple-sidebarHeader': {},
|
||||
'& .FusePageSimple-sidebarContent': {},
|
||||
}));
|
||||
|
||||
function HistoryPage(props) {
|
||||
const { t } = useTranslation('historyPage');
|
||||
|
||||
return (
|
||||
<Root
|
||||
header={
|
||||
<div className="p-24">
|
||||
<h4>{t('TITLE')}</h4>
|
||||
</div>
|
||||
}
|
||||
content={
|
||||
<div className="p-24">
|
||||
<h4>Content</h4>
|
||||
<br />
|
||||
<DemoContent />
|
||||
</div>
|
||||
}
|
||||
scroll="content"
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
export default HistoryPage;
|
||||
47
src/app/main/navigationPages/history/HistoryConfig.js
Normal file
47
src/app/main/navigationPages/history/HistoryConfig.js
Normal file
@@ -0,0 +1,47 @@
|
||||
import i18next from 'i18next';
|
||||
|
||||
import en from './i18n/en';
|
||||
import History from './History';
|
||||
|
||||
i18next.addResourceBundle('en', 'historyPage', en);
|
||||
|
||||
const HistoryConfig = {
|
||||
settings: {
|
||||
layout: {
|
||||
config: {},
|
||||
},
|
||||
},
|
||||
routes: [
|
||||
{
|
||||
path: 'history',
|
||||
element: <History />,
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
export default HistoryConfig;
|
||||
|
||||
/**
|
||||
* Lazy load Example
|
||||
*/
|
||||
/*
|
||||
import React from 'react';
|
||||
|
||||
const Example = lazy(() => import('./Example'));
|
||||
|
||||
const ExampleConfig = {
|
||||
settings: {
|
||||
layout: {
|
||||
config: {},
|
||||
},
|
||||
},
|
||||
routes: [
|
||||
{
|
||||
path: 'example',
|
||||
element: <Example />,
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
export default ExampleConfig;
|
||||
*/
|
||||
3
src/app/main/navigationPages/history/i18n/en.js
Normal file
3
src/app/main/navigationPages/history/i18n/en.js
Normal file
@@ -0,0 +1,3 @@
|
||||
const locale = {};
|
||||
|
||||
export default locale;
|
||||
8
src/app/main/navigationPages/navigationPagesConfig.js
Normal file
8
src/app/main/navigationPages/navigationPagesConfig.js
Normal file
@@ -0,0 +1,8 @@
|
||||
import DashboardConfig from './dashboard/DashboardConfig';
|
||||
import FavoritesConfig from './favorites/FavoritesConfig';
|
||||
import HistoryConfig from './history/HistoryConfig';
|
||||
import ProfileConfig from './profile/ProfileConfig';
|
||||
|
||||
const navigationPagesConfigs = [DashboardConfig, FavoritesConfig, HistoryConfig, ProfileConfig];
|
||||
|
||||
export default navigationPagesConfigs;
|
||||
41
src/app/main/navigationPages/profile/Profile.js
Normal file
41
src/app/main/navigationPages/profile/Profile.js
Normal file
@@ -0,0 +1,41 @@
|
||||
import { styled } from '@mui/material/styles';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import FusePageSimple from '@fuse/core/FusePageSimple';
|
||||
import DemoContent from '@fuse/core/DemoContent';
|
||||
|
||||
const Root = styled(FusePageSimple)(({ theme }) => ({
|
||||
'& .FusePageSimple-header': {
|
||||
backgroundColor: theme.palette.background.paper,
|
||||
borderBottomWidth: 1,
|
||||
borderStyle: 'solid',
|
||||
borderColor: theme.palette.divider,
|
||||
},
|
||||
'& .FusePageSimple-toolbar': {},
|
||||
'& .FusePageSimple-content': {},
|
||||
'& .FusePageSimple-sidebarHeader': {},
|
||||
'& .FusePageSimple-sidebarContent': {},
|
||||
}));
|
||||
|
||||
function ProfilePage(props) {
|
||||
const { t } = useTranslation('profilePage');
|
||||
|
||||
return (
|
||||
<Root
|
||||
header={
|
||||
<div className="p-24">
|
||||
<h4>{t('TITLE')}</h4>
|
||||
</div>
|
||||
}
|
||||
content={
|
||||
<div className="p-24">
|
||||
<h4>Content</h4>
|
||||
<br />
|
||||
<DemoContent />
|
||||
</div>
|
||||
}
|
||||
scroll="content"
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
export default ProfilePage;
|
||||
47
src/app/main/navigationPages/profile/ProfileConfig.js
Normal file
47
src/app/main/navigationPages/profile/ProfileConfig.js
Normal file
@@ -0,0 +1,47 @@
|
||||
import i18next from 'i18next';
|
||||
|
||||
import en from './i18n/en';
|
||||
import Profile from './Profile';
|
||||
|
||||
i18next.addResourceBundle('en', 'profilePage', en);
|
||||
|
||||
const ProfileConfig = {
|
||||
settings: {
|
||||
layout: {
|
||||
config: {},
|
||||
},
|
||||
},
|
||||
routes: [
|
||||
{
|
||||
path: 'profile',
|
||||
element: <Profile />,
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
export default ProfileConfig;
|
||||
|
||||
/**
|
||||
* Lazy load Example
|
||||
*/
|
||||
/*
|
||||
import React from 'react';
|
||||
|
||||
const Example = lazy(() => import('./Example'));
|
||||
|
||||
const ExampleConfig = {
|
||||
settings: {
|
||||
layout: {
|
||||
config: {},
|
||||
},
|
||||
},
|
||||
routes: [
|
||||
{
|
||||
path: 'example',
|
||||
element: <Example />,
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
export default ExampleConfig;
|
||||
*/
|
||||
3
src/app/main/navigationPages/profile/i18n/en.js
Normal file
3
src/app/main/navigationPages/profile/i18n/en.js
Normal file
@@ -0,0 +1,3 @@
|
||||
const locale = {};
|
||||
|
||||
export default locale;
|
||||
Reference in New Issue
Block a user