Skip to content

Commit

Permalink
fix(IT Wallet): [SIW-689] Add bottom padding in continue view (#5233)
Browse files Browse the repository at this point in the history
## Short description
This PR adds a missing bottom padding in the `ItwContinueView`. It also
renames it to make it coherent with similar components naming scheme.

## List of changes proposed in this pull request
- Adds padding from the footer already used in the app to make it
coherent with other bottom buttons;
- Rename the component as `ItwContinueView`; 
- Updates imports.

## How to test
Test a presentation flow and check if the bottom padding is rendered
correctly, especially on Android since the navigation bottom bar is not
translucent.
  • Loading branch information
LazyAfternoons committed Nov 17, 2023
1 parent 1e2b1bb commit 8fcd027
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,31 +17,33 @@ type ActionProps = {
onPress: () => void;
};

type ItwContinueComponentProps = {
type ItwContinueViewProps = {
title: string;
pictogram?: IOPictograms;
subtitle?: string;
action?: ActionProps;
secondaryAction?: ActionProps;
closeAction?: ActionProps["onPress"];
};

/**
* The base graphical component to show a pictogram, title, a subtitle, an action button and a secondary action button.
* This works as a "continue" screen.
* This component must be used to show a result screen to keep the same style across the flow.
* @param title the title to be rendered
* @param subtitle the subtitlte to be rendered below the title (optional)
* @param action the continue button to be rendered (optional)
* @param secondaryAction the secondary cancel button to be rendered (optional)
*/
const ItwContinueScreen = ({
const ItwContinueView = ({
title,
pictogram,
subtitle,
action,
secondaryAction
}: ItwContinueComponentProps): React.ReactElement => (
}: ItwContinueViewProps): React.ReactElement => (
<View style={{ ...IOStyles.flex, ...IOStyles.horizontalContentPadding }}>
<View style={styles.main} testID={"ItwContinueScreenTestID"}>
<View style={styles.main} testID={"ItwContinueViewTestID"}>
{pictogram && (
<>
<Pictogram name={pictogram} size={180} />
Expand Down Expand Up @@ -87,7 +89,8 @@ const styles = StyleSheet.create({
},
footer: {
justifyContent: "center",
flexDirection: "column"
flexDirection: "column",
paddingBottom: IOStyles.footer.paddingBottom
},
secondaryAction: {
alignSelf: "center"
Expand All @@ -97,4 +100,4 @@ const styles = StyleSheet.create({
}
});

export default ItwContinueScreen;
export default ItwContinueView;
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import {
itwIssuanceChecksSelector,
IssuanceData
} from "../../../store/reducers/new/itwIssuanceReducer";
import ItwContinueScreen from "../../../components/ItwResultComponent";
import ItwContinueScreen from "../../../components/ItwContinueView";
import { showCancelAlert } from "../../../utils/alert";
import {
ItWalletError,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import { ITW_ROUTES } from "../../../navigation/ItwRoutes";
import ItwKoView from "../../../components/ItwKoView";
import { getItwGenericMappedError } from "../../../utils/errors/itwErrorsMapping";
import { IOStackNavigationProp } from "../../../../../navigation/params/AppParamsList";
import ItwContinueScreen from "../../../components/ItwResultComponent";
import ItwContinueView from "../../../components/ItwContinueView";

/**
* ItwRpInitScreenNavigationParams's navigation params.
Expand Down Expand Up @@ -54,7 +54,7 @@ const ItwRpInitScreen = () => {

const SuccessView = () => (
<SafeAreaView style={IOStyles.flex}>
<ItwContinueScreen
<ItwContinueView
title={I18n.t("features.itWallet.presentation.checksScreen.success", {
organizationName: rpPidMock.organizationName
})}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { itwPresentationChecksSelector } from "../../../../store/reducers/new/it
import { useIODispatch, useIOSelector } from "../../../../../../store/hooks";
import { useOnFirstRender } from "../../../../../../utils/hooks/useOnFirstRender";
import ItwLoadingSpinnerOverlay from "../../../../components/ItwLoadingSpinnerOverlay";
import ItwContinueScreen from "../../../../components/ItwResultComponent";
import ItwContinueScreen from "../../../../components/ItwContinueView";
import I18n from "../../../../../../i18n";
import {
AppParamsList,
Expand Down

0 comments on commit 8fcd027

Please sign in to comment.