- Design doc
- This will be similar to the ReceiptSelector component we have in the receipt scan flow.
- The component will just render the SVG + background + border and the onPress callback should launch the receipt selector
- The component can have a the normal border, or a red border, based on a prop
hasError
onPress callback should launch the receipt selector, like the ... > Replace menu currently does
- When selecting a receipt, we should call ReplaceReceipt with the corresponding transactionID
- The red text shown in the screenshot at the bottom "Receipt required for amounts over $100", is not part of this component
- As part of this change let's also update this code in MoneyRequestView so that if
hasReceipt is false and permissions.canUseViolations() is true we show the ReceiptEmptyState component
permissions.canUseViolations doesn't exist yet so let's add it as part of this change, and make it return true if the user is in the BETA_VIOLATIONS = 'violations' beta
Here's the red border

Here are some tests to include in the PR to make sure everything is working correctly
permissions.canUseViolations returns true for user on the violations beta, and false otherwise
- ReceiptEmptyState shows normal border when
!hasErrors and red border when hasErrors
- Open money request without a receipt, confirm ReceiptEmptyState is shown, action ReceiptEmptyState
- Import from photo library
- Import from Files
- Upload receipt by taking photo
- Confirm new receipt is attached to the money request and saved successfully
hasErroronPresscallback should launch the receipt selector, like the... > Replacemenu currently doeshasReceiptis false andpermissions.canUseViolations()is true we show the ReceiptEmptyState componentpermissions.canUseViolationsdoesn't exist yet so let's add it as part of this change, and make it return true if the user is in theBETA_VIOLATIONS = 'violations'betaHere's the red border

Here are some tests to include in the PR to make sure everything is working correctly
permissions.canUseViolationsreturns true for user on the violations beta, and false otherwise!hasErrorsand red border whenhasErrors