Skip to content

Commit

Permalink
Fix/payment success and failed modal revision (#633)
Browse files Browse the repository at this point in the history
  • Loading branch information
chavda-bhavik authored Jul 3, 2024
2 parents 6d8eb09 + 6bc46d4 commit 19a6c62
Show file tree
Hide file tree
Showing 10 changed files with 6,116 additions and 19 deletions.
31 changes: 31 additions & 0 deletions apps/web/components/ConfirmationModal/ConfirmationModal.tsx
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>
);
};
Loading

0 comments on commit 19a6c62

Please sign in to comment.