Skip to content

Commit

Permalink
fix(Bonus Pagamenti Digitali): [#175922698] On credit card insertion …
Browse files Browse the repository at this point in the history
…CTA is disabled (#2451)

* [#175922698] fix

* [#175922698] improve
  • Loading branch information
Undermaken authored Nov 28, 2020
1 parent e63333c commit 4535941
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions ts/screens/wallet/AddCardScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Screen for entering the credit card details
* (holder, pan, cvc, expiration date)
*/
import { none, Option, some } from "fp-ts/lib/Option";
import { fromNullable, none, Option, some } from "fp-ts/lib/Option";
import { AmountInEuroCents, RptId } from "italia-pagopa-commons/lib/pagopa";
import { entries, range, size } from "lodash";
import { Content, Item, Text, View } from "native-base";
Expand Down Expand Up @@ -159,7 +159,10 @@ const displayedCards: { [key: string]: any } = {
class AddCardScreen extends React.Component<Props, State> {
constructor(props: Props) {
super(props);
this.state = INITIAL_STATE;
this.state = {
...INITIAL_STATE,
holder: fromNullable(props.profileNameSurname)
};
}

public render(): React.ReactNode {
Expand Down Expand Up @@ -225,9 +228,7 @@ class AddCardScreen extends React.Component<Props, State> {
label={I18n.t("wallet.dummyCard.labels.holder")}
icon="io-titolare"
isValid={
this.state.holder.getOrElse(
this.props.profileNameSurname ?? EMPTY_CARD_HOLDER
) === ""
this.state.holder.getOrElse(EMPTY_CARD_HOLDER) === ""
? undefined
: true
}
Expand Down

0 comments on commit 4535941

Please sign in to comment.