Skip to content

Commit

Permalink
chore: address review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
blushi committed Aug 7, 2024
1 parent 2c1202c commit d490238
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 36 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export const CustomerInfo = ({
</div>
{retiring && (
<TextField
label={`Your name`}
label="Your name"
description={`This name will appear on the retirement certificate unless you choose to retire anonymously in the next step. It is also your user profile name.`}
{...register('name')}
error={!!errors['name']}
Expand All @@ -64,7 +64,7 @@ export const CustomerInfo = ({
)}
<TextField
className={!accountId && !wallet ? 'mb-30' : ''}
label={`Your email`}
label="Your email"
description={
!!wallet && !accountEmail ? (
<>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { useMemo } from 'react';
import { Elements } from '@stripe/react-stripe-js';
import { loadStripe, StripeElementsOptionsMode } from '@stripe/stripe-js';

Expand Down Expand Up @@ -52,44 +53,50 @@ export const PaymentInfoForm = ({
mode: 'onBlur',
});

const stripePromise =
paymentOption === 'card' &&
stripePublishableKey &&
loadStripe(stripePublishableKey);
const stripePromise = useMemo(
() =>
paymentOption === 'card' &&
stripePublishableKey &&
loadStripe(stripePublishableKey),
[paymentOption, stripePublishableKey],
);

const options: StripeElementsOptionsMode = {
mode: 'payment',
amount,
currency,
paymentMethodCreation: 'manual',
fonts: [
{
cssSrc:
'https://fonts.googleapis.com/css?family=Lato:100,300,400,700,800',
},
],
appearance: {
theme: 'stripe',
variables: {
colorText: '#000',
colorDanger: '#DE4526',
fontFamily: defaultFontFamily,
spacingUnit: '5px',
borderRadius: '2px',
},
rules: {
'.Label': {
fontWeight: 'bold',
fontSize: '16px',
const options: StripeElementsOptionsMode = useMemo(
() => ({
mode: 'payment',
amount,
currency,
paymentMethodCreation: 'manual',
fonts: [
{
cssSrc:
'https://fonts.googleapis.com/css?family=Lato:100,300,400,700,800',
},
'.Input': {
boxShadow: 'none',
borderColor: '#D2D5D9',
marginTop: '9px',
],
appearance: {
theme: 'stripe',
variables: {
colorText: '#000',
colorDanger: '#DE4526',
fontFamily: defaultFontFamily,
spacingUnit: '5px',
borderRadius: '2px',
},
rules: {
'.Label': {
fontWeight: 'bold',
fontSize: '16px',
},
'.Input': {
boxShadow: 'none',
borderColor: '#D2D5D9',
marginTop: '9px',
},
},
},
},
};
}),
[amount, currency],
);

return (
<Form form={form} onSubmit={onSubmit}>
Expand Down

0 comments on commit d490238

Please sign in to comment.