-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix/payment success and failed modal revision (#633)
- Loading branch information
Showing
10 changed files
with
6,116 additions
and
19 deletions.
There are no files selected for viewing
31 changes: 31 additions & 0 deletions
31
apps/web/components/ConfirmationModal/ConfirmationModal.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import React from 'react'; | ||
import Lottie from 'lottie-react'; | ||
import { modals } from '@mantine/modals'; | ||
import { CONSTANTS, colors } from '@config'; | ||
import { Button, Stack, Text } from '@mantine/core'; | ||
|
||
import FailedAnimationData from './failed-animation-data.json'; | ||
import SuccessAnimationData from './success-animation-data.json'; | ||
|
||
interface ConfirmationModalProps { | ||
status: string; | ||
} | ||
|
||
export const ConfirmationModal = ({ status }: ConfirmationModalProps) => { | ||
return ( | ||
<Stack spacing="md"> | ||
<Lottie | ||
animationData={status === CONSTANTS.PAYMENT_SUCCCESS_CODE ? SuccessAnimationData : FailedAnimationData} | ||
loop={true} | ||
/> | ||
<Text align="center"> | ||
{status === CONSTANTS.PAYMENT_SUCCCESS_CODE | ||
? CONSTANTS.PAYMENT_SUCCESS_MESSAGE | ||
: CONSTANTS.PAYMENT_FAILED_MESSAGE} | ||
</Text> | ||
<Button fullWidth color={colors.danger} onClick={() => modals.closeAll()}> | ||
Ok | ||
</Button> | ||
</Stack> | ||
); | ||
}; |
Oops, something went wrong.