diff --git a/dashboard/src/scenes/action/index.js b/dashboard/src/scenes/action/index.js index 50a091d73..0322cea29 100644 --- a/dashboard/src/scenes/action/index.js +++ b/dashboard/src/scenes/action/index.js @@ -1,10 +1,16 @@ import React from 'react'; import { Switch } from 'react-router-dom'; -import SentryRoute from '../../components/Sentryroute'; +import { useRecoilValue } from 'recoil'; import List from './list'; +import SentryRoute from '../../components/Sentryroute'; +import { currentTeamState } from '../../recoil/auth'; const Router = () => { + const currentTeam = useRecoilValue(currentTeamState); + + if (!currentTeam) return null; + return ( diff --git a/dashboard/src/scenes/reception/index.js b/dashboard/src/scenes/reception/index.js index 9de2e852c..4f41f82a6 100644 --- a/dashboard/src/scenes/reception/index.js +++ b/dashboard/src/scenes/reception/index.js @@ -1,10 +1,16 @@ import React from 'react'; import { Switch } from 'react-router-dom'; +import { useRecoilValue } from 'recoil'; import SentryRoute from '../../components/Sentryroute'; import View from './view'; +import { currentTeamState } from '../../recoil/auth'; const Router = () => { + const currentTeam = useRecoilValue(currentTeamState); + + if (!currentTeam) return null; + return ( diff --git a/dashboard/src/scenes/reception/view.js b/dashboard/src/scenes/reception/view.js index f608bb554..c216f5200 100644 --- a/dashboard/src/scenes/reception/view.js +++ b/dashboard/src/scenes/reception/view.js @@ -208,8 +208,8 @@ const Reception = () => { - Accueil du {formatDateWithNameOfDay(now())} de l'équipe {currentTeam?.nightSession ? 'de nuit ' : ''} - {currentTeam?.name || ''} + Accueil du {formatDateWithNameOfDay(now())} de l'équipe {currentTeam.nightSession ? 'de nuit ' : ''} + {currentTeam.name || ''} } /> @@ -283,7 +283,7 @@ const Reception = () => { @@ -306,20 +306,18 @@ const Reception = () => { )} )} - {!!currentTeam && ( - -
Services
-
- -
-
- )} + +
Services
+
+ +
+