Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 22 additions & 17 deletions src/components/HoldOrRejectEducationalModal.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React from 'react';
import {View} from 'react-native';
import useBeforeRemove from '@hooks/useBeforeRemove';
import {useMemoizedLazyIllustrations} from '@hooks/useLazyAsset';
import useLocalize from '@hooks/useLocalize';
import useThemeStyles from '@hooks/useThemeStyles';
import variables from '@styles/variables';
Expand All @@ -9,7 +10,6 @@ import type {TranslationPaths} from '@src/languages/types';
import type IconAsset from '@src/types/utils/IconAsset';
import FeatureTrainingModal from './FeatureTrainingModal';
import Icon from './Icon';
import * as Illustrations from './Icon/Illustrations';
import Text from './Text';

type SectionMenuItem = {
Expand All @@ -28,33 +28,38 @@ type HoldOrRejectEducationalModalProps = {
onConfirm: () => void;
};

const menuSections: SectionMenuItem[] = [
{
icon: Illustrations.Stopwatch,
titleTranslationKey: 'iou.reject.holdExpenseTitle',
},
{
icon: Illustrations.RealtimeReport,
titleTranslationKey: 'iou.reject.heldExpenseLeftBehindTitle',
},
{
icon: Illustrations.ThumbsDown,
titleTranslationKey: 'iou.reject.rejectExpenseTitle',
},
];

function HoldOrRejectEducationalModal({onClose, onConfirm}: HoldOrRejectEducationalModalProps) {
const {translate} = useLocalize();
const styles = useThemeStyles();
const illustrations = useMemoizedLazyIllustrations(['Stopwatch', 'Rules', 'RealtimeReport', 'ThumbsDown', 'ModalHoldOrReject']);

useBeforeRemove(onClose);

const menuSections: SectionMenuItem[] = [
{
icon: illustrations.Stopwatch,
titleTranslationKey: 'iou.reject.holdExpenseTitle',
},
{
icon: illustrations.Rules,
titleTranslationKey: 'iou.reject.approveExpenseTitle',
},
{
icon: illustrations.RealtimeReport,
titleTranslationKey: 'iou.reject.heldExpenseLeftBehindTitle',
},
{
icon: illustrations.ThumbsDown,
titleTranslationKey: 'iou.reject.rejectExpenseTitle',
},
];

return (
<FeatureTrainingModal
title={translate('iou.reject.educationalTitle')}
description={translate('iou.reject.educationalText')}
confirmText={translate('common.buttonConfirm')}
image={Illustrations.ModalHoldOrReject}
image={illustrations.ModalHoldOrReject}
contentFitImage="cover"
width={variables.holdEducationModalWidth}
illustrationAspectRatio={CONST.ILLUSTRATION_ASPECT_RATIO}
Expand Down
2 changes: 2 additions & 0 deletions src/components/Icon/Illustrations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ import RealtimeReport from '@assets/images/simple-illustrations/simple-illustrat
import ReceiptLocationMarker from '@assets/images/simple-illustrations/simple-illustration__receipt-location-marker.svg';
import ReceiptPartners from '@assets/images/simple-illustrations/simple-illustration__receipt.svg';
import ReceiptUpload from '@assets/images/simple-illustrations/simple-illustration__receiptupload.svg';
import Rules from '@assets/images/simple-illustrations/simple-illustration__rules.svg';
import SendMoney from '@assets/images/simple-illustrations/simple-illustration__sendmoney.svg';
import ShieldYellow from '@assets/images/simple-illustrations/simple-illustration__shield.svg';
import SplitBill from '@assets/images/simple-illustrations/simple-illustration__splitbill.svg';
Expand Down Expand Up @@ -230,4 +231,5 @@ export {
BlueShield,
OpenSafe,
LaptopOnDeskWithCoffeeAndKey,
Rules,
};
8 changes: 8 additions & 0 deletions src/components/Icon/chunks/illustrations.chunk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import ExpensifyCardIllustration from '@assets/images/expensifyCard/cardIllustra
import LaptopWithSecondScreenSync from '@assets/images/laptop-with-second-screen-sync.svg';
import LaptopWithSecondScreenX from '@assets/images/laptop-with-second-screen-x.svg';
// Product Illustrations
import ModalHoldOrReject from '@assets/images/product-illustrations/modal-hold-or-reject.svg';
import TeleScope from '@assets/images/product-illustrations/telescope.svg';
import ToddBehindCloud from '@assets/images/product-illustrations/todd-behind-cloud.svg';
// Simple Illustrations - Core ones that are actually used
Expand All @@ -28,10 +29,13 @@ import MoneyReceipts from '@assets/images/simple-illustrations/simple-illustrati
import MoneyWings from '@assets/images/simple-illustrations/simple-illustration__moneywings.svg';
import Pencil from '@assets/images/simple-illustrations/simple-illustration__pencil.svg';
import PerDiem from '@assets/images/simple-illustrations/simple-illustration__perdiem.svg';
import RealtimeReport from '@assets/images/simple-illustrations/simple-illustration__realtimereports.svg';
import ReceiptWrangler from '@assets/images/simple-illustrations/simple-illustration__receipt-wrangler.svg';
import ReportReceipt from '@assets/images/simple-illustrations/simple-illustration__report-receipt.svg';
import Rules from '@assets/images/simple-illustrations/simple-illustration__rules.svg';
import Stopwatch from '@assets/images/simple-illustrations/simple-illustration__stopwatch.svg';
import Tag from '@assets/images/simple-illustrations/simple-illustration__tag.svg';
import ThumbsDown from '@assets/images/simple-illustrations/simple-illustration__thumbsdown.svg';
import CompanyCard from '@assets/images/simple-illustrations/simple-illustration__twocards-horizontal.svg';
import Workflows from '@assets/images/simple-illustrations/simple-illustration__workflows.svg';

Expand All @@ -50,6 +54,7 @@ const Illustrations = {
ExpensifyCardIllustration,

// Product Illustrations
ModalHoldOrReject,
TeleScope,
Telescope: TeleScope, // Alias for consistency
ToddBehindCloud,
Expand All @@ -66,11 +71,14 @@ const Illustrations = {
MoneyReceipts,
MoneyWings,
PerDiem,
RealtimeReport,
ReceiptWrangler,
ReportReceipt,
Rules,
Stopwatch,
Tag,
CompanyCard,
ThumbsDown,
Workflows,
CarIce,
BlueShield,
Expand Down
1 change: 1 addition & 0 deletions src/languages/de.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1492,6 +1492,7 @@ const translations: TranslationDeepObject<typeof en> = {
educationalTitle: 'Solltest du halten oder ablehnen?',
educationalText: 'Wenn du noch nicht bereit bist, eine Ausgabe zu genehmigen oder zu bezahlen, kannst du sie halten oder ablehnen.',
holdExpenseTitle: 'Halte eine Ausgabe zurück, um vor der Genehmigung oder Zahlung weitere Details anzufordern.',
approveExpenseTitle: 'Genehmige eine Ausgabe, um sie vor der Zahlung weitere Details anzufordern.',
heldExpenseLeftBehindTitle: 'Zurückgehaltene Ausgaben bleiben zurück, wenn du einen gesamten Bericht genehmigst.',
rejectExpenseTitle: 'Lehne eine Ausgabe ab, die du nicht genehmigen oder bezahlen möchtest.',
reasonPageTitle: 'Ausgabe ablehnen',
Expand Down
1 change: 1 addition & 0 deletions src/languages/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1469,6 +1469,7 @@ const translations = {
educationalTitle: 'Should you hold or reject?',
educationalText: "If you're not ready to approve or pay an expense, you can hold or reject it.",
holdExpenseTitle: 'Hold an expense to ask for more details before approval or payment.',
approveExpenseTitle: 'Approve other expenses while held expenses stay assigned to you.',
heldExpenseLeftBehindTitle: 'Held expenses are left behind when you approve an entire report.',
rejectExpenseTitle: "Reject an expense that you don't intend to approve or pay.",
reasonPageTitle: 'Reject expense',
Expand Down
1 change: 1 addition & 0 deletions src/languages/es.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1132,6 +1132,7 @@ const translations: TranslationDeepObject<typeof en> = {
educationalTitle: '¿Debes retener o rechazar?',
educationalText: 'Si no estás listo para aprobar o pagar un gasto, puedes retenerlo o rechazarlo.',
holdExpenseTitle: 'Retén un gasto para pedir más detalles antes de aprobarlo o pagarlo.',
approveExpenseTitle: 'Aprueba otros gastos mientras los gastos retenidos permanecen asignados a ti.',
heldExpenseLeftBehindTitle: 'Los gastos retenidos se dejan atrás cuando apruebas un informe completo.',
rejectExpenseTitle: 'Rechaza un gasto que no tengos intención de aprobar o pagar.',
reasonPageTitle: 'Rechazar gasto',
Expand Down
1 change: 1 addition & 0 deletions src/languages/fr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1494,6 +1494,7 @@ const translations: TranslationDeepObject<typeof en> = {
educationalTitle: 'Faut-il mettre en attente ou rejeter ?',
educationalText: "Si vous n'êtes pas prêt à approuver ou à payer une dépense, vous pouvez la mettre en attente ou la rejeter.",
holdExpenseTitle: 'Mettez une dépense en attente pour demander plus de détails avant de l’approuver ou de la payer.',
approveExpenseTitle: 'Approuvez d’autres dépenses tout en gardant les dépenses mises en attente assignées à vous.',
heldExpenseLeftBehindTitle: 'Les dépenses mises en attente sont laissées de côté lorsque vous approuvez un rapport complet.',
rejectExpenseTitle: 'Rejetez une dépense que vous n’avez pas l’intention d’approuver ou de payer.',
reasonPageTitle: 'Rejeter la dépense',
Expand Down
1 change: 1 addition & 0 deletions src/languages/it.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1488,6 +1488,7 @@ const translations: TranslationDeepObject<typeof en> = {
educationalTitle: 'Devi trattenere o rifiutare?',
educationalText: 'Se non sei pronto ad approvare o pagare una spesa, puoi trattenerla o rifiutarla.',
holdExpenseTitle: 'Trattieni una spesa per chiedere maggiori dettagli prima dell’approvazione o del pagamento.',
approveExpenseTitle: 'Approva altre spese mentre quelle trattenute rimangono assegnate a te.',
heldExpenseLeftBehindTitle: 'Le spese trattenute vengono lasciate indietro quando approvi un intero report.',
rejectExpenseTitle: 'Rifiuta una spesa che non intendi approvare o pagare.',
reasonPageTitle: 'Rifiuta spesa',
Expand Down
1 change: 1 addition & 0 deletions src/languages/ja.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1488,6 +1488,7 @@ const translations: TranslationDeepObject<typeof en> = {
educationalTitle: '保留しますか、それとも却下しますか?',
educationalText: '経費を承認または支払う準備ができていない場合は、保留または却下できます。',
holdExpenseTitle: '承認または支払いの前に詳細を確認するため、経費を保留にします。',
approveExpenseTitle: '保留中の経費はあなたに割り当てられたまま、他の経費を承認できます。',
heldExpenseLeftBehindTitle: 'レポート全体を承認すると、保留中の経費は除外されます。',
rejectExpenseTitle: '承認または支払うつもりのない経費を却下します。',
reasonPageTitle: '経費を却下',
Expand Down
1 change: 1 addition & 0 deletions src/languages/nl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1488,6 +1488,7 @@ const translations: TranslationDeepObject<typeof en> = {
educationalTitle: 'Moet je vasthouden of afwijzen?',
educationalText: 'Als je nog niet klaar bent om een uitgave goed te keuren of te betalen, kun je deze vasthouden of afwijzen.',
holdExpenseTitle: 'Houd een uitgave vast om meer details te vragen voordat je deze goedkeurt of betaalt.',
approveExpenseTitle: 'Goedkeur andere uitgaven terwijl vastgehouden uitgaven aan jou blijven toegewezen.',
heldExpenseLeftBehindTitle: 'Vasthouden uitgaven blijven achter wanneer je een volledig rapport goedkeurt.',
rejectExpenseTitle: 'Wijs een uitgave af die je niet van plan bent goed te keuren of te betalen.',
reasonPageTitle: 'Uitgave afwijzen',
Expand Down
1 change: 1 addition & 0 deletions src/languages/pl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1486,6 +1486,7 @@ const translations: TranslationDeepObject<typeof en> = {
educationalTitle: 'Czy powinieneś wstrzymać czy odrzucić?',
educationalText: 'Jeśli nie jesteś gotów zatwierdzić lub opłacić wydatku, możesz go wstrzymać lub odrzucić.',
holdExpenseTitle: 'Wstrzymaj wydatek, aby poprosić o więcej szczegółów przed zatwierdzeniem lub opłaceniem.',
approveExpenseTitle: 'Zatwierdź inne wydatki, podczas gdy wydatki wstrzymane pozostają przypisane do Ciebie.',
heldExpenseLeftBehindTitle: 'Wydatki wstrzymane są pomijane, gdy zatwierdzasz cały raport.',
rejectExpenseTitle: 'Odrzuć wydatek, którego nie zamierzasz zatwierdzić ani opłacić.',
reasonPageTitle: 'Odrzuć wydatek',
Expand Down
1 change: 1 addition & 0 deletions src/languages/pt-BR.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1484,6 +1484,7 @@ const translations: TranslationDeepObject<typeof en> = {
educationalTitle: 'Você deve reter ou rejeitar?',
educationalText: 'Se você não estiver pronto para aprovar ou pagar uma despesa, pode retê-la ou rejeitá-la.',
holdExpenseTitle: 'Retenha uma despesa para pedir mais detalhes antes da aprovação ou do pagamento.',
approveExpenseTitle: 'Aprove outras despesas enquanto as despesas retidas permanecem atribuídas a você.',
heldExpenseLeftBehindTitle: 'As despesas retidas ficam de fora quando você aprova um relatório inteiro.',
rejectExpenseTitle: 'Rejeite uma despesa que você não pretende aprovar ou pagar.',
reasonPageTitle: 'Rejeitar despesa',
Expand Down
1 change: 1 addition & 0 deletions src/languages/zh-hans.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1465,6 +1465,7 @@ const translations: TranslationDeepObject<typeof en> = {
educationalTitle: '应该保留还是拒绝?',
educationalText: '如果你还没准备好批准或支付一笔报销,可以选择保留或拒绝。',
holdExpenseTitle: '保留报销,以便在批准或支付之前要求更多细节。',
approveExpenseTitle: '在保留的报销保持分配给你的同时,批准其他报销。',
heldExpenseLeftBehindTitle: '当你批准整个报销单时,已保留的报销会被忽略。',
rejectExpenseTitle: '拒绝你不打算批准或支付的报销。',
reasonPageTitle: '拒绝报销',
Expand Down
Loading