From 2eb1bb96d8d633b605c75a0d9e059cac1ff4b4f8 Mon Sep 17 00:00:00 2001 From: Blazej Kustra Date: Tue, 26 Nov 2024 11:48:40 +0100 Subject: [PATCH] Revert "Final touches" This reverts commit 04d94db6fc38eb5cd30e85373c3ac58ca28ebc26. --- src/components/ApprovalWorkflowSection.tsx | 34 +++------------------- src/components/AttachmentModal.tsx | 4 ++- 2 files changed, 7 insertions(+), 31 deletions(-) diff --git a/src/components/ApprovalWorkflowSection.tsx b/src/components/ApprovalWorkflowSection.tsx index de6626c5bd5f..fd28595e7436 100644 --- a/src/components/ApprovalWorkflowSection.tsx +++ b/src/components/ApprovalWorkflowSection.tsx @@ -1,5 +1,4 @@ -/* eslint-disable react/function-component-definition */ -import React, {useCallback, useMemo, useRef} from 'react'; +import React, {useCallback, useMemo} from 'react'; import {View} from 'react-native'; import useLocalize from '@hooks/useLocalize'; import useResponsiveLayout from '@hooks/useResponsiveLayout'; @@ -21,36 +20,11 @@ type ApprovalWorkflowSectionProps = { onPress: () => void; }; -const Test = () => { - const styles = useThemeStyles(); - const theme = useTheme(); - const {shouldUseNarrowLayout} = useResponsiveLayout(); - const {translate, toLocaleOrdinal} = useLocalize(); - - const approverTitle = useCallback( - (index: number) => - approvalWorkflow.approvers.length > 1 ? `${toLocaleOrdinal(index + 1, true)} ${translate('workflowsPage.approver').toLowerCase()}` : `${translate('workflowsPage.approver')}`, - [approvalWorkflow.approvers.length, toLocaleOrdinal, translate], - ); - - const members = useMemo(() => { - if (approvalWorkflow.isDefault) { - return translate('workspace.common.everyone'); - } - - return OptionsListUtils.sortAlphabetically(approvalWorkflow.members, 'displayName') - .map((m) => m.displayName) - .join(', '); - }, [approvalWorkflow.isDefault, translate]); - - return ; -}; - function ApprovalWorkflowSection({approvalWorkflow, onPress}: ApprovalWorkflowSectionProps) { const styles = useThemeStyles(); const theme = useTheme(); - const {shouldUseNarrowLayout} = useResponsiveLayout(); const {translate, toLocaleOrdinal} = useLocalize(); + const {shouldUseNarrowLayout} = useResponsiveLayout(); const approverTitle = useCallback( (index: number) => @@ -66,7 +40,7 @@ function ApprovalWorkflowSection({approvalWorkflow, onPress}: ApprovalWorkflowSe return OptionsListUtils.sortAlphabetically(approvalWorkflow.members, 'displayName') .map((m) => m.displayName) .join(', '); - }, [approvalWorkflow]); + }, [approvalWorkflow.isDefault, approvalWorkflow.members, translate]); return (