-
Notifications
You must be signed in to change notification settings - Fork 106
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(Bonus Pagamenti Digitali): [#174863094] No payment methods avail…
…able screen (#2262) * add screens * add comments * Add navigation stack * add screen events layout * wip * wip * wip * rework ibaninsertion * clean code * file mssing * cleaning * reorder store * clean code * add comments * comments * add locales and validation iban * revert wallet * fix * [#174847335] add IbanKOWrong * create common body * . * cannot verify string * iban not owned * refactoring * fix basetypography test * Update ts/features/bonus/bpd/saga/orchestration/onboarding/enrollToBpd.ts Co-authored-by: Matteo Boschi <[email protected]> * Update ts/features/bonus/bpd/screens/iban/IbanLoadingUpsert.tsx Co-authored-by: Matteo Boschi <[email protected]> * [#174863094] Update NoPaymentMethodsAvailableScreen * update locales * update iban loading caption * wrong caption * Update locales/it/index.yml * Update ts/features/bonus/bpd/screens/iban/insertion/IbanInsertionComponent.tsx Co-authored-by: Matteo Boschi <[email protected]> * Update ts/features/bonus/bpd/screens/iban/insertion/IbanInsertionComponent.tsx Co-authored-by: Matteo Boschi <[email protected]> Co-authored-by: Matteo Boschi <[email protected]>
- Loading branch information
1 parent
a180b73
commit 6fda0ec
Showing
6 changed files
with
71 additions
and
16 deletions.
There are no files selected for viewing
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
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
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
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
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
65 changes: 56 additions & 9 deletions
65
ts/features/bonus/bpd/screens/onboarding/NoPaymentMethodsAvailableScreen.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 |
---|---|---|
@@ -1,10 +1,57 @@ | ||
import { View } from "native-base"; | ||
import * as React from "react"; | ||
import { View } from "react-native"; | ||
|
||
/** | ||
* This screen warns the user that he does not have any payment method already present on which it is | ||
* possible to activate the bpd and invites him to add a new one. | ||
*/ | ||
export const NoPaymentMethodsAvailableScreen: React.FunctionComponent = () => ( | ||
<View /> | ||
); | ||
import { SafeAreaView } from "react-native"; | ||
import { connect } from "react-redux"; | ||
import { Dispatch } from "redux"; | ||
import { Body } from "../../../../../components/core/typography/Body"; | ||
import { H1 } from "../../../../../components/core/typography/H1"; | ||
import { IOStyles } from "../../../../../components/core/variables/IOStyles"; | ||
import BaseScreenComponent from "../../../../../components/screens/BaseScreenComponent"; | ||
import I18n from "../../../../../i18n"; | ||
import { navigateToWalletHome } from "../../../../../store/actions/navigation"; | ||
import { GlobalState } from "../../../../../store/reducers/types"; | ||
import { FooterTwoButtons } from "../../../bonusVacanze/components/markdown/FooterTwoButtons"; | ||
|
||
export type Props = ReturnType<typeof mapDispatchToProps> & | ||
ReturnType<typeof mapStateToProps>; | ||
|
||
const loadLocales = () => ({ | ||
headerTitle: I18n.t("bonus.bpd.title"), | ||
skip: I18n.t("global.buttons.skip"), | ||
addMethod: I18n.t("wallet.newPaymentMethod.addButton"), | ||
title: I18n.t("bonus.bpd.onboarding.noPaymentMethod.title"), | ||
body: I18n.t("bonus.bpd.onboarding.noPaymentMethod.body") | ||
}); | ||
|
||
const NoPaymentMethodsAvailableScreen: React.FunctionComponent<Props> = props => { | ||
const { headerTitle, skip, addMethod, title, body } = loadLocales(); | ||
return ( | ||
<BaseScreenComponent goBack={false} headerTitle={headerTitle}> | ||
<SafeAreaView style={IOStyles.flex}> | ||
<View style={[IOStyles.horizontalContentPadding, IOStyles.flex]}> | ||
<View spacer={true} large={true} /> | ||
<H1>{title}</H1> | ||
<View spacer={true} large={true} /> | ||
<Body>{body}</Body> | ||
</View> | ||
<FooterTwoButtons | ||
onRight={props.skip} | ||
onCancel={props.skip} | ||
rightText={addMethod} | ||
leftText={skip} | ||
/> | ||
</SafeAreaView> | ||
</BaseScreenComponent> | ||
); | ||
}; | ||
|
||
const mapDispatchToProps = (dispatch: Dispatch) => ({ | ||
skip: () => dispatch(navigateToWalletHome()) | ||
}); | ||
|
||
const mapStateToProps = (_: GlobalState) => ({}); | ||
|
||
export default connect( | ||
mapStateToProps, | ||
mapDispatchToProps | ||
)(NoPaymentMethodsAvailableScreen); |