diff --git a/img/bonus/bpd/fireworks.png b/img/bonus/bpd/fireworks.png new file mode 100644 index 00000000000..5bec88cd5aa Binary files /dev/null and b/img/bonus/bpd/fireworks.png differ diff --git a/locales/en/index.yml b/locales/en/index.yml index 1b126fde125..53c21ea9fad 100644 --- a/locales/en/index.yml +++ b/locales/en/index.yml @@ -1777,6 +1777,9 @@ bonus: other: "{{count}} valid transactions " text4: "and earned " text5: "a cashback of " + milestone: + title: "Congratulation, you earned {{cashbackValue}}" + body: "You have reached the maximum refund foreseen in this period. Continue to accumulate valid transactions to climb the ranking!" title: "Detail of the transaction" paymentCircuit: "Payment circuit" transactionAmount: "Transaction amount" diff --git a/locales/it/index.yml b/locales/it/index.yml index 431fca8395f..8c7aa49cce6 100644 --- a/locales/it/index.yml +++ b/locales/it/index.yml @@ -1809,6 +1809,9 @@ bonus: other: "{{count}} transazioni valide " text4: "e maturato " text5: "un cashback di " + milestone: + title: "Complimenti, hai ottenuto {{cashbackValue}}" + body: "Hai raggiunto il rimborso massimo previsto in questo periodo. Continua ad accumulare transazioni valide per salire in classifica!" title: "Dettaglio della transazione" paymentCircuit: "Circuito di pagamento" transactionAmount: "Importo transazione" diff --git a/ts/features/bonus/bpd/screens/details/transaction/BpdCashbackMilestoneComponent.tsx b/ts/features/bonus/bpd/screens/details/transaction/BpdCashbackMilestoneComponent.tsx new file mode 100644 index 00000000000..e6206327f55 --- /dev/null +++ b/ts/features/bonus/bpd/screens/details/transaction/BpdCashbackMilestoneComponent.tsx @@ -0,0 +1,47 @@ +import { View } from "native-base"; +import * as React from "react"; +import { Image, StyleSheet } from "react-native"; +import { IOColors } from "../../../../../../components/core/variables/IOColors"; +import fireworksIcon from "../../../../../../../img/bonus/bpd/fireworks.png"; +import { formatNumberAmount } from "../../../../../../utils/stringBuilder"; +import { H4 } from "../../../../../../components/core/typography/H4"; +import { IOStyles } from "../../../../../../components/core/variables/IOStyles"; +import I18n from "../../../../../../i18n"; + +type Props = { + cashbackValue: number; +}; + +const styles = StyleSheet.create({ + container: { + flexDirection: "row", + alignItems: "center", + justifyContent: "space-between", + backgroundColor: IOColors.blue, + paddingVertical: 16 + }, + image: { width: 32, height: 32, resizeMode: "cover" }, + textPadding: { + paddingHorizontal: 16 + } +}); +const BpdCashbackMilestoneComponent: React.FunctionComponent = ( + props: Props +) => ( + + + +

+ {I18n.t( + "bonus.bpd.details.transaction.detail.summary.milestone.title", + { cashbackValue: formatNumberAmount(props.cashbackValue, true) } + )} +

+

+ {I18n.t("bonus.bpd.details.transaction.detail.summary.milestone.body")} +

+
+
+); + +export default BpdCashbackMilestoneComponent; diff --git a/ts/features/bonus/bpd/screens/details/transaction/BpdTransactionsScreen.tsx b/ts/features/bonus/bpd/screens/details/transaction/BpdTransactionsScreen.tsx index b9904713d1f..4202f5521e0 100644 --- a/ts/features/bonus/bpd/screens/details/transaction/BpdTransactionsScreen.tsx +++ b/ts/features/bonus/bpd/screens/details/transaction/BpdTransactionsScreen.tsx @@ -27,7 +27,7 @@ import { import { bpdAmountForSelectedPeriod } from "../../../store/reducers/details/amounts"; import { bpdDisplayTransactionsSelector } from "../../../store/reducers/details/combiner"; import { bpdSelectedPeriodSelector } from "../../../store/reducers/details/selectedPeriod"; -import { IOColors } from "../../../../../../components/core/variables/IOColors"; +import BpdCashbackMilestoneComponent from "./BpdCashbackMilestoneComponent"; export type Props = ReturnType & ReturnType; @@ -158,12 +158,14 @@ const getTransactionsByDaySections = ( const renderSectionHeader = (info: { section: SectionListData; }): React.ReactNode => ( - !isTotalCashback(i)).length - } - /> + + !isTotalCashback(i)).length + } + /> + ); /** @@ -187,12 +189,19 @@ const BpdTransactionsScreen: React.FunctionComponent = props => { // PLACEHOLDER component waiting for story // https://www.pivotaltracker.com/story/show/175271516 return ( - -

CASHBACK!

-
+ p.maxPeriodCashback + )} + /> ); } - return ; + return ( + + + + ); }; return ( @@ -218,7 +227,6 @@ const BpdTransactionsScreen: React.FunctionComponent = props => { {props.selectedPeriod && (