Skip to content

Commit

Permalink
fix: MANO-PH
Browse files Browse the repository at this point in the history
  • Loading branch information
Arnaud AMBROSELLI committed Sep 15, 2023
1 parent 3e5bdf4 commit ff45d83
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 18 deletions.
8 changes: 7 additions & 1 deletion dashboard/src/scenes/action/index.js
Original file line number Diff line number Diff line change
@@ -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 (
<Switch>
<SentryRoute path="/" component={List} />
Expand Down
6 changes: 6 additions & 0 deletions dashboard/src/scenes/reception/index.js
Original file line number Diff line number Diff line change
@@ -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 (
<Switch>
<SentryRoute path="/reception" component={View} />
Expand Down
32 changes: 15 additions & 17 deletions dashboard/src/scenes/reception/view.js
Original file line number Diff line number Diff line change
Expand Up @@ -208,8 +208,8 @@ const Reception = () => {
<SmallHeader
title={
<span data-test-id="reception-title">
Accueil du <b>{formatDateWithNameOfDay(now())}</b> de l'équipe {currentTeam?.nightSession ? 'de nuit ' : ''}
<b>{currentTeam?.name || ''}</b>
Accueil du <b>{formatDateWithNameOfDay(now())}</b> de l'équipe {currentTeam.nightSession ? 'de nuit ' : ''}
<b>{currentTeam.name || ''}</b>
</span>
}
/>
Expand Down Expand Up @@ -283,7 +283,7 @@ const Reception = () => {
<ActionsCalendar
actions={dataConsolidated}
columns={['Heure', 'Nom', 'Personne suivie', 'Statut']}
isNightSession={currentTeam?.nightSession}
isNightSession={currentTeam.nightSession}
/>
</Col>
<Col md={4}>
Expand All @@ -306,20 +306,18 @@ const Reception = () => {
)}
</PassagesWrapper>
)}
{!!currentTeam && (
<ServicesWrapper>
<h5 className="services-title">Services</h5>
<div className="services-incrementators">
<ReceptionService
services={services}
onUpdateServices={setServices}
team={currentTeam}
report={todaysReport}
dateString={startOfToday().format('YYYY-MM-DD')}
/>
</div>
</ServicesWrapper>
)}
<ServicesWrapper>
<h5 className="services-title">Services</h5>
<div className="services-incrementators">
<ReceptionService
services={services}
onUpdateServices={setServices}
team={currentTeam}
report={todaysReport}
dateString={startOfToday().format('YYYY-MM-DD')}
/>
</div>
</ServicesWrapper>
</Col>
</Row>
<PassagesToday isOpen={todaysPassagesOpen} setOpen={setTodaysPassagesOpen} passages={passages} />
Expand Down

0 comments on commit ff45d83

Please sign in to comment.