Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(Bonus Pagamenti Digitali): [#176739150] Chose to add cobadge or credit card screen #2778

Merged
merged 28 commits into from
Feb 8, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
c59c1c5
[#176738620] add choosetype screen
fabriziofff Feb 1, 2021
488e32a
[#176738620] rename action
fabriziofff Feb 1, 2021
9fd83a7
[#176738620] remove back from KO screens
fabriziofff Feb 1, 2021
7a66d35
[#176738620] add legacy support to navigation
fabriziofff Feb 1, 2021
f577f66
[#176738620] add choosetype screen
fabriziofff Feb 1, 2021
4781c26
[#176738620] rename action
fabriziofff Feb 1, 2021
e167f42
[#176738620] remove back from KO screens
fabriziofff Feb 1, 2021
9995ea4
[#176738620] add legacy support to navigation
fabriziofff Feb 1, 2021
fa07471
[#176738620] Merge remote-tracking branch 'origin/176738620-choose-ca…
fabriziofff Feb 2, 2021
e943794
[#176738620] fix eslint
fabriziofff Feb 2, 2021
6d6c94a
Merge branch 'master' into 176738620-choose-card-type
fabriziofff Feb 2, 2021
5969b7b
[#176738620] Merge branch 'master' into 176738620-choose-card-type
fabriziofff Feb 2, 2021
41946b7
[#176738620] Merge remote-tracking branch 'origin/master' into 176738…
fabriziofff Feb 2, 2021
2f0ee4d
Merge branch 'master' into 176738620-choose-card-type
debiff Feb 3, 2021
88f82e7
[#176739150] add card path type
debiff Feb 3, 2021
dd5278d
[#176739150] add renderItem function
debiff Feb 3, 2021
944e2bf
[#176738620] Merge remote-tracking branch 'origin/master' into 176738…
fabriziofff Feb 4, 2021
c2a6c7a
[#176739150] Merge branch '176738620-choose-card-type' into 176739150…
fabriziofff Feb 4, 2021
d831693
[#176739150] merge locales
fabriziofff Feb 4, 2021
f80fb05
Merge branch 'master' into 176738620-choose-card-type
debiff Feb 4, 2021
6e1b06d
Merge branch 'master' into 176738620-choose-card-type
fabriziofff Feb 4, 2021
5c2bf93
Merge branch 'master' into 176738620-choose-card-type
fabriziofff Feb 5, 2021
6a5b582
Update ts/features/wallet/component/NewMethodAddedNotifier.tsx
Undermaken Feb 5, 2021
1cba9d7
Merge branch 'master' into 176738620-choose-card-type
Undermaken Feb 5, 2021
e6ed8b7
[#176738620] Merge remote-tracking branch 'origin/master' into 176738…
fabriziofff Feb 5, 2021
5c5ed6b
[#176739150] Merge branch '176738620-choose-card-type' into 176739150…
fabriziofff Feb 5, 2021
7ca4dc2
Merge branch 'master' into 176739150-choose-cobadge-or-cc
debiff Feb 8, 2021
cc938ef
Merge branch 'master' into 176739150-choose-cobadge-or-cc
fabriziofff Feb 8, 2021
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
13 changes: 13 additions & 0 deletions locales/en/index.yml
Original file line number Diff line number Diff line change
Expand Up @@ -868,6 +868,19 @@ wallet:
blocked: "This card is blocked and can't be activated for Cashback. Please, contact the card issuer."
warning: "Check that the card number matches the one on your physical card."
loading: "We are adding your international circuit card\n\nPlease hold on..."
chooseType:
title: "Does your card allow you to shop online?"
description: "This question allows us to better understand what your card is like and help you add it to your Wallet."
path:
enabled:
title: "Yes, it is enabled for online purchases"
description: "The data will be verified in the way appointed by your bank, for example via text message or app."
disabled:
title: "No, I only use it in shops"
description: "We will look for all the cards in your name at the banks participating in the service."
unknown:
title: "I do not know"
description: "We will look for all the cards in your name at the banks participating in the service."
alert:
supportedCardPageLinkError: An error occurred while opening the supported cards page.
msgErrorUpdateApp: "An error occurred while opening the app store"
Expand Down
13 changes: 13 additions & 0 deletions locales/it/index.yml
Original file line number Diff line number Diff line change
Expand Up @@ -888,6 +888,19 @@ wallet:
blocked: "Questa carta risulta bloccata e pertanto non può essere attivata ai fini del Cashback. Contatta la tua banca."
warning: "Controlla che il numero della carta corrisponda a quello riportato sulla tua carta fisica."
loading: "Stiamo aggiungendo la tua carta con circuito internazionale\n\nAttendi qualche secondo..."
chooseType:
title: "La tua carta ti permette di acquistare online?"
description: "Questa domanda ci permette di capire meglio com’è fatta la tua carta e aiutarti ad aggiungerla al tuo Portafoglio."
path:
enabled:
title: "Sì, è abilitata agli acquisti online"
description: "I dati verranno verificati con le modalità previste dalla tua banca, ad esempio via sms o app."
disabled:
title: "No, la uso solo nei negozi"
description: "Cercheremo tutte le carte intestate a te presso le banche aderenti al servizio."
unknown:
title: "Non lo so"
description: "Cercheremo tutte le carte intestate a te presso le banche aderenti al servizio."
alert:
supportedCardPageLinkError: Si è verificato un errore durante l'apertura della pagina di riferimento per le carte supportate.
msgErrorUpdateApp: "Si è verificato un errore durante l'apertura dello store delle app"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,24 @@
import { none } from "fp-ts/lib/Option";
import { Button, Content, View } from "native-base";
import { Content, ListItem, View } from "native-base";
import * as React from "react";
import { SafeAreaView } from "react-native";
import {
FlatList,
ListRenderItemInfo,
SafeAreaView,
StyleSheet
} from "react-native";
import { NavigationActions, NavigationInjectedProps } from "react-navigation";
import { connect } from "react-redux";
import { Dispatch } from "redux";
import { H1 } from "../../../../../components/core/typography/H1";
import { H3 } from "../../../../../components/core/typography/H3";
import { H4 } from "../../../../../components/core/typography/H4";
import { H5 } from "../../../../../components/core/typography/H5";
import { IOColors } from "../../../../../components/core/variables/IOColors";
import { IOStyles } from "../../../../../components/core/variables/IOStyles";
import BaseScreenComponent from "../../../../../components/screens/BaseScreenComponent";
import FooterWithButtons from "../../../../../components/ui/FooterWithButtons";
import IconFont from "../../../../../components/ui/IconFont";
import I18n from "../../../../../i18n";
import { navigateToWalletAddCreditCard } from "../../../../../store/actions/navigation";
import { GlobalState } from "../../../../../store/reducers/types";
Expand All @@ -27,6 +37,51 @@ export type CoBadgeChooseTypeNavigationProps = {
legacyAddCreditCardBack?: number;
};

const styles = StyleSheet.create({
flexColumn: {
flexDirection: "column",
justifyContent: "space-between",
flex: 1
},
row: {
flexDirection: "row",
justifyContent: "space-between"
},
descriptionPadding: { paddingRight: 24 }
});
type CardOnlinePurchase = "enabled" | "disabled" | "unknown";

type IAddCardPath = Readonly<{
path: CardOnlinePurchase;
title: string;
description: string;
onPress: () => void;
}>;

const renderListItem = (cardPathItem: ListRenderItemInfo<IAddCardPath>) => (
<ListItem
onPress={cardPathItem.item.onPress}
first={cardPathItem.index === 0}
>
<View style={styles.flexColumn}>
<View style={styles.row}>
<View>
<H3 color={"bluegreyDark"} weight={"SemiBold"}>
{cardPathItem.item.title}
</H3>
</View>
<IconFont name={"io-right"} color={IOColors.blue} size={24} />
</View>
<H5
color={"bluegrey"}
weight={"Regular"}
style={styles.descriptionPadding}
>
{cardPathItem.item.description}
</H5>
</View>
</ListItem>
);
/**
* This screen allows the user to choose the exact type of card he intends to add
* @param props
Expand All @@ -37,6 +92,32 @@ const CoBadgeChooseType = (props: Props): React.ReactElement => {
const legacyAddCreditCardBack = props.navigation.getParam(
"legacyAddCreditCardBack"
);
const addCardPath: ReadonlyArray<IAddCardPath> = [
{
path: "enabled",
title: I18n.t("wallet.onboarding.coBadge.chooseType.path.enabled.title"),
description: I18n.t(
"wallet.onboarding.coBadge.chooseType.path.enabled.description"
),
onPress: () => props.addCreditCard(legacyAddCreditCardBack)
},
{
path: "disabled",
title: I18n.t("wallet.onboarding.coBadge.chooseType.path.disabled.title"),
description: I18n.t(
"wallet.onboarding.coBadge.chooseType.path.disabled.description"
),
onPress: () => props.addCoBadge(abi)
},
{
path: "unknown",
title: I18n.t("wallet.onboarding.coBadge.chooseType.path.unknown.title"),
description: I18n.t(
"wallet.onboarding.coBadge.chooseType.path.unknown.description"
),
onPress: () => props.addCoBadge(abi)
}
];
return (
<BaseScreenComponent
goBack={true}
Expand All @@ -45,14 +126,19 @@ const CoBadgeChooseType = (props: Props): React.ReactElement => {
>
<SafeAreaView style={IOStyles.flex}>
<Content style={IOStyles.flex}>
<H1>TMP CoBadgeChooseType</H1>
<Button onPress={() => props.addCreditCard(legacyAddCreditCardBack)}>
<H1>TMP Add Credit Card</H1>
</Button>
<H1>{I18n.t("wallet.onboarding.coBadge.chooseType.title")}</H1>
<View spacer={true} />
<H4 weight={"Regular"} color={"bluegreyDark"}>
{I18n.t("wallet.onboarding.coBadge.chooseType.description")}
</H4>
<View spacer={true} />
<Button onPress={() => props.addCoBadge(abi)}>
<H1>TMP Add Co-Badge</H1>
</Button>
<FlatList
removeClippedSubviews={false}
data={addCardPath}
keyExtractor={item => item.path}
ListFooterComponent={<View spacer />}
renderItem={i => renderListItem(i)}
/>
</Content>
<FooterWithButtons
type={"SingleButton"}
Expand Down