-
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: [#173767853] Add underage Infoscreen (#2051)
* [#173767853] add UnderageScreen * [#173767853] navigate to underage when received error status 451 Co-authored-by: Matteo Boschi <[email protected]>
- Loading branch information
1 parent
49d320e
commit fa6dbea
Showing
9 changed files
with
96 additions
and
5 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
53 changes: 53 additions & 0 deletions
53
ts/features/bonusVacanze/screens/eligibility/UnderageScreen.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,53 @@ | ||
import * as React from "react"; | ||
import { SafeAreaView } from "react-native"; | ||
import { connect } from "react-redux"; | ||
import { Dispatch } from "redux"; | ||
import FooterWithButtons from "../../../../components/ui/FooterWithButtons"; | ||
import I18n from "../../../../i18n"; | ||
import { cancelButtonProps } from "../../components/buttons/ButtonConfigurations"; | ||
import { useHardwareBackButton } from "../../components/hooks/useHardwareBackButton"; | ||
import { renderInfoRasterImage } from "../../components/infoScreen/imageRendering"; | ||
import { InfoScreenComponent } from "../../components/infoScreen/InfoScreenComponent"; | ||
import { bonusVacanzeStyle } from "../../components/Styles"; | ||
import { cancelBonusVacanzeRequest } from "../../store/actions/bonusVacanze"; | ||
|
||
type Props = ReturnType<typeof mapDispatchToProps>; | ||
|
||
const image = require("../../../../../img/wallet/errors/payment-unknown-icon.png"); | ||
|
||
/** | ||
* This screen informs the user that only citizens of legal age can apply for the bonus. | ||
* It allows only one CTA: exit | ||
* The screen is tied to the business logic and is composed using {@link InfoScreenComponent} | ||
* @param props | ||
* @constructor | ||
*/ | ||
|
||
const UnderageScreen: React.FunctionComponent<Props> = props => { | ||
const title = I18n.t("bonus.bonusVacanze.eligibility.underage.title"); | ||
const cancel = I18n.t("global.buttons.exit"); | ||
|
||
useHardwareBackButton(() => { | ||
props.onCancel(); | ||
return true; | ||
}); | ||
|
||
return ( | ||
<SafeAreaView style={bonusVacanzeStyle.flex}> | ||
<InfoScreenComponent image={renderInfoRasterImage(image)} title={title} /> | ||
<FooterWithButtons | ||
type={"SingleButton"} | ||
leftButton={cancelButtonProps(props.onCancel, cancel)} | ||
/> | ||
</SafeAreaView> | ||
); | ||
}; | ||
|
||
const mapDispatchToProps = (dispatch: Dispatch) => ({ | ||
onCancel: () => dispatch(cancelBonusVacanzeRequest()) | ||
}); | ||
|
||
export default connect( | ||
null, | ||
mapDispatchToProps | ||
)(UnderageScreen); |
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