All files / app/payment/paymentMethod SignOutLink.tsx

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38  27x   27x 27x   27x             27x 15x 15x 15x 15x                                     27x  
import { PaymentMethod } from '@bigcommerce/checkout-sdk';
import React, { FunctionComponent } from 'react';
 
import { preventDefault } from '../../common/dom';
import { withLanguage, TranslatedString, WithLanguageProps } from '../../locale';
 
import getPaymentMethodName from './getPaymentMethodName';
 
export interface SignOutLinkProps {
    method: Partial<PaymentMethod> & Pick<PaymentMethod, 'id'>;
    onSignOut(): void;
}
 
const SignOutLink: FunctionComponent<SignOutLinkProps & WithLanguageProps> = ({
    language,
    method,
    onSignOut,
}) => (
    <div className="signout-link">
        <TranslatedString id="remote.sign_out_before_action" />
 
        { ' ' }
 
        <a href="#" onClick={ preventDefault(onSignOut) }>
            <TranslatedString
                data={ { providerName: getPaymentMethodName(language)(method) } }
                id="remote.sign_out_action"
            />
        </a>
 
        { ' ' }
 
        <TranslatedString id="remote.sign_out_after_action" />
    </div>
);
 
export default withLanguage(SignOutLink);