Skip to content

Commit

Permalink
Revert "Final touches"
Browse files Browse the repository at this point in the history
This reverts commit 04d94db.
  • Loading branch information
blazejkustra committed Nov 26, 2024
1 parent 4ff355f commit 2eb1bb9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 31 deletions.
34 changes: 4 additions & 30 deletions src/components/ApprovalWorkflowSection.tsx
Original file line number Diff line number Diff line change
@@ -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';
Expand All @@ -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 <View />;
};

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) =>
Expand All @@ -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 (
<PressableWithoutFeedback
Expand Down Expand Up @@ -136,4 +110,4 @@ function ApprovalWorkflowSection({approvalWorkflow, onPress}: ApprovalWorkflowSe
);
}

export {ApprovalWorkflowSection};
export default ApprovalWorkflowSection;
4 changes: 3 additions & 1 deletion src/components/AttachmentModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,7 @@ function AttachmentModal({
}

setIsModalOpen(false);
// eslint-disable-next-line react-compiler/react-compiler, react-hooks/exhaustive-deps
}, [isModalOpen, isConfirmButtonDisabled, onConfirm, file, sourceState]);

/**
Expand Down Expand Up @@ -457,7 +458,8 @@ function AttachmentModal({
});
}
return menuItems;
}, [isReceiptAttachment, canEditReceipt, isOffline, allowDownload, isLocalSource, transaction, translate, closeModal, iouType, report?.reportID, downloadAttachment]);
// eslint-disable-next-line react-compiler/react-compiler, react-hooks/exhaustive-deps
}, [isReceiptAttachment, transaction, file, sourceState, iouType]);

// There are a few things that shouldn't be set until we absolutely know if the file is a receipt or an attachment.
// props.isReceiptAttachment will be null until its certain what the file is, in which case it will then be true|false.
Expand Down

0 comments on commit 2eb1bb9

Please sign in to comment.