From 49163a9d7f0630319860ecde68af028a7541356f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Leonardo=20Mur=C3=A7a?= Date: Thu, 11 Aug 2022 19:20:42 -0300 Subject: [PATCH] Inline tab option selection function --- src/screens/Classroom/index.js | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/screens/Classroom/index.js b/src/screens/Classroom/index.js index 7b3a48e..f86ae13 100644 --- a/src/screens/Classroom/index.js +++ b/src/screens/Classroom/index.js @@ -20,10 +20,6 @@ function Classroom() { const [tabData, setTabData] = useState(TAB_OPTIONS.announcements); - const onSelectTabOption = (_, value) => { - setSelectedTabOption(value); - }; - const fetchAndPopulateAnnouncementsTabData = useCallback(async () => { const announcements = await fetchClassroomAnnouncements(params.id); const upcomingAssignments = await fetchUpcomingAssignments(params.id); @@ -71,7 +67,7 @@ function Classroom() { layoutType={layoutType} classroom={classroom} selectedTabOption={selectedTabOption} - onSelectTabOption={onSelectTabOption} + onSelectTabOption={(_, value) => setSelectedTabOption(value)} announcementsTabData={ tabData && tabData.tab === 'announcements' ? tabData : null }