Skip to content

Commit

Permalink
build: tweak layout
Browse files Browse the repository at this point in the history
  • Loading branch information
Kikobeats committed Nov 28, 2020
1 parent 960f70a commit ffc7118
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions src/pages/payment/update.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,7 @@ import {
import { ERROR_MAIL_OPTS, PAYMENT_STATE } from '.'

const Form = styled.form`
display: flex;
justify-content: center;
.StripeElement {
width: 20em;
display: block;
max-width: 100%;
padding: 10px 14px;
Expand Down Expand Up @@ -86,7 +82,7 @@ const CheckoutForm = ({ apiEndpoint, apiKey }) => {
})
})
)
.then(() => setPaymentState(PAYMENT_STATE))
.then(() => setPaymentState(PAYMENT_STATE.SUCCESS))
.catch(err => {
console.error(err)
setPaymentState(PAYMENT_STATE.FAILED)
Expand Down Expand Up @@ -140,10 +136,11 @@ const CheckoutForm = ({ apiEndpoint, apiKey }) => {
}}
/>
<Button
ml={[0, 0, 2, 2]}
mt={3}
loading={paymentState === PAYMENT_STATE.PROCESSING}
type='submit'
disabled={!stripe}
width='100%'
>
<Caps fontSize={1}>Update Card</Caps>
</Button>
Expand Down Expand Up @@ -181,7 +178,7 @@ export default () => {
Fill the new credit card and they will be associated with your
customer profile.
</Caption>
<Box pt={[3, 3, 4, 4]} width={layout.normal}>
<Box pt={[3, 3, 4, 4]} width={7}>
<Elements stripe={stripePromise}>
<CheckoutForm apiKey={apiKey} apiEndpoint={apiEndpoint} />
</Elements>
Expand Down

0 comments on commit ffc7118

Please sign in to comment.