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

fix(Bonus Vacanze): [#174985742] Add consumed date row on bonus detail #2226

Merged
merged 5 commits into from
Sep 29, 2020
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
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
1 change: 1 addition & 0 deletions locales/en/index.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1418,6 +1418,7 @@ bonus:
code: Code
uniqueCode: Unique code
requestedAt: Requested on
consumedAt: Redeemed on
advice: 'By tapping on "Request the Bonus Vacanze" you declare that you have read and understood the '
status: Status
name: Bonus Vacanze
Expand Down
1 change: 1 addition & 0 deletions locales/it/index.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1450,6 +1450,7 @@ bonus:
code: Codice
uniqueCode: Codice univoco
requestedAt: Richiesto il
consumedAt: Utilizzato il
advice: "Cliccando su “Richiedi il Bonus Vacanze” dichiari di avere letto e compreso la "
status: Stato
name: Bonus Vacanze
Expand Down
38 changes: 27 additions & 11 deletions ts/features/bonus/bonusVacanze/screens/ActiveBonusScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ import { navigateBack } from "../../../../store/actions/navigation";
import { Dispatch } from "../../../../store/actions/types";
import { GlobalState } from "../../../../store/reducers/types";
import variables from "../../../../theme/variables";
import customVariables from "../../../../theme/variables";
import { formatDateAsLocal } from "../../../../utils/dates";
import { getLocalePrimaryWithFallback } from "../../../../utils/locale";
import {
Expand Down Expand Up @@ -148,7 +147,12 @@ const styles = StyleSheet.create({
statusBadgeRevoked: {
height: 18,
marginTop: 2,
backgroundColor: variables.textColor
backgroundColor: variables.brandHighLighter
},
statuTextRevoked: {
Undermaken marked this conversation as resolved.
Show resolved Hide resolved
fontSize: 12,
lineHeight: 18,
color: variables.brandDarkGray
},
screenshotTime: {
textAlign: "center",
Expand All @@ -157,7 +161,7 @@ const styles = StyleSheet.create({
},
statusText: {
fontSize: 12,
lineHeight: 16
lineHeight: 18
},
colorDarkest: {
color: variables.brandDarkestGray
Expand Down Expand Up @@ -510,7 +514,7 @@ const ActiveBonusScreen: React.FunctionComponent<Props> = (props: Props) => {
true
)
}),
customVariables.brandSuccess
variables.brandSuccess
);
case BonusActivationStatusEnum.FAILED:
return renderInformationBlock(
Expand Down Expand Up @@ -615,24 +619,36 @@ const ActiveBonusScreen: React.FunctionComponent<Props> = (props: Props) => {
: styles.statusBadgeRevoked
}
>
<Text style={styles.statusText} semibold={true}>
<Text
style={styles.statusText}
semibold={true}
dark={true}
>
{maybeStatusDescription.value}
</Text>
</Badge>
</View>
)}
<View spacer={true} />
{!isBonusActive(bonus) && bonus.redeemed_at && (
<>
<View style={styles.rowBlock}>
<Text style={[styles.colorGrey, styles.commonLabel]}>
{I18n.t("bonus.bonusVacanze.consumedAt")}
</Text>
<Text style={[styles.colorGrey, styles.commonLabel]}>
{formatDateAsLocal(bonus.redeemed_at, true)}
</Text>
</View>
<View spacer={true} small={true} />
</>
)}
<View style={styles.rowBlock}>
<Text style={[styles.colorGrey, styles.commonLabel]}>
{I18n.t("bonus.bonusVacanze.requestedAt")}
</Text>
<Text style={[styles.colorGrey, styles.commonLabel]}>
{isBonusActive(bonus)
? formatDateAsLocal(bonus.created_at, true)
: fromNullable(bonus.redeemed_at).fold(
formatDateAsLocal(bonus.created_at, true),
d => formatDateAsLocal(d, true)
)}
{formatDateAsLocal(bonus.created_at, true)}
</Text>
</View>
{!screenShotState.isPrintable && maybeBonusTos.isSome() && (
Expand Down