Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update the 'Thank you' modal after donation #283

Merged
merged 1 commit into from
Feb 4, 2025
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
1 change: 1 addition & 0 deletions packages/app/src/components/DonateComponent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -498,6 +498,7 @@ const DonateComponent = ({ collective }: DonateComponentProps) => {
: undefined,
]}
confirmButtonText="GO TO PROFILE"
message="Please be patient! It may take some time for your donation to appear in your profile."
image={ThankYouImg}
/>
<BaseModal
Expand Down
20 changes: 17 additions & 3 deletions packages/app/src/components/modals/BaseModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ const defaultModalProps = {
dParagraphs: (errorMessage: string) => ['Please try again later.', 'Reason: ' + (errorMessage ?? 'unknown')],
dConfirmButtonText: 'OK',
dImage: ThankYouImg,
dMessage: 'Something went wrong',
},
};

Expand All @@ -49,6 +50,7 @@ type BaseModalProps = {
image?: any;
errorMessage?: string;
withClose?: boolean;
message?: string;
};

export const BaseModal = ({
Expand All @@ -62,12 +64,19 @@ export const BaseModal = ({
image,
errorMessage = '',
withClose = true,
message,
}: BaseModalProps) => {
const _onClose = () => onClose();
const { dTitle, dParagraphs, dConfirmButtonText, dImage } =
const { dTitle, dParagraphs, dConfirmButtonText, dImage, dMessage } =
type === 'error'
? defaultModalProps[type as keyof typeof defaultModalProps]
: { dTitle: title, dParagraphs: paragraphs, dConfirmButtonText: confirmButtonText, dImage: image };
: {
dTitle: title,
dParagraphs: paragraphs,
dConfirmButtonText: confirmButtonText,
dImage: image,
dMessage: message,
};

const paragraph =
type === 'error' && typeof dParagraphs === 'function'
Expand Down Expand Up @@ -116,7 +125,12 @@ export const BaseModal = ({
)
: null}
</VStack>
<Image source={dImage} alt="woman" width={'100%'} height={224} margin="auto" resizeMode="contain" />
<Image source={dImage} alt="woman" width={'100%'} height={210} margin="auto" resizeMode="contain" />
{dMessage && (
<Text variant="bold" fontSize="sm" textAlign="center">
{message}
</Text>
)}
{dConfirmButtonText ? (
<ActionButton
text={dConfirmButtonText}
Expand Down
Loading