Problem
SubmitActionButton, ApproveActionButton, and PayActionButton each repeat the
same work on their own. Every one of them runs the same Onyx subscription block,
does the same transaction derivation, and defines its own confirmApproval handler.
This is duplicated logic across three components. It also means the same Onyx data
is subscribed to three times, which adds re-render work that we don't need.
Goal
- Move the shared logic into three hooks:
useReportPreviewActionButtonData
useReportPreviewFilteredTransactions
useConfirmApproveReportAction
- Update the three sub-buttons to use these hooks instead of repeating the code.
- No behavior change. The buttons should look and work exactly as before.
Related
Issue Owner
Current Issue Owner: @linhvovan29546
Problem
SubmitActionButton,ApproveActionButton, andPayActionButtoneach repeat thesame work on their own. Every one of them runs the same Onyx subscription block,
does the same transaction derivation, and defines its own
confirmApprovalhandler.This is duplicated logic across three components. It also means the same Onyx data
is subscribed to three times, which adds re-render work that we don't need.
Goal
useReportPreviewActionButtonDatauseReportPreviewFilteredTransactionsuseConfirmApproveReportActionRelated
Issue Owner
Current Issue Owner: @linhvovan29546