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
27 changes: 14 additions & 13 deletions frontend/src/pages/success/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { FiatToken } from 'shared';
import { useRampSubmission } from '../../hooks/ramp/useRampSubmission';
import { useRampExecutionInput } from '../../stores/rampStore';
import { useRampFormStore } from '../../stores/ramp/useRampFormStore';
import { useRampDirection } from '../../stores/rampDirectionStore';

const Checkmark = () => (
<div className="flex items-center justify-center w-20 h-20 border-2 border-blue-700 rounded-full">
Expand All @@ -20,34 +21,34 @@ export const SuccessPage = () => {
const { finishOfframping } = useRampSubmission();
const executionInput = useRampExecutionInput();
const { fiatToken } = useRampFormStore();
const rampDirection = useRampDirection();
const isOnramp = rampDirection === 'onramp';

const transactionId = executionInput?.quote?.id;

const ARRIVAL_TEXT_BY_TOKEN: Record<FiatToken, string> = {
[FiatToken.EURC]: t('pages.success.arrivalText.EURC'),
[FiatToken.ARS]: t('pages.success.arrivalText.ARS'),
[FiatToken.BRL]: t('pages.success.arrivalText.BRL'),
[FiatToken.EURC]: t('pages.success.arrivalText.sell.EURC'),
[FiatToken.ARS]: t('pages.success.arrivalText.sell.ARS'),
[FiatToken.BRL]: t('pages.success.arrivalText.sell.BRL'),
};

const arrivalText = ARRIVAL_TEXT_BY_TOKEN[fiatToken] || t('pages.success.arrivalText.default');
const arrivalTextBuy = t('pages.success.arrivalText.buy');
const arrivalTextSell = ARRIVAL_TEXT_BY_TOKEN[fiatToken] || t('pages.success.arrivalText.sell.default');

return (
<main>
{/* Removed items-center from Box for overall container */}
<Box className="flex flex-col justify-center mx-auto mt-12 ">
{/* Centering container for Checkmark */}
<div className="flex justify-center w-full">
<Checkmark />
</div>
{/* Wrapper div for left-aligned content with padding */}
<div className="w-full mt-6 px-4 md:px-8">
{' '}
{/* Added padding to match EmailForm */}
<h1 className="mb-6 text-2xl font-bold text-left text-blue-700">{t('pages.success.title')}</h1>{' '}
{/* Changed text-center to text-left */}
{/* Removed pink divider */}
<p className="text-left font-light text-blue-700 leading-relaxed mb-8">{arrivalText}</p>{' '}
{/* Changed text-center to text-left, updated color/style */}
<h1 className="mb-6 text-2xl font-bold text-left text-blue-700">
{t(`pages.success.title.${isOnramp ? 'buy' : 'sell'}`)}
</h1>{' '}
<p className="text-left font-light text-blue-700 leading-relaxed mb-8">
{isOnramp ? arrivalTextBuy : arrivalTextSell}
</p>{' '}
<div className="h-0.5 m-auto w-1/5 bg-pink-500 mt-8 mb-5" />
<EmailForm transactionId={transactionId} transactionSuccess={true} />
</div>
Expand Down
16 changes: 11 additions & 5 deletions frontend/src/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,19 @@
"brlaTeleport": "Transferring newly minted assets to Moonbeam"
},
"success": {
"title": "All set! The withdrawal has been sent to your bank.",
"title": {
"buy": "All set! Your tokens are on their way.",
"sell": "All set! The withdrawal has been sent to your bank."
},
"returnHome": "Return Home",
"arrivalText": {
"EURC": "Funds will be received in 1 min (Instant SEPA) or 2 days (Standard SEPA). SEPA type dependent on the recipient bank support.",
"ARS": "Your funds will arrive in your bank account in a few minutes.",
"BRL": "Your funds were sent via PIX and are now in your bank account.",
"default": "Your funds will arrive in your bank account soon."
"buy": "The tokens will arrive in your wallet in a few minutes.",
"sell": {
"EURC": "Funds will be received in 1 min (Instant SEPA) or 2 days (Standard SEPA). SEPA type dependent on the recipient bank support.",
"ARS": "Your funds will arrive in your bank account in a few minutes.",
"BRL": "Your funds were sent via PIX and are now in your bank account.",
"default": "Your funds will arrive in your bank account soon."
}
}
},
"swap": {
Expand Down
16 changes: 11 additions & 5 deletions frontend/src/translations/pt.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,19 @@
"brlaTeleport": "Transferindo ativos recém-criados para Moonbeam"
},
"success": {
"title": "Tudo certo! Enviamos o saque para sua conta bancária.",
"title": {
"buy": "Tudo certo! Seus tokens estão a caminho.",
"sell": "Tudo certo! Enviamos o saque para sua conta bancária."
},
"returnHome": "Voltar para a página inicial.",
"arrivalText": {
"EURC": "Você receberá os fundos em até 1 minuto (SEPA Instantâneo) ou em até 2 dias (SEPA Padrão), dependendo do seu banco.",
"ARS": "Em breve os fundos estarão disponíveis em sua conta bancária.",
"BRL": "Em breve os fundos estarão disponíveis em sua conta bancária..",
"default": "Em breve os fundos estarão disponíveis em sua conta bancária."
"buy": "Os tokens chegarão à sua carteira em alguns minutos.",
"sell": {
"EURC": "Você receberá os fundos em até 1 minuto (SEPA Instantâneo) ou em até 2 dias (SEPA Padrão), dependendo do seu banco.",
"ARS": "Em breve os fundos estarão disponíveis em sua conta bancária.",
"BRL": "Em breve os fundos estarão disponíveis em sua conta bancária..",
"default": "Em breve os fundos estarão disponíveis em sua conta bancária."
}
}
},
"swap": {
Expand Down
Loading