@@ -9,28 +9,22 @@ import {
99 FcNightLandscape ,
1010 FcSportsMode ,
1111} from 'react-icons/fc' ;
12- import {
13- _cs ,
14- compareNumber ,
15- encodeDate ,
16- } from '@togglecorp/fujs' ;
12+ import { compareNumber } from '@togglecorp/fujs' ;
1713import {
1814 gql ,
1915 useQuery ,
2016} from 'urql' ;
2117
22- import Clock from '#components/Clock' ;
23- import TextOutput from '#components/TextOutput' ;
18+ import StandupConductors from '#components/StandupConductors' ;
2419import {
2520 type DeadlinesAndEventsQuery ,
2621 type DeadlinesAndEventsQueryVariables ,
27- type StandupConductorsQuery ,
28- type StandupConductorsQueryVariables ,
2922} from '#generated/types/graphql' ;
23+ import useCurrentDate from '#hooks/useCurrentDate' ;
24+ import { formatDateTime } from '#utils/common' ;
3025import { type GeneralEvent } from '#utils/types' ;
3126
3227import Slide from '../Slide' ;
33- import { STANDUP_CONDUCTORS } from '../StartSection' ;
3428import GeneralEventOutput from './GeneralEvent' ;
3529
3630import styles from './styles.module.css' ;
@@ -59,8 +53,6 @@ const DEADLINES_AND_EVENTS = gql`
5953 }
6054` ;
6155
62- const todayDate = encodeDate ( new Date ( ) ) ;
63-
6456function DeadlineSection ( ) {
6557 const [ deadlinesAndEvents ] = useQuery <
6658 DeadlinesAndEventsQuery ,
@@ -70,14 +62,6 @@ function DeadlineSection() {
7062 requestPolicy : 'cache-and-network' ,
7163 } ) ;
7264
73- const [ conductorsResponse ] = useQuery < StandupConductorsQuery , StandupConductorsQueryVariables > ( {
74- query : STANDUP_CONDUCTORS ,
75- variables : { date : todayDate } ,
76- requestPolicy : 'cache-and-network' ,
77- } ) ;
78-
79- const standupConductors = conductorsResponse . data ?. private . dailyStandup ;
80-
8165 const projects = deadlinesAndEvents . data ?. private . allProjects ;
8266 const events = deadlinesAndEvents . data ?. private . relativeEvents ;
8367
@@ -115,6 +99,7 @@ function DeadlineSection() {
11599 } ) ) ?? [ ] ) ,
116100 ] . sort ( ( a , b ) => compareNumber ( a . remainingDays , b . remainingDays ) ) ;
117101 } , [ events , projects ] ) ;
102+ const todayDate = useCurrentDate ( ) ;
118103
119104 return (
120105 < Slide
@@ -123,23 +108,8 @@ function DeadlineSection() {
123108 primaryHeading = "Daily Standup"
124109 primaryDescription = { (
125110 < div className = { styles . primarySection } >
126- < Clock />
127- < TextOutput
128- className = { _cs (
129- styles . conductor ,
130- ! standupConductors && styles . hidden ,
131- ) }
132- label = "Standup Lead"
133- value = { standupConductors ?. conductor ?. displayName ?? 'Anon' }
134- />
135- < TextOutput
136- className = { _cs (
137- styles . conductor ,
138- ! standupConductors && styles . hidden ,
139- ) }
140- label = "Acting Lead"
141- value = { standupConductors ?. fallbackConductor ?. displayName ?? 'Anon' }
142- />
111+ < div > { formatDateTime ( todayDate ) } </ div >
112+ < StandupConductors />
143113 </ div >
144114 ) }
145115 secondaryHeading = "Upcoming Events"
0 commit comments