Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
ff1977f
introduce Button primitives
Guccio163 Oct 5, 2026
40b1a61
add ConfirmationPageContent
Guccio163 Oct 5, 2026
1a7e459
add ConfirmationPageIllustration
Guccio163 Oct 5, 2026
838d9c1
add ConfirmationPageHeading and Description
Guccio163 Oct 5, 2026
46e7016
add ConfirmationPageDefault
Guccio163 Oct 5, 2026
f23d484
migrate ConfirmationPageDefault
Guccio163 Oct 5, 2026
6850aaa
migrate the rest of the callsites
Guccio163 Oct 5, 2026
5dba2d3
fix after review
Guccio163 Oct 5, 2026
81de054
fix CONSISTENCY violations in ConfirmationPage primitives
Guccio163 Oct 5, 2026
6d05530
extract MergeResultPage config into useMergeResultConfirmationConfig …
Guccio163 Oct 6, 2026
481c7b5
remove unused ConfirmationPageProps export to fix knip
Guccio163 Oct 8, 2026
cbbc8fe
Merge remote-tracking branch 'origin/main' into Guccio163/confirmatio…
Guccio163 Oct 8, 2026
fa604cd
migrate CollectDepositAccount Success to ConfirmationPageDefault
Guccio163 Oct 8, 2026
cc5d2c7
fix CLEAN-REACT-PATTERNS-7 and CONSISTENCY-13 review findings
Guccio163 Oct 8, 2026
c0046d3
Merge branch 'main' of github.com:software-mansion-labs/expensify-app…
Guccio163 Oct 10, 2026
d986569
implement comments
Guccio163 Oct 10, 2026
aff57d2
remove redundant h100 from ConfirmationPage callsites
Guccio163 Oct 10, 2026
0895f6c
Merge branch 'main' of github.com:software-mansion-labs/expensify-app…
Guccio163 Oct 19, 2026
a9cd852
adjust to main changes
Guccio163 Oct 19, 2026
adffa1d
change styles order in ConfirmationPageDescription
Guccio163 Oct 19, 2026
495826e
remove redundant flexGrow1
Guccio163 Oct 19, 2026
9bf5875
remove redundant props from useMergeResultConfirmationConfig result
Guccio163 Oct 19, 2026
4fa5ad3
default button text and onPress to the most popular/always used options
Guccio163 Oct 19, 2026
001015f
deduplicate useMergeResultConfirmationConfig configurations
Guccio163 Oct 19, 2026
f08a295
remove cta in favor of ctaComponent
Guccio163 Oct 19, 2026
bdf3c10
remove description in favor of descriptionComponent
Guccio163 Oct 19, 2026
06871f0
Migrate ConfirmationPageTest to ConfirmationPage.Illustration
Guccio163 Oct 19, 2026
ed0742a
Merge branch 'main' of github.com:software-mansion-labs/expensify-app…
Guccio163 Oct 20, 2026
aba0d87
fix ts check
Guccio163 Oct 20, 2026
1d8ba8c
Merge branch 'main' of github.com:software-mansion-labs/expensify-app…
Guccio163 Oct 21, 2026
dee89c5
Revert unintended .github/actions/javascript changes
Guccio163 Oct 21, 2026
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
209 changes: 0 additions & 209 deletions src/components/ConfirmationPage.tsx

This file was deleted.

18 changes: 18 additions & 0 deletions src/components/ConfirmationPage/ConfirmationPage.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import useThemeStyles from '@hooks/useThemeStyles';

import type {StyleProp, ViewStyle} from 'react-native';

import {View} from 'react-native';

type ConfirmationPageProps = {
children: React.ReactNode;
style?: StyleProp<ViewStyle>;
};

function ConfirmationPage({children, style}: ConfirmationPageProps) {
const styles = useThemeStyles();

return <View style={[styles.flex1, style]}>{children}</View>;
}

export default ConfirmationPage;
101 changes: 101 additions & 0 deletions src/components/ConfirmationPage/composed/ConfirmationPageDefault.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
import ConfirmationPage from '@components/ConfirmationPage/ConfirmationPage';
import ConfirmationPageContent from '@components/ConfirmationPage/layout/ConfirmationPageContent';
import ConfirmationPageDescription from '@components/ConfirmationPage/primitives/ConfirmationPageDescription';
import ConfirmationPageHeading from '@components/ConfirmationPage/primitives/ConfirmationPageHeading';
import ConfirmationPageIllustration from '@components/ConfirmationPage/primitives/ConfirmationPageIllustration';
import ConfirmationPagePrimaryButton from '@components/ConfirmationPage/primitives/ConfirmationPagePrimaryButton';
import FixedFooter from '@components/FixedFooter';
import LottieAnimations from '@components/LottieAnimations';
import type DotLottieAnimation from '@components/LottieAnimations/types';

import type {Errors} from '@src/types/onyx/OnyxCommon';
import type IconAsset from '@src/types/utils/IconAsset';

import type {StyleProp, TextStyle, ViewStyle} from 'react-native';

type ConfirmationPageProps = {
/** Illustration shown at the top: a Lottie animation or a static icon. Defaults to the fireworks animation */
illustration?: DotLottieAnimation | IconAsset;
Comment thread
Guccio163 marked this conversation as resolved.
Resolved

/** Heading text displayed below the illustration */
heading: string;

/** Description text displayed below the heading */
description: string;

/** The text for the button label */
buttonText?: string;

/** A function that is called when the button is clicked on */
onButtonPress?: () => void;

/** Whether the button should be disabled */
isButtonDisabled?: boolean;

/** Whether the button should show a loading spinner */
isButtonLoading?: boolean;

/** Errors rendered as a message inside the footer, above the button */
requestErrors?: Errors | null;

/** Additional style for the outermost container */
containerStyle?: StyleProp<ViewStyle>;

/** Additional style for the centered container wrapping the illustration, heading and description */
innerContainerStyle?: StyleProp<ViewStyle>;

/** Additional style for the illustration */
illustrationStyle?: StyleProp<ViewStyle>;

/** Additional style for the heading text */
headingStyle?: StyleProp<TextStyle>;

/** Additional style for the description text */
descriptionStyle?: StyleProp<TextStyle>;

/** Additional style for the footer containing the button */
footerStyle?: StyleProp<ViewStyle>;
};

function ConfirmationPageDefault({
illustration = LottieAnimations.Fireworks,
heading,
description,
buttonText = '',
onButtonPress = () => {},
isButtonDisabled = false,
isButtonLoading = false,
headingStyle,
illustrationStyle,
descriptionStyle,
footerStyle,
requestErrors,
containerStyle,
innerContainerStyle,
}: ConfirmationPageProps) {
return (
<ConfirmationPage style={containerStyle}>
<ConfirmationPageContent
style={innerContainerStyle}
requestErrors={requestErrors}
>
<ConfirmationPageIllustration
illustration={illustration}
illustrationStyle={illustrationStyle}
/>
<ConfirmationPageHeading style={headingStyle}>{heading}</ConfirmationPageHeading>
<ConfirmationPageDescription style={descriptionStyle}>{description}</ConfirmationPageDescription>
</ConfirmationPageContent>
<FixedFooter style={footerStyle}>
<ConfirmationPagePrimaryButton
text={buttonText}
isDisabled={isButtonDisabled}
isLoading={isButtonLoading}
onPress={onButtonPress}
/>
</FixedFooter>
</ConfirmationPage>
);
}

export default ConfirmationPageDefault;
48 changes: 48 additions & 0 deletions src/components/ConfirmationPage/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
/**
* ConfirmationPage: a confirmation/illustration screen built with composition API.
*
* Instead of a large flat props list (illustration, heading, description, shouldShowButton, …),
* sub-components are composed as children:
*
* @example
* ```tsx
* import ConfirmationPage from '@components/ConfirmationPage';
*
* <ConfirmationPage>
* <ConfirmationPage.Content>
* <ConfirmationPage.Illustration illustration={LottieAnimations.Fireworks} />
* <ConfirmationPage.Heading>All set!</ConfirmationPage.Heading>
* <ConfirmationPage.Description>Your changes have been saved.</ConfirmationPage.Description>
* </ConfirmationPage.Content>
* <FixedFooter>
* <ConfirmationPage.PrimaryButton text="Got it" onPress={handleConfirm} />
* </FixedFooter>
* </ConfirmationPage>
* ```
*
* For the common illustration/heading/description/button shape without custom composition, use `ConfirmationPageDefault` instead.
*/
import React from 'react';

import ConfirmationPageComponent from './ConfirmationPage';
import ConfirmationPageContent from './layout/ConfirmationPageContent';
import ConfirmationPageDescription from './primitives/ConfirmationPageDescription';
import ConfirmationPageHeading from './primitives/ConfirmationPageHeading';
import ConfirmationPageIllustration from './primitives/ConfirmationPageIllustration';
import ConfirmationPagePrimaryButton from './primitives/ConfirmationPagePrimaryButton';
import ConfirmationPageSecondaryButton from './primitives/ConfirmationPageSecondaryButton';

function ConfirmationPageBase(props: React.ComponentProps<typeof ConfirmationPageComponent>) {
return <ConfirmationPageComponent {...props} />;
}

const ConfirmationPage = Object.assign(ConfirmationPageBase, {
Illustration: ConfirmationPageIllustration,
Heading: ConfirmationPageHeading,
Description: ConfirmationPageDescription,
PrimaryButton: ConfirmationPagePrimaryButton,
SecondaryButton: ConfirmationPageSecondaryButton,
Content: ConfirmationPageContent,
});

export default ConfirmationPage;
Loading
Loading