From 2b0cb18f2e806b3055d297204c1eedebcdb57a8e Mon Sep 17 00:00:00 2001 From: Mateusz Rajski Date: Thu, 14 Dec 2023 15:24:14 +0100 Subject: [PATCH] Comment unused variable --- src/pages/WorkspaceSwitcherPage.js | 94 +++++++++++++++++------------- src/styles/index.ts | 2 +- 2 files changed, 56 insertions(+), 40 deletions(-) diff --git a/src/pages/WorkspaceSwitcherPage.js b/src/pages/WorkspaceSwitcherPage.js index 9b54ecf2992a..ffb955b14e20 100644 --- a/src/pages/WorkspaceSwitcherPage.js +++ b/src/pages/WorkspaceSwitcherPage.js @@ -5,7 +5,12 @@ import {withOnyx} from 'react-native-onyx'; import _ from 'underscore'; import HeaderPageLayout from '@components/HeaderPageLayout'; import * as Expensicons from '@components/Icon/Expensicons'; +import MenuItem from '@components/MenuItem'; +import OptionRow from '@components/OptionRow'; +import OptionsSelector from '@components/OptionsSelector'; +import PressableWithFeedback from '@components/Pressable/PressableWithFeedback'; import Text from '@components/Text'; +import useAutoFocusInput from '@hooks/useAutoFocusInput'; import useLocalize from '@hooks/useLocalize'; import useNetwork from '@hooks/useNetwork'; import * as PolicyUtils from '@libs/PolicyUtils'; @@ -17,8 +22,6 @@ import Icon from '@src/components/Icon'; import CONST from '@src/CONST'; import ONYXKEYS from '@src/ONYXKEYS'; import SCREENS from '@src/SCREENS'; -import PressableWithFeedback from '@components/Pressable/PressableWithFeedback'; -import OptionRow from '@components/OptionRow'; const propTypes = { /** The list of this user's policies */ @@ -65,18 +68,19 @@ function WorkspaceSwitcherPage({policies, activeWorkspaceID}) { (item) => { const keyTitle = item.translationKey ? translate(item.translationKey) : item.title; - const option = { text: keyTitle, brickRoadIndicator: getIndicatorTypeForPolicy(item.policyId), - icons: [{ - source: item.icon, - type: item.iconType, - fill: item.iconFill, - name: keyTitle, - fallbackIcon: item.fallbackIcon, - }], - } + icons: [ + { + source: item.icon, + type: item.iconType, + fill: item.iconFill, + name: keyTitle, + fallbackIcon: item.fallbackIcon, + }, + ], + }; // return ( // ); - }, [activeWorkspaceID, getIndicatorTypeForPolicy, translate], ); @@ -132,12 +135,13 @@ function WorkspaceSwitcherPage({policies, activeWorkspaceID}) { ); const usersWorkspacesSectionData = useMemo( - () => - [{ + () => [ + { data: usersWorkspaces, shouldShow: true, indexOffset: 0, - }], + }, + ], [usersWorkspaces], ); @@ -158,31 +162,44 @@ function WorkspaceSwitcherPage({policies, activeWorkspaceID}) { const getWorkspacesSection = useCallback( (workspaces, section, showAddWorkspaceButton) => ( - - - - {section} - - {showAddWorkspaceButton && - {({hovered}) => ( - + + + + {section} + + {showAddWorkspaceButton && ( + + {({hovered}) => ( + + )} + )} - } - - - {_.map(workspaces, (item, index) => getMenuItem(item, index))} - - ), - [getMenuItem, styles.alignItemsCenter, styles.borderRadiusNormal, styles.bordersBG, styles.flexRow, styles.highlightBG, styles.justifyContentBetween, styles.label, styles.mb3, styles.mh4, styles.p2, theme.textSupporting], + {_.map(workspaces, (item, index) => getMenuItem(item, index))} + + ), + [ + getMenuItem, + styles.alignItemsCenter, + styles.borderRadiusNormal, + styles.bordersBG, + styles.flexRow, + styles.highlightBG, + styles.justifyContentBetween, + styles.label, + styles.mb3, + styles.mh4, + styles.p2, + theme.textSupporting, + ], ); const allWorkspacesSection = useMemo(() => getWorkspacesSection(allWorkspaces, 'Everything', false, false), [allWorkspaces, getWorkspacesSection]); @@ -190,7 +207,6 @@ function WorkspaceSwitcherPage({policies, activeWorkspaceID}) { // const {inputCallbackRef} = useAutoFocusInput(); - return ( }, textInputLeftIconContainer: { - justifyContent: "center", + justifyContent: 'center', paddingRight: 8, },