Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 55f99d1

Browse files
authored
fix doc: integrate quote type (gatsbyjs#21114)
1 parent fadd935 commit 55f99d1

File tree

1 file changed

+11
-11
lines changed
  • docs/tutorial/ecommerce-tutorial

1 file changed

+11
-11
lines changed

docs/tutorial/ecommerce-tutorial/index.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ You imported React, added a button with some styles, and introduced some React f
215215

216216
```jsx:title=src/components/checkout.js
217217
componentDidMount() {
218-
this.stripe = window.Stripe('pk_test_jG9s3XMdSjZF9Kdm5g59zlYd')
218+
this.stripe = window.Stripe("pk_test_jG9s3XMdSjZF9Kdm5g59zlYd")
219219
}
220220
```
221221

@@ -225,13 +225,13 @@ This identifies you with the Stripe platform, validates the checkout request aga
225225
async redirectToCheckout(event) {
226226
event.preventDefault()
227227
const { error } = await this.stripe.redirectToCheckout({
228-
items: [{ sku: 'sku_DjQJN2HJ1kkvI3', quantity: 1 }],
228+
items: [{ sku: "sku_DjQJN2HJ1kkvI3", quantity: 1 }],
229229
successUrl: `http://localhost:8000/page-2/`,
230230
cancelUrl: `http://localhost:8000/`,
231231
})
232232

233233
if (error) {
234-
console.warn('Error:', error)
234+
console.warn("Error:", error)
235235
}
236236
}
237237
```
@@ -488,16 +488,16 @@ This component renders a neat card for each individual SKU, with the SKU name, n
488488
Lastly, you need to refactor your `Skus` component to initialize the Stripe.js client, and render `SkuCards` while handing down the Stripe.js client in the `props`:
489489

490490
```jsx:title=src/components/Products/Skus.js
491-
import React, { Component } from 'react'
492-
import { graphql, StaticQuery } from 'gatsby'
493-
import SkuCard from './SkuCard' // highlight-line
491+
import React, { Component } from "react"
492+
import { graphql, StaticQuery } from "gatsby"
493+
import SkuCard from "./SkuCard" // highlight-line
494494

495495
const containerStyles = {
496-
display: 'flex',
497-
flexDirection: 'row',
498-
flexWrap: 'wrap',
499-
justifyContent: 'space-between',
500-
padding: '1rem 0 1rem 0',
496+
display: "flex",
497+
flexDirection: "row",
498+
flexWrap: "wrap",
499+
justifyContent: "space-between",
500+
padding: "1rem 0 1rem 0",
501501
}
502502

503503
class Skus extends Component {

0 commit comments

Comments
 (0)