From 049c487eb6e1d510b2cc532a28b220ab7a6bf2ed Mon Sep 17 00:00:00 2001 From: Filip Solecki Date: Thu, 7 Mar 2024 09:27:37 +0100 Subject: [PATCH 01/18] Create WorkspaceTaxesPage --- .../simple-illustration__coins.svg | 23 +++ assets/images/tax.svg | 8 ++ src/ROUTES.ts | 4 + src/SCREENS.ts | 1 + src/components/Icon/Expensicons.ts | 2 + src/components/Icon/Illustrations.ts | 2 + src/languages/en.ts | 4 + src/languages/es.ts | 4 + .../BaseCentralPaneNavigator.tsx | 1 + .../TAB_TO_CENTRAL_PANE_MAPPING.ts | 1 + src/libs/Navigation/linkingConfig/config.ts | 3 + src/libs/Navigation/types.ts | 3 + src/pages/workspace/WorkspaceInitialPage.tsx | 6 + .../workspace/taxes/WorkspaceTaxesPage.tsx | 134 ++++++++++++++++++ 14 files changed, 196 insertions(+) create mode 100644 assets/images/simple-illustrations/simple-illustration__coins.svg create mode 100644 assets/images/tax.svg create mode 100644 src/pages/workspace/taxes/WorkspaceTaxesPage.tsx diff --git a/assets/images/simple-illustrations/simple-illustration__coins.svg b/assets/images/simple-illustrations/simple-illustration__coins.svg new file mode 100644 index 000000000000..def1dda9073c --- /dev/null +++ b/assets/images/simple-illustrations/simple-illustration__coins.svg @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/images/tax.svg b/assets/images/tax.svg new file mode 100644 index 000000000000..7a2c68170652 --- /dev/null +++ b/assets/images/tax.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/src/ROUTES.ts b/src/ROUTES.ts index bc8af4df5686..9704bf047315 100644 --- a/src/ROUTES.ts +++ b/src/ROUTES.ts @@ -554,6 +554,10 @@ const ROUTES = { route: 'workspace/:policyID/tags', getRoute: (policyID: string) => `workspace/${policyID}/tags` as const, }, + WORKSPACE_TAXES: { + route: 'workspace/:policyID/taxes', + getRoute: (policyID: string) => `workspace/${policyID}/taxes` as const, + }, // Referral program promotion REFERRAL_DETAILS_MODAL: { route: 'referral/:contentType', diff --git a/src/SCREENS.ts b/src/SCREENS.ts index 17073d289f8f..27909319b724 100644 --- a/src/SCREENS.ts +++ b/src/SCREENS.ts @@ -215,6 +215,7 @@ const SCREENS = { INVITE_MESSAGE: 'Workspace_Invite_Message', CATEGORIES: 'Workspace_Categories', TAGS: 'Workspace_Tags', + TAXES: 'Workspace_Taxes', CURRENCY: 'Workspace_Profile_Currency', WORKFLOWS: 'Workspace_Workflows', WORKFLOWS_APPROVER: 'Workspace_Workflows_Approver', diff --git a/src/components/Icon/Expensicons.ts b/src/components/Icon/Expensicons.ts index d9f46203a703..565caa261219 100644 --- a/src/components/Icon/Expensicons.ts +++ b/src/components/Icon/Expensicons.ts @@ -137,6 +137,7 @@ import Stopwatch from '@assets/images/stopwatch.svg'; import Sync from '@assets/images/sync.svg'; import Tag from '@assets/images/tag.svg'; import Task from '@assets/images/task.svg'; +import Tax from '@assets/images/tax.svg'; import ThreeDots from '@assets/images/three-dots.svg'; import ThumbsUp from '@assets/images/thumbs-up.svg'; import Transfer from '@assets/images/transfer.svg'; @@ -224,6 +225,7 @@ export { Fullscreen, Folder, Tag, + Tax, Gallery, Gear, Globe, diff --git a/src/components/Icon/Illustrations.ts b/src/components/Icon/Illustrations.ts index 7f60ad3867c8..abe592c07246 100644 --- a/src/components/Icon/Illustrations.ts +++ b/src/components/Icon/Illustrations.ts @@ -35,6 +35,7 @@ import BigRocket from '@assets/images/simple-illustrations/simple-illustration__ import PinkBill from '@assets/images/simple-illustrations/simple-illustration__bill.svg'; import ChatBubbles from '@assets/images/simple-illustrations/simple-illustration__chatbubbles.svg'; import CoffeeMug from '@assets/images/simple-illustrations/simple-illustration__coffeemug.svg'; +import Coins from '@assets/images/simple-illustrations/simple-illustration__coins.svg'; import CommentBubbles from '@assets/images/simple-illustrations/simple-illustration__commentbubbles.svg'; import ConciergeBubble from '@assets/images/simple-illustrations/simple-illustration__concierge-bubble.svg'; import ConciergeNew from '@assets/images/simple-illustrations/simple-illustration__concierge.svg'; @@ -148,4 +149,5 @@ export { ThreeLeggedLaptopWoman, House, Tag, + Coins, }; diff --git a/src/languages/en.ts b/src/languages/en.ts index 1ba613610723..715640bbb200 100755 --- a/src/languages/en.ts +++ b/src/languages/en.ts @@ -1732,6 +1732,7 @@ export default { reimburse: 'Reimbursements', categories: 'Categories', tags: 'Tags', + taxes: 'Taxes', bills: 'Bills', invoices: 'Invoices', travel: 'Travel', @@ -1784,6 +1785,9 @@ export default { subtitle: 'Add a tag to track projects, locations, departments, and more.', }, }, + taxes: { + subtitle: 'Add tax names, rates, and set defaults.', + }, emptyWorkspace: { title: 'Create a workspace', subtitle: 'Workspaces are where you’ll chat with your team, reimburse expenses, issue cards, send invoices, pay bills, and more - all in one place.', diff --git a/src/languages/es.ts b/src/languages/es.ts index acbb70308167..07f978a6d755 100644 --- a/src/languages/es.ts +++ b/src/languages/es.ts @@ -1756,6 +1756,7 @@ export default { reimburse: 'Reembolsos', categories: 'Categorías', tags: 'Etiquetas', + taxes: 'Impuestos', bills: 'Pagar facturas', invoices: 'Enviar facturas', travel: 'Viajes', @@ -1808,6 +1809,9 @@ export default { subtitle: 'Añade una etiqueta para realizar el seguimiento de proyectos, ubicaciones, departamentos y otros.', }, }, + taxes: { + subtitle: 'Añada nombres de impuestos, tipos impositivos y establezca valores por defecto.', + }, emptyWorkspace: { title: 'Crea un espacio de trabajo', subtitle: 'En los espacios de trabajo podrás chatear con tu equipo, reembolsar gastos, emitir tarjetas, enviar y pagar facturas, y mucho más - todo en un mismo lugar.', diff --git a/src/libs/Navigation/AppNavigator/Navigators/CentralPaneNavigator/BaseCentralPaneNavigator.tsx b/src/libs/Navigation/AppNavigator/Navigators/CentralPaneNavigator/BaseCentralPaneNavigator.tsx index 976699e31716..7cdbb6a28dcc 100644 --- a/src/libs/Navigation/AppNavigator/Navigators/CentralPaneNavigator/BaseCentralPaneNavigator.tsx +++ b/src/libs/Navigation/AppNavigator/Navigators/CentralPaneNavigator/BaseCentralPaneNavigator.tsx @@ -25,6 +25,7 @@ const workspaceSettingsScreens = { [SCREENS.WORKSPACE.MEMBERS]: () => require('../../../../../pages/workspace/WorkspaceMembersPage').default as React.ComponentType, [SCREENS.WORKSPACE.CATEGORIES]: () => require('../../../../../pages/workspace/categories/WorkspaceCategoriesPage').default as React.ComponentType, [SCREENS.WORKSPACE.TAGS]: () => require('../../../../../pages/workspace/tags/WorkspaceTagsPage').default as React.ComponentType, + [SCREENS.WORKSPACE.TAXES]: () => require('../../../../../pages/workspace/taxes/WorkspaceTaxesPage').default as React.ComponentType, } satisfies Screens; function BaseCentralPaneNavigator() { diff --git a/src/libs/Navigation/linkingConfig/TAB_TO_CENTRAL_PANE_MAPPING.ts b/src/libs/Navigation/linkingConfig/TAB_TO_CENTRAL_PANE_MAPPING.ts index f4316009b70b..a479ea065d83 100755 --- a/src/libs/Navigation/linkingConfig/TAB_TO_CENTRAL_PANE_MAPPING.ts +++ b/src/libs/Navigation/linkingConfig/TAB_TO_CENTRAL_PANE_MAPPING.ts @@ -14,6 +14,7 @@ const TAB_TO_CENTRAL_PANE_MAPPING: Record = { SCREENS.WORKSPACE.TRAVEL, SCREENS.WORKSPACE.MEMBERS, SCREENS.WORKSPACE.CATEGORIES, + SCREENS.WORKSPACE.TAXES, ], }; diff --git a/src/libs/Navigation/linkingConfig/config.ts b/src/libs/Navigation/linkingConfig/config.ts index d3eb6d6a4c2b..0cae5e34e958 100644 --- a/src/libs/Navigation/linkingConfig/config.ts +++ b/src/libs/Navigation/linkingConfig/config.ts @@ -70,6 +70,9 @@ const config: LinkingOptions['config'] = { [SCREENS.WORKSPACE.TAGS]: { path: ROUTES.WORKSPACE_TAGS.route, }, + [SCREENS.WORKSPACE.TAXES]: { + path: ROUTES.WORKSPACE_TAXES.route, + }, }, }, [SCREENS.NOT_FOUND]: '*', diff --git a/src/libs/Navigation/types.ts b/src/libs/Navigation/types.ts index 12b2802cb3fa..5c64dd62fd43 100644 --- a/src/libs/Navigation/types.ts +++ b/src/libs/Navigation/types.ts @@ -95,6 +95,9 @@ type CentralPaneNavigatorParamList = { policyID: string; categoryName: string; }; + [SCREENS.WORKSPACE.TAXES]: { + policyID: string; + }; }; type WorkspaceSwitcherNavigatorParamList = { diff --git a/src/pages/workspace/WorkspaceInitialPage.tsx b/src/pages/workspace/WorkspaceInitialPage.tsx index d2565022075a..e1b627944cfe 100644 --- a/src/pages/workspace/WorkspaceInitialPage.tsx +++ b/src/pages/workspace/WorkspaceInitialPage.tsx @@ -161,6 +161,12 @@ function WorkspaceInitialPage({policyDraft, policy: policyProp, policyMembers, r action: singleExecution(waitForNavigate(() => Navigation.navigate(ROUTES.WORKSPACE_TAGS.getRoute(policyID)))), routeName: SCREENS.WORKSPACE.TAGS, }, + { + translationKey: 'workspace.common.taxes', + icon: Expensicons.Tax, + action: singleExecution(waitForNavigate(() => Navigation.navigate(ROUTES.WORKSPACE_TAXES.getRoute(policyID)))), + routeName: SCREENS.WORKSPACE.TAXES, + }, ]; const menuItems: WorkspaceMenuItem[] = [ diff --git a/src/pages/workspace/taxes/WorkspaceTaxesPage.tsx b/src/pages/workspace/taxes/WorkspaceTaxesPage.tsx new file mode 100644 index 000000000000..1eff4b8d1330 --- /dev/null +++ b/src/pages/workspace/taxes/WorkspaceTaxesPage.tsx @@ -0,0 +1,134 @@ +import type {StackScreenProps} from '@react-navigation/stack'; +import React, {useMemo, useState} from 'react'; +import {View} from 'react-native'; +import HeaderWithBackButton from '@components/HeaderWithBackButton'; +import Icon from '@components/Icon'; +import * as Expensicons from '@components/Icon/Expensicons'; +import * as Illustrations from '@components/Icon/Illustrations'; +import ScreenWrapper from '@components/ScreenWrapper'; +import SelectionList from '@components/SelectionList'; +import TableListItem from '@components/SelectionList/TableListItem'; +import Text from '@components/Text'; +import WorkspaceEmptyStateSection from '@components/WorkspaceEmptyStateSection'; +import useLocalize from '@hooks/useLocalize'; +import useTheme from '@hooks/useTheme'; +import useThemeStyles from '@hooks/useThemeStyles'; +import useWindowDimensions from '@hooks/useWindowDimensions'; +import type {CentralPaneNavigatorParamList} from '@navigation/types'; +import AdminPolicyAccessOrNotFoundWrapper from '@pages/workspace/AdminPolicyAccessOrNotFoundWrapper'; +import PaidPolicyAccessOrNotFoundWrapper from '@pages/workspace/PaidPolicyAccessOrNotFoundWrapper'; +import withPolicyAndFullscreenLoading from '@pages/workspace/withPolicyAndFullscreenLoading'; +import type {WithPolicyAndFullscreenLoadingProps} from '@pages/workspace/withPolicyAndFullscreenLoading'; +import type SCREENS from '@src/SCREENS'; + +type PolicyForList = { + value: string; + text: string; + keyForList: string; + isSelected: boolean; + rightElement: React.ReactNode; +}; + +type WorkspaceTaxesPageProps = WithPolicyAndFullscreenLoadingProps & StackScreenProps; + +function WorkspaceTaxesPage({policy}: WorkspaceTaxesPageProps) { + const {isSmallScreenWidth} = useWindowDimensions(); + const styles = useThemeStyles(); + const theme = useTheme(); + const {translate} = useLocalize(); + const [selectedTaxes, setSelectedTaxes] = useState([]); + + const taxesList = useMemo( + () => + Object.entries(policy?.taxRates?.taxes ?? {}).map(([key, value]) => ({ + // TODO: Clean up: check if all properties are needed + value: value.name, + text: value.name, + keyForList: key, + isSelected: !!selectedTaxes.includes(key), + rightElement: ( + // TODO: Extract this into a separate component together with WorkspaceCategoriesPage + + {value.isDisabled ? translate('workspace.common.disabled') : translate('workspace.common.enabled')} + + + + + ), + })), + [policy?.taxRates?.taxes, selectedTaxes, styles, theme.icon, translate], + ); + + const toggleTax = (tax: PolicyForList) => { + setSelectedTaxes((prev) => { + if (prev.includes(tax.keyForList)) { + return prev.filter((item) => item !== tax.keyForList); + } + return [...prev, tax.keyForList]; + }); + }; + + const toggleAllTaxes = () => { + const isAllSelected = selectedTaxes.length === taxesList.length; + if (isAllSelected) { + setSelectedTaxes([]); + } else { + setSelectedTaxes(taxesList.map((item) => item.keyForList)); + } + }; + + const getCustomListHeader = () => ( + + {translate('common.name')} + {translate('statusPage.status')} + + ); + + return ( + + + + + + {translate('workspace.taxes.subtitle')} + + {taxesList.length ? ( + {}} + onSelectAll={toggleAllTaxes} + showScrollIndicator + ListItem={TableListItem} + customListHeader={getCustomListHeader()} + listHeaderWrapperStyle={[styles.ph9, styles.pv3, styles.pb5]} + /> + ) : ( + + )} + + + + ); +} + +WorkspaceTaxesPage.displayName = 'WorkspaceTaxesPage'; + +export default withPolicyAndFullscreenLoading(WorkspaceTaxesPage); From a491463fb60849b7aac7129468fa1b5276c568e5 Mon Sep 17 00:00:00 2001 From: Filip Solecki Date: Thu, 7 Mar 2024 09:30:14 +0100 Subject: [PATCH 02/18] Remove unnecessary check --- .../workspace/taxes/WorkspaceTaxesPage.tsx | 30 +++++++------------ 1 file changed, 11 insertions(+), 19 deletions(-) diff --git a/src/pages/workspace/taxes/WorkspaceTaxesPage.tsx b/src/pages/workspace/taxes/WorkspaceTaxesPage.tsx index 1eff4b8d1330..4a19262b5a03 100644 --- a/src/pages/workspace/taxes/WorkspaceTaxesPage.tsx +++ b/src/pages/workspace/taxes/WorkspaceTaxesPage.tsx @@ -104,25 +104,17 @@ function WorkspaceTaxesPage({policy}: WorkspaceTaxesPageProps) { {translate('workspace.taxes.subtitle')} - {taxesList.length ? ( - {}} - onSelectAll={toggleAllTaxes} - showScrollIndicator - ListItem={TableListItem} - customListHeader={getCustomListHeader()} - listHeaderWrapperStyle={[styles.ph9, styles.pv3, styles.pb5]} - /> - ) : ( - - )} + {}} + onSelectAll={toggleAllTaxes} + showScrollIndicator + ListItem={TableListItem} + customListHeader={getCustomListHeader()} + listHeaderWrapperStyle={[styles.ph9, styles.pv3, styles.pb5]} + /> From bc180016b4373ae678961b4e2c077beaabb5ae51 Mon Sep 17 00:00:00 2001 From: Filip Solecki Date: Thu, 7 Mar 2024 09:35:29 +0100 Subject: [PATCH 03/18] Remove unnecessary import --- src/pages/workspace/taxes/WorkspaceTaxesPage.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/src/pages/workspace/taxes/WorkspaceTaxesPage.tsx b/src/pages/workspace/taxes/WorkspaceTaxesPage.tsx index 4a19262b5a03..40bdc7d5938e 100644 --- a/src/pages/workspace/taxes/WorkspaceTaxesPage.tsx +++ b/src/pages/workspace/taxes/WorkspaceTaxesPage.tsx @@ -9,7 +9,6 @@ import ScreenWrapper from '@components/ScreenWrapper'; import SelectionList from '@components/SelectionList'; import TableListItem from '@components/SelectionList/TableListItem'; import Text from '@components/Text'; -import WorkspaceEmptyStateSection from '@components/WorkspaceEmptyStateSection'; import useLocalize from '@hooks/useLocalize'; import useTheme from '@hooks/useTheme'; import useThemeStyles from '@hooks/useThemeStyles'; From 0ff706757fcd7c09ecd3ebb9f1b6380539118562 Mon Sep 17 00:00:00 2001 From: Filip Solecki Date: Thu, 7 Mar 2024 09:37:03 +0100 Subject: [PATCH 04/18] Fix icon fill color --- assets/images/tax.svg | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/assets/images/tax.svg b/assets/images/tax.svg index 7a2c68170652..8989dde8f71c 100644 --- a/assets/images/tax.svg +++ b/assets/images/tax.svg @@ -1,8 +1,8 @@ - - - - - - + + + + + + From 2d4380803f7bf3a4285a7d46e9fb2b512f294b7e Mon Sep 17 00:00:00 2001 From: Filip Solecki Date: Thu, 7 Mar 2024 10:07:04 +0100 Subject: [PATCH 05/18] CR fixes --- src/pages/workspace/WorkspaceInitialPage.tsx | 1 + .../workspace/taxes/WorkspaceTaxesPage.tsx | 23 +++++++++---------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/pages/workspace/WorkspaceInitialPage.tsx b/src/pages/workspace/WorkspaceInitialPage.tsx index e1b627944cfe..760c6727519c 100644 --- a/src/pages/workspace/WorkspaceInitialPage.tsx +++ b/src/pages/workspace/WorkspaceInitialPage.tsx @@ -161,6 +161,7 @@ function WorkspaceInitialPage({policyDraft, policy: policyProp, policyMembers, r action: singleExecution(waitForNavigate(() => Navigation.navigate(ROUTES.WORKSPACE_TAGS.getRoute(policyID)))), routeName: SCREENS.WORKSPACE.TAGS, }, + // TODO: Check if user enabled Taxes in More Features page { translationKey: 'workspace.common.taxes', icon: Expensicons.Tax, diff --git a/src/pages/workspace/taxes/WorkspaceTaxesPage.tsx b/src/pages/workspace/taxes/WorkspaceTaxesPage.tsx index 40bdc7d5938e..2f7038442c29 100644 --- a/src/pages/workspace/taxes/WorkspaceTaxesPage.tsx +++ b/src/pages/workspace/taxes/WorkspaceTaxesPage.tsx @@ -35,18 +35,16 @@ function WorkspaceTaxesPage({policy}: WorkspaceTaxesPageProps) { const styles = useThemeStyles(); const theme = useTheme(); const {translate} = useLocalize(); - const [selectedTaxes, setSelectedTaxes] = useState([]); + const [selectedTaxesIDs, setSelectedTaxesIDs] = useState([]); const taxesList = useMemo( () => Object.entries(policy?.taxRates?.taxes ?? {}).map(([key, value]) => ({ - // TODO: Clean up: check if all properties are needed value: value.name, text: value.name, keyForList: key, - isSelected: !!selectedTaxes.includes(key), + isSelected: !!selectedTaxesIDs.includes(key), rightElement: ( - // TODO: Extract this into a separate component together with WorkspaceCategoriesPage {value.isDisabled ? translate('workspace.common.disabled') : translate('workspace.common.enabled')} @@ -58,11 +56,11 @@ function WorkspaceTaxesPage({policy}: WorkspaceTaxesPageProps) { ), })), - [policy?.taxRates?.taxes, selectedTaxes, styles, theme.icon, translate], + [policy?.taxRates?.taxes, selectedTaxesIDs, styles, theme.icon, translate], ); const toggleTax = (tax: PolicyForList) => { - setSelectedTaxes((prev) => { + setSelectedTaxesIDs((prev) => { if (prev.includes(tax.keyForList)) { return prev.filter((item) => item !== tax.keyForList); } @@ -71,12 +69,13 @@ function WorkspaceTaxesPage({policy}: WorkspaceTaxesPageProps) { }; const toggleAllTaxes = () => { - const isAllSelected = selectedTaxes.length === taxesList.length; - if (isAllSelected) { - setSelectedTaxes([]); - } else { - setSelectedTaxes(taxesList.map((item) => item.keyForList)); - } + setSelectedTaxesIDs((prev) => { + if (prev.length === taxesList.length) { + return []; + } + + return taxesList.map((item) => item.keyForList); + }); }; const getCustomListHeader = () => ( From b63bcbb18a58e7a9e45ca5680eb95632214f3247 Mon Sep 17 00:00:00 2001 From: Filip Solecki Date: Thu, 7 Mar 2024 10:57:04 +0100 Subject: [PATCH 06/18] use ListItem type --- src/pages/workspace/taxes/WorkspaceTaxesPage.tsx | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/src/pages/workspace/taxes/WorkspaceTaxesPage.tsx b/src/pages/workspace/taxes/WorkspaceTaxesPage.tsx index 2f7038442c29..fd5546bfa7bd 100644 --- a/src/pages/workspace/taxes/WorkspaceTaxesPage.tsx +++ b/src/pages/workspace/taxes/WorkspaceTaxesPage.tsx @@ -8,6 +8,7 @@ import * as Illustrations from '@components/Icon/Illustrations'; import ScreenWrapper from '@components/ScreenWrapper'; import SelectionList from '@components/SelectionList'; import TableListItem from '@components/SelectionList/TableListItem'; +import type {ListItem} from '@components/SelectionList/types'; import Text from '@components/Text'; import useLocalize from '@hooks/useLocalize'; import useTheme from '@hooks/useTheme'; @@ -20,14 +21,6 @@ import withPolicyAndFullscreenLoading from '@pages/workspace/withPolicyAndFullsc import type {WithPolicyAndFullscreenLoadingProps} from '@pages/workspace/withPolicyAndFullscreenLoading'; import type SCREENS from '@src/SCREENS'; -type PolicyForList = { - value: string; - text: string; - keyForList: string; - isSelected: boolean; - rightElement: React.ReactNode; -}; - type WorkspaceTaxesPageProps = WithPolicyAndFullscreenLoadingProps & StackScreenProps; function WorkspaceTaxesPage({policy}: WorkspaceTaxesPageProps) { @@ -37,10 +30,9 @@ function WorkspaceTaxesPage({policy}: WorkspaceTaxesPageProps) { const {translate} = useLocalize(); const [selectedTaxesIDs, setSelectedTaxesIDs] = useState([]); - const taxesList = useMemo( + const taxesList = useMemo( () => Object.entries(policy?.taxRates?.taxes ?? {}).map(([key, value]) => ({ - value: value.name, text: value.name, keyForList: key, isSelected: !!selectedTaxesIDs.includes(key), @@ -59,7 +51,7 @@ function WorkspaceTaxesPage({policy}: WorkspaceTaxesPageProps) { [policy?.taxRates?.taxes, selectedTaxesIDs, styles, theme.icon, translate], ); - const toggleTax = (tax: PolicyForList) => { + const toggleTax = (tax: ListItem) => { setSelectedTaxesIDs((prev) => { if (prev.includes(tax.keyForList)) { return prev.filter((item) => item !== tax.keyForList); From a97c874bc88ea691b29d39c18a6a26bcfc3273bd Mon Sep 17 00:00:00 2001 From: Filip Solecki Date: Thu, 7 Mar 2024 11:10:48 +0100 Subject: [PATCH 07/18] Fix tax icon --- assets/images/tax.svg | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/assets/images/tax.svg b/assets/images/tax.svg index 8989dde8f71c..cd16ff091340 100644 --- a/assets/images/tax.svg +++ b/assets/images/tax.svg @@ -1,8 +1,8 @@ - - - - - - + + + + + + From 60aa7d32b9f882b34129f003fcc63d1dd5d44fbb Mon Sep 17 00:00:00 2001 From: Filip Solecki Date: Thu, 7 Mar 2024 11:25:36 +0100 Subject: [PATCH 08/18] Fix icon tax fill --- assets/images/tax.svg | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/assets/images/tax.svg b/assets/images/tax.svg index cd16ff091340..aa3c68e72ea8 100644 --- a/assets/images/tax.svg +++ b/assets/images/tax.svg @@ -1,8 +1,8 @@ - - - - - - - + + + + + + + From e933a60f6e582d47baac869f9db1959e5386f7a5 Mon Sep 17 00:00:00 2001 From: Filip Solecki Date: Thu, 7 Mar 2024 14:49:56 +0100 Subject: [PATCH 09/18] Header buttons --- .../workspace/taxes/WorkspaceTaxesPage.tsx | 28 ++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/src/pages/workspace/taxes/WorkspaceTaxesPage.tsx b/src/pages/workspace/taxes/WorkspaceTaxesPage.tsx index fd5546bfa7bd..b19a69adebe2 100644 --- a/src/pages/workspace/taxes/WorkspaceTaxesPage.tsx +++ b/src/pages/workspace/taxes/WorkspaceTaxesPage.tsx @@ -1,6 +1,7 @@ import type {StackScreenProps} from '@react-navigation/stack'; import React, {useMemo, useState} from 'react'; import {View} from 'react-native'; +import Button from '@components/Button'; import HeaderWithBackButton from '@components/HeaderWithBackButton'; import Icon from '@components/Icon'; import * as Expensicons from '@components/Icon/Expensicons'; @@ -77,6 +78,26 @@ function WorkspaceTaxesPage({policy}: WorkspaceTaxesPageProps) { ); + const headerButtons = ( + +