Skip to content

Commit

Permalink
fix(payment): INT-2871 Styled credit card of apms on adyen v2.
Browse files Browse the repository at this point in the history
  • Loading branch information
BC-AxelMalagon committed Jul 15, 2020
1 parent 5bba463 commit 8a13caa
Showing 1 changed file with 42 additions and 40 deletions.
82 changes: 42 additions & 40 deletions src/app/payment/paymentMethod/HostedWidgetPaymentMethod.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -178,46 +178,48 @@ class HostedWidgetPaymentMethod extends Component<
hideContentWhenLoading
isLoading={ isLoading }
>
{ selectedAccountInstrument && shouldShowInstrumentFieldset && <AccountInstrumentFieldset
instruments={ instruments as AccountInstrument[] }
onSelectInstrument={ this.handleSelectInstrument }
onUseNewInstrument={ this.handleUseNewCard }
selectedInstrument={ selectedAccountInstrument }
/> }

{ !selectedAccountInstrument && shouldShowInstrumentFieldset && <CardInstrumentFieldset
instruments={ instruments as CardInstrument[] }
onSelectInstrument={ this.handleSelectInstrument }
onUseNewInstrument={ this.handleUseNewCard }
selectedInstrumentId={ selectedInstrumentId }
shouldHideExpiryDate={ shouldHideInstrumentExpiryDate }
validateInstrument={ this.getValidateInstrument() }
/> }

{ this.renderPaymentDescriptorIfAvailable() }

<div
className={ classNames(
'widget',
`widget--${method.id}`,
'payment-widget',
additionalContainerClassName
) }
id={ containerId }
style={ {
display: (hideContentWhenSignedOut && isSignInRequired && !isSignedIn) || !shouldShowCreditCardFieldset || hideWidget ? 'none' : undefined,
} }
tabIndex={ -1 }
/>

{ shouldShowSaveInstrument && this.renderSaveInstrumentCheckbox() }

{ this.renderEditButtonIfAvailable() }

{ isSignedIn && <SignOutLink
method={ method }
onSignOut={ this.handleSignOut }
/> }
<div className="paymentMethod--hosted">
{ selectedAccountInstrument && shouldShowInstrumentFieldset && <AccountInstrumentFieldset
instruments={ instruments as AccountInstrument[] }
onSelectInstrument={ this.handleSelectInstrument }
onUseNewInstrument={ this.handleUseNewCard }
selectedInstrument={ selectedAccountInstrument }
/> }

{ !selectedAccountInstrument && shouldShowInstrumentFieldset && <CardInstrumentFieldset
instruments={ instruments as CardInstrument[] }
onSelectInstrument={ this.handleSelectInstrument }
onUseNewInstrument={ this.handleUseNewCard }
selectedInstrumentId={ selectedInstrumentId }
shouldHideExpiryDate={ shouldHideInstrumentExpiryDate }
validateInstrument={ this.getValidateInstrument() }
/> }

{ this.renderPaymentDescriptorIfAvailable() }

<div
className={ classNames(
'widget',
`widget--${method.id}`,
'payment-widget',
additionalContainerClassName
) }
id={ containerId }
style={ {
display: (hideContentWhenSignedOut && isSignInRequired && !isSignedIn) || !shouldShowCreditCardFieldset || hideWidget ? 'none' : undefined,
} }
tabIndex={ -1 }
/>

{ shouldShowSaveInstrument && this.renderSaveInstrumentCheckbox() }

{ this.renderEditButtonIfAvailable() }

{ isSignedIn && <SignOutLink
method={ method }
onSignOut={ this.handleSignOut }
/> }
</div>
</LoadingOverlay>
);
}
Expand Down

0 comments on commit 8a13caa

Please sign in to comment.