diff --git a/src/components/Admin/Dashboard/index.tsx b/src/components/Admin/Dashboard/index.tsx index d399e4a..9beee31 100644 --- a/src/components/Admin/Dashboard/index.tsx +++ b/src/components/Admin/Dashboard/index.tsx @@ -23,7 +23,7 @@ import { DASHBOARD_TITLE_GPS_COORDS, DASHBOARD_TITLE_INFORMATION, } from './Dashboard.constants'; -import DashboardText from '../DashboardText'; +import DashboardPages from '../DashboardPages'; const Navigation = loadable(() => import('../../../pages/admin/Navigation')); const { RangePicker } = DatePicker; @@ -31,24 +31,17 @@ const { RangePicker } = DatePicker; type NoUndefinedRangeValueType = [DateType | null, DateType | null] | null; const Dashboard: React.FC = () => { - const [isTextLoading, setIsTextLoading] = useState(false); - const [texts, setTexts] = useState([]); - const [newTexts, setNewTexts] = useState(texts); const [infoText, setInfoText] = useState({} as IText); const [festival, setFestival] = useState({} as IFestival); const [toggleLoading, setToggleLoading] = useState<{ [x: string]: boolean }>({}); useEffect(() => { - setIsTextLoading(true); - TextService.getAll() - .then(setTexts) - .finally(() => setIsTextLoading(false)); TextService.getByTextType(TextType.info).then(setInfoText); FestivalService.getLastFestival().then((festival) => { CookieService.set(CookieService.festivalId, festival.id); setFestival(festival); }); - }, [newTexts]); + }, []); const updateInformationsVisibility = (checked: boolean): void => { if (infoText) { @@ -121,7 +114,7 @@ const Dashboard: React.FC = () => {
- +
diff --git a/src/components/Admin/DashboardPages/DashboardPageAssociation/index.tsx b/src/components/Admin/DashboardPages/DashboardPageAssociation/index.tsx new file mode 100644 index 0000000..4ca6b1c --- /dev/null +++ b/src/components/Admin/DashboardPages/DashboardPageAssociation/index.tsx @@ -0,0 +1,7 @@ +import React from 'react'; + +const DashboardPageAssociation : React.FC = () => ( +
Association
+); + +export default DashboardPageAssociation; diff --git a/src/components/Admin/DashboardPages/DashboardPageHome/index.tsx b/src/components/Admin/DashboardPages/DashboardPageHome/index.tsx new file mode 100644 index 0000000..eed4845 --- /dev/null +++ b/src/components/Admin/DashboardPages/DashboardPageHome/index.tsx @@ -0,0 +1,24 @@ +import React, { useEffect, useState } from 'react'; +import DashboardText from '../../DashboardText'; +import { IText, TextService } from '../../../../services'; + +const DashboardPageHome: React.FC = () => { + const [isTextLoading, setIsTextLoading] = useState(false); + const [texts, setTexts] = useState([]); + const [newTexts, setNewTexts] = useState(texts); + + useEffect(() => { + setIsTextLoading(true); + TextService.getAll() + .then(setTexts) + .finally(() => setIsTextLoading(false)); + }, [newTexts]); + + return ( +
+ +
+ ); +}; + +export default DashboardPageHome; diff --git a/src/components/Admin/DashboardPages/DashboardPageInformation/index.tsx b/src/components/Admin/DashboardPages/DashboardPageInformation/index.tsx new file mode 100644 index 0000000..b7cfd21 --- /dev/null +++ b/src/components/Admin/DashboardPages/DashboardPageInformation/index.tsx @@ -0,0 +1,5 @@ +import React from 'react'; + +const DashboardPageInformation: React.FC = () => (
Information
); + +export default DashboardPageInformation; diff --git a/src/components/Admin/DashboardPages/DashboardPageProgrammation/index.tsx b/src/components/Admin/DashboardPages/DashboardPageProgrammation/index.tsx new file mode 100644 index 0000000..8e88e12 --- /dev/null +++ b/src/components/Admin/DashboardPages/DashboardPageProgrammation/index.tsx @@ -0,0 +1,5 @@ +import React from 'react'; + +const DashboardPageProgrammation: React.FC = () => (
Programmation
); + +export default DashboardPageProgrammation; diff --git a/src/components/Admin/DashboardPages/index.tsx b/src/components/Admin/DashboardPages/index.tsx new file mode 100644 index 0000000..43d55f0 --- /dev/null +++ b/src/components/Admin/DashboardPages/index.tsx @@ -0,0 +1,42 @@ +import React from 'react'; +import { Tabs, TabsProps } from 'antd'; +import { ApartmentOutlined, AppstoreFilled, HomeFilled, InfoCircleFilled } from '@ant-design/icons'; +import DashboardPageHome from './DashboardPageHome'; +import DashboardPageAssociation from './DashboardPageAssociation'; +import DashboardPageProgrammation from './DashboardPageProgrammation'; +import DashboardPageInformation from './DashboardPageInformation'; + +const DashboardPages: React.FC = () => { + const pages: TabsProps['items'] = [ + { + key: '1', + label: 'Tout', + icon: , + children: + }, + { + key: '2', + label: 'Association', + icon: , + children: , + disabled: true, + }, + { + key: '3', + label: 'Programmation', + icon: , + children: , + disabled: true, + }, + { + key: '4', + label: 'Information', + icon: , + children: , + disabled: true, + } + ]; + return (); +}; + +export default DashboardPages; diff --git a/src/components/Footer/index.tsx b/src/components/Footer/index.tsx index b961e95..56160c6 100644 --- a/src/components/Footer/index.tsx +++ b/src/components/Footer/index.tsx @@ -30,13 +30,13 @@ const Footer: React.FC = () => { }); return ( -