From d6a1fa1650a72d0bb02028811dd36279ee92693b Mon Sep 17 00:00:00 2001 From: Arthur Date: Wed, 18 Oct 2023 10:29:56 +0200 Subject: [PATCH] fix merge --- src/composant-ecran.tsx | 150 +++++++++++++++++++++------------------- 1 file changed, 80 insertions(+), 70 deletions(-) diff --git a/src/composant-ecran.tsx b/src/composant-ecran.tsx index 21c9992..70dfc28 100644 --- a/src/composant-ecran.tsx +++ b/src/composant-ecran.tsx @@ -36,77 +36,80 @@ export const ComposantEcran: React.FC = (configEcran) => { const body = React.useMemo(() => { - if (error || planning == null) { - return <> - } + if (error || planning == null) { + return <> + } - const isPortrait = configEcran.orientation === "portrait"; - if (configEcran.id == "A801") { - return - } else if (configEcran.id === "GG01" || configEcran.id === "GG02") { - return - } else if (configEcran.directions) { - return - } else if (configEcran.tags?.includes("vestiaire")) { - if (currentDate.getDate() == 19) { - body = - } else if (currentDate.getDate() == 20) { - body = - } else { - body = - } - } else if (format(currentDate, "HH:mm") > "18:30" && currentDate.getDate() == 19) { - return - } else if (currentDate.getHours() >= 12 && format(currentDate, "HH:mm") < "13:30") { - return - } else if (currentDate.getHours() >= 18 && currentDate.getDate() == 20) { - return - } else if (format(currentDate, "HH:mm") > "17:10" && currentDate.getDate() == 20 && configEcran.nom !== "Jules Verne") { - return - } else if (formatISO(currentDate) < "2023-10-19T09:40" && configEcran.nom !== "Jules Verne") { - return - } else if (isSalle) { - const talksSalle = planning - .filter(talk => talk.room?.name === configEcran.nom) - .sort((a, b) => new Date(a.startsAt).getTime() - new Date(b.startsAt).getTime()) - const talkEnCours = talksSalle.find(talk => - new Date(talk.startsAt) <= currentDate && - new Date(talk.endsAt) >= currentDate) + const isPortrait = configEcran.orientation === "portrait"; + if (configEcran.id == "A801") { + return + } else if (configEcran.id === "GG01" || configEcran.id === "GG02") { + return + } else if (configEcran.directions) { + return + } else if (configEcran.tags?.includes("vestiaire")) { + if (currentDate.getDate() == 19) { + return + } else if (currentDate.getDate() == 20) { + return + } else { + return + } + } else if (format(currentDate, "HH:mm") > "18:30" && currentDate.getDate() == 19) { + return + } else if (currentDate.getHours() >= 12 && format(currentDate, "HH:mm") < "13:30") { + return + } else if (currentDate.getHours() >= 18 && currentDate.getDate() == 20) { + return + } else if (format(currentDate, "HH:mm") > "17:10" && currentDate.getDate() == 20 && configEcran.nom !== "Jules Verne") { + return + } else if (formatISO(currentDate) < "2023-10-19T09:40" && configEcran.nom !== "Jules Verne") { + return + } else if (isSalle) { + const talksSalle = planning + .filter(talk => talk.room?.name === configEcran.nom) + .sort((a, b) => new Date(a.startsAt).getTime() - new Date(b.startsAt).getTime()) + const talkEnCours = talksSalle.find(talk => + new Date(talk.startsAt) <= currentDate && + new Date(talk.endsAt) >= currentDate) - const prochainTalk = talksSalle.find(talk => - (new Date(talk.startsAt).getDate() === currentDate.getDate() || configEcran.nom === 'Jules Verne') && - new Date(talk.startsAt) > currentDate) + const prochainTalk = talksSalle.find(talk => + (new Date(talk.startsAt).getDate() === currentDate.getDate() || configEcran.nom === 'Jules Verne') && + new Date(talk.startsAt) > currentDate) - if (talkEnCours) { - body = - } else if (prochainTalk) { - body = - } - return - }, [dateDebounced, error, planning]) + if (talkEnCours) { + return + } else if (prochainTalk) { + return + } + return + } + }, + [dateDebounced, error, planning] + ) return <> {body} @@ -115,7 +118,11 @@ export const ComposantEcran: React.FC = (configEcran) => { } -const TalkRemotion: React.FC<{ talk: Talk, portrait?: boolean, displayName?: RoomName }> = ({talk, portrait, displayName}) => { +const TalkRemotion: React.FC<{ talk: Talk, portrait?: boolean, displayName?: RoomName }> = ({ + talk, + portrait, + displayName + }) => { const currentTemplate = portrait ? { compositionName: 'DevfestNantesTalkLoopTotem', component: DevfestNantesLoopTotem, @@ -130,7 +137,7 @@ const TalkRemotion: React.FC<{ talk: Talk, portrait?: boolean, displayName?: Roo durationInFrames: 350, }; const inputShortVid = formatTalkToShortvid(talk); - if(displayName) inputShortVid.location = displayName; + if (displayName) inputShortVid.location = displayName; return { /> } -const AffichageZoneRemotion: React.FC<{ configAffiche: ConfigAfficheShortVid, portrait?: boolean }> = ({configAffiche, portrait}) => { +const AffichageZoneRemotion: React.FC<{ configAffiche: ConfigAfficheShortVid, portrait?: boolean }> = ({ + configAffiche, + portrait + }) => { const currentTemplate = portrait ? { compositionName: 'DevfestNantesTalkLoopTotem', component: DevfestNantesLoopTotem,