You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Please follow the plan in the design doc: Surface distance requests in App.
The display of the ReportPreview component will be modified in Scan Receipt to match the style shown in the mockup, all we need to do differently is show the route image.
For distance request actions we will display the route receipt image in the MoneyRequestAction component.
If it’s a distance request as determined by a new util function isDistanceRequest(transaction), we’ll subscribe to the transaction from MoneyRequestAction using withOnyx and the IOUTransactionID stored in action.message. Inside the function we’ll return whether transaction.type === “customUnit” and transaction.customUnit.name === “Distance”. This matches what we do on OldDot.
We can create a small ReceiptUtils.getReceiptURL(filename) function to get the url from the receipt.filename. It will return the same URL format for receipts that we use for OldDot.
We’ll set the title of the header to “Distance” if isDistanceRequest returns true. The amount will come from the transaction.amount or transaction.modifiedAmount. For distance requests the “Description” will come from the transaction.merchant instead of transaction.comment.comment as it does for manual requests, since that’s how it’s stored.
Please follow the plan in the design doc: Surface distance requests in App.
The display of the ReportPreview component will be modified in Scan Receipt to match the style shown in the mockup, all we need to do differently is show the route image.
For distance request actions we will display the route receipt image in the MoneyRequestAction component.
If it’s a distance request as determined by a new util function isDistanceRequest(transaction), we’ll subscribe to the transaction from MoneyRequestAction using withOnyx and the IOUTransactionID stored in action.message. Inside the function we’ll return whether transaction.type === “customUnit” and transaction.customUnit.name === “Distance”. This matches what we do on OldDot.
For distance requests we’ll render the receipt image above the header as described in the receipt doc.
We can create a small ReceiptUtils.getReceiptURL(filename) function to get the url from the receipt.filename. It will return the same URL format for receipts that we use for OldDot.
We’ll set the title of the header to “Distance” if isDistanceRequest returns true. The amount will come from the transaction.amount or transaction.modifiedAmount. For distance requests the “Description” will come from the transaction.merchant instead of transaction.comment.comment as it does for manual requests, since that’s how it’s stored.