feat: create navigation pages and update routesConfig

This commit is contained in:
2023-06-04 16:30:01 +01:00
parent d5f0da4b65
commit 1236746ce9
15 changed files with 376 additions and 6 deletions

View File

@@ -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,
},
{

View File

View 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;

View 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;
*/

View File

@@ -0,0 +1,3 @@
const locale = {};
export default locale;

View 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;

View 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;
*/

View File

@@ -0,0 +1,3 @@
const locale = {};
export default locale;

View 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;

View 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;
*/

View File

@@ -0,0 +1,3 @@
const locale = {};
export default locale;

View 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;

View 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;

View 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;
*/

View File

@@ -0,0 +1,3 @@
const locale = {};
export default locale;