-
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.
chore(Bonus Pagamenti Digitali): [#176039881] upgrade bancomat resear…
…ch screen (#2551) * [#176039881] create SearchBankInfo component * [#176039881] refactor SearchBankComponent * [#176039881] refactor SearchBankScreen component * [#176039881] retry global bancomat search on continue button * [#176039881] remove unused properties * [#176039881] remove useless properties * [#176039881] try a global search on continue press BancomatKoSingleBankNotFound * [#176039881] send the user the the WALLET_ONBOARDING_BANCOMAT_CHOOSE_BANK screen when press select bank * [#176039881] remove re-navigation to same screen * [#176039881] rename SearchBankScreen in SearchBankInfoScreen * [#176039881] refactor SearchBankInfoScreen * [#176039881] renaming * [#176039881] renaming SearchBankInfo in SearchBankInfoComponent * [#176039881] renaming navigation action * [#176039881] refactor navigation to searchBank screen * [#176039881] add navigation action to SearchBankScreen * [#176039881] refactor BancomatKoServicesError component adding navigation to search bank screen * [#176039881] refactor SearchBankScren * [#176039881] clean searchBar text after select item * [#176039881] remove unused import * [#176039881] update comments * [#176039881] fix typo * [#176039881] add missing translation * [#176039881] make the tos url const * [#176039881] refactoring styles * [#176039881] change prop name * [#176039881] rename route * [#176039881] renaming screen * [#176039881] renaming searchStartComponent * [#176039881] remove useless code and properties * [#176039881] modify action name * [#176039881] modify comment * [#176039881] remove unused import * [#176039881] rename route * [#176039881] fix bug Co-authored-by: Matteo Boschi <[email protected]> Co-authored-by: Fabrizio <[email protected]>
- Loading branch information
1 parent
fa829f8
commit 82192ee
Showing
13 changed files
with
261 additions
and
142 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
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
38 changes: 38 additions & 0 deletions
38
ts/features/wallet/onboarding/bancomat/screens/search/BancomatSearchStartComponent.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 |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import { View } from "native-base"; | ||
import * as React from "react"; | ||
import I18n from "../../../../../../i18n"; | ||
import { Body } from "../../../../../../components/core/typography/Body"; | ||
import { H1 } from "../../../../../../components/core/typography/H1"; | ||
import { H4 } from "../../../../../../components/core/typography/H4"; | ||
import { Link } from "../../../../../../components/core/typography/Link"; | ||
|
||
type Props = { | ||
openTosModal: () => void; | ||
onSearch: () => void; | ||
}; | ||
|
||
export const BancomatSearchStartComponent: React.FunctionComponent<Props> = ( | ||
props: Props | ||
) => ( | ||
<> | ||
<H1>{I18n.t("wallet.searchAbi.title")}</H1> | ||
<View spacer={true} large={true} /> | ||
<Body> | ||
<H4 weight={"Regular"} color={"bluegreyDark"}> | ||
{I18n.t("wallet.searchAbi.description.text1")} | ||
</H4> | ||
<Link onPress={props.openTosModal}> | ||
{I18n.t("wallet.searchAbi.description.text2")} | ||
</Link> | ||
</Body> | ||
<View spacer={true} large={true} /> | ||
<Body> | ||
<H4 weight={"Regular"} color={"bluegreyDark"}> | ||
{I18n.t("wallet.searchAbi.description.text3")} | ||
</H4> | ||
<Link onPress={props.onSearch}> | ||
{I18n.t("wallet.searchAbi.description.text4")} | ||
</Link> | ||
</Body> | ||
</> | ||
); |
105 changes: 105 additions & 0 deletions
105
ts/features/wallet/onboarding/bancomat/screens/search/BancomatSearchStartScreen.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 |
---|---|---|
@@ -0,0 +1,105 @@ | ||
import * as React from "react"; | ||
import { connect } from "react-redux"; | ||
import { Dispatch } from "redux"; | ||
import { SafeAreaView } from "react-native"; | ||
import { Content } from "native-base"; | ||
import { withLightModalContext } from "../../../../../../components/helpers/withLightModalContext"; | ||
import BaseScreenComponent from "../../../../../../components/screens/BaseScreenComponent"; | ||
import { LightModalContextInterface } from "../../../../../../components/ui/LightModal"; | ||
import I18n from "../../../../../../i18n"; | ||
import { GlobalState } from "../../../../../../store/reducers/types"; | ||
import TosBonusComponent from "../../../../../bonus/bonusVacanze/components/TosBonusComponent"; | ||
import { isError, isLoading } from "../../../../../bonus/bpd/model/RemoteValue"; | ||
import { abiSelector } from "../../../store/abi"; | ||
import { | ||
navigateToOnboardingBancomatChooseBank, | ||
navigateToOnboardingBancomatSearchAvailableUserBancomat | ||
} from "../../navigation/action"; | ||
import { | ||
loadAbi, | ||
searchUserPans, | ||
walletAddBancomatBack, | ||
walletAddBancomatCancel | ||
} from "../../store/actions"; | ||
import { emptyContextualHelp } from "../../../../../../utils/emptyContextualHelp"; | ||
import FooterWithButtons from "../../../../../../components/ui/FooterWithButtons"; | ||
import { | ||
cancelButtonProps, | ||
confirmButtonProps | ||
} from "../../../../../bonus/bonusVacanze/components/buttons/ButtonConfigurations"; | ||
import { IOStyles } from "../../../../../../components/core/variables/IOStyles"; | ||
import { BancomatSearchStartComponent } from "./BancomatSearchStartComponent"; | ||
|
||
type Props = LightModalContextInterface & | ||
ReturnType<typeof mapStateToProps> & | ||
ReturnType<typeof mapDispatchToProps>; | ||
|
||
const tos_url = "https://io.italia.it/app-content/privacy_bancomat.html"; | ||
|
||
const renderFooterButtons = (onCancel: () => void, onContinue: () => void) => ( | ||
<FooterWithButtons | ||
type={"TwoButtonsInlineThird"} | ||
leftButton={cancelButtonProps(onCancel, I18n.t("global.buttons.cancel"))} | ||
rightButton={confirmButtonProps( | ||
onContinue, | ||
I18n.t("global.buttons.continue") | ||
)} | ||
/> | ||
); | ||
|
||
/** | ||
* This screen allows the user to choose a specific bank to search for their Bancomat. | ||
* @constructor | ||
*/ | ||
const BancomatSearchStartScreen: React.FunctionComponent<Props> = ( | ||
props: Props | ||
) => { | ||
const openTosModal = () => { | ||
props.showModal( | ||
<TosBonusComponent tos_url={tos_url} onClose={props.hideModal} /> | ||
); | ||
}; | ||
|
||
const onContinueHandler = () => { | ||
props.searchPans(); | ||
}; | ||
return ( | ||
<BaseScreenComponent | ||
goBack={true} | ||
headerTitle={I18n.t("wallet.searchAbi.header")} | ||
contextualHelp={emptyContextualHelp} | ||
> | ||
<SafeAreaView style={IOStyles.flex}> | ||
<Content style={IOStyles.flex}> | ||
<BancomatSearchStartComponent | ||
openTosModal={openTosModal} | ||
onSearch={props.navigateToSearchBankScreen} | ||
/> | ||
</Content> | ||
{renderFooterButtons(props.onCancel, onContinueHandler)} | ||
</SafeAreaView> | ||
</BaseScreenComponent> | ||
); | ||
}; | ||
|
||
const mapDispatchToProps = (dispatch: Dispatch) => ({ | ||
loadAbis: () => dispatch(loadAbi.request()), | ||
onCancel: () => dispatch(walletAddBancomatCancel()), | ||
onBack: () => dispatch(walletAddBancomatBack()), | ||
searchPans: (abi?: string) => { | ||
dispatch(searchUserPans.request(abi)); | ||
dispatch(navigateToOnboardingBancomatSearchAvailableUserBancomat()); | ||
}, | ||
navigateToSearchBankScreen: () => { | ||
dispatch(navigateToOnboardingBancomatChooseBank()); | ||
} | ||
}); | ||
|
||
const mapStateToProps = (state: GlobalState) => ({ | ||
isLoading: isLoading(abiSelector(state)), | ||
isError: isError(abiSelector(state)) | ||
}); | ||
|
||
export default withLightModalContext( | ||
connect(mapStateToProps, mapDispatchToProps)(BancomatSearchStartScreen) | ||
); |
Oops, something went wrong.