diff --git a/src/screens/Classroom/AnnouncementsTab/index.js b/src/screens/Classroom/AnnouncementsTab/index.js index 358576e..73ce02b 100644 --- a/src/screens/Classroom/AnnouncementsTab/index.js +++ b/src/screens/Classroom/AnnouncementsTab/index.js @@ -16,225 +16,259 @@ import jitsiLogo from '../../../assets/jitsi.svg'; function AnnouncementsTab({ layoutType, announcementsTabData, classroom }) { const { container } = styles[layoutType]; - if (layoutType === 'desktop') { - return announcementsTabData && announcementsTabData.state === 'loading' ? ( - - - {createArrayFrom1ToN(3).map(i => ( - - ))} - - - {createArrayFrom1ToN(4).map(i => ( - - ))} - - - ) : announcementsTabData.state === 'gone' ? null : ( - - - - - - - Jitsi Meet -

Jitsi

-
- -
-
- - -

Próximas Atividades

- {announcementsTabData.upcomingAssignments.map(ua => ( - { + if (layoutType === 'desktop') { + switch (state) { + case 'loading': + return ( + + + {createArrayFrom1ToN(3).map(i => ( + + ))} + + + {createArrayFrom1ToN(4).map(i => ( + + ))} + + + ); + + case 'idle': + return ( + + + + - {ua.title} - - ))} - -
- - -

Horários de Atendimento

- {classroom.appointmentSlots.map((appts, index) => ( - - {appts.weekDay}, {appts.start}h - {appts.end}h - - ))} -
-
-
-
- - - {announcementsTabData.announcements.map(announcement => ( - - ))} - - -
- ); - } else if (layoutType === 'mobile') { - return announcementsTabData && announcementsTabData.state === 'loading' ? ( - - {createArrayFrom1ToN(3).map(i => ( - - ))} - {createArrayFrom1ToN(4).map(i => ( - - ))} - - ) : announcementsTabData.state === 'gone' ? null : ( - - - - - - Jitsi Meet -

Jitsi

-
+ + + Jitsi Meet +

Jitsi

+
- -
-
- - -

Próximas Atividades

- {announcementsTabData.upcomingAssignments.map(ua => ( - + Entrar + +
+
+ + +

Próximas Atividades

+ {announcementsTabData.upcomingAssignments.map(ua => ( + + {ua.title} + + ))} +
+
+ + +

+ Horários de Atendimento +

+ {classroom.appointmentSlots.map((appts, index) => ( + + {appts.weekDay}, {appts.start}h - {appts.end}h + + ))} +
+
+
+ + + - {ua.title} - + {announcementsTabData.announcements.map(announcement => ( + + ))} + + + + ); + + case 'gone': + return null; + + default: + return null; + } + } else if (layoutType === 'mobile') { + switch (state) { + case 'loading': + return ( + + {createArrayFrom1ToN(3).map(i => ( + + ))} + {createArrayFrom1ToN(4).map(i => ( + ))} - - - -

Horários de Atendimento

- {classroom.appointmentSlots.map((appts, index) => ( - - {appts.weekDay}, {appts.start}h - {appts.end}h - - ))} + ); + + case 'idle': + return ( + + + + + + Jitsi Meet +

Jitsi

+
+ + +
+
+ + +

Próximas Atividades

+ {announcementsTabData.upcomingAssignments.map(ua => ( + + {ua.title} + + ))} +
+
+ + +

Horários de Atendimento

+ {classroom.appointmentSlots.map((appts, index) => ( + + {appts.weekDay}, {appts.start}h - {appts.end}h + + ))} +
+
+
+ + {announcementsTabData.announcements.map(announcement => ( + + ))} +
-
-
- - {announcementsTabData.announcements.map(announcement => ( - - ))} - - - ); - } + ); + + case 'gone': + return null; + + default: + return null; + } + } + }; + + return layoutResolver( + announcementsTabData && announcementsTabData.state, + layoutType + ); } export default AnnouncementsTab;