Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
N
next.js
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Alex
next.js
Commits
9ac231a0
Unverified
Commit
9ac231a0
authored
Oct 19, 2022
by
Balázs Orbán
Committed by
GitHub
Oct 19, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
chore(examples): upgrade Stripe example (#41550)
parent
2d1f7299
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
18 additions
and
17 deletions
+18
-17
Cart.tsx
examples/with-stripe-typescript/components/Cart.tsx
+1
-1
CartSummary.tsx
examples/with-stripe-typescript/components/CartSummary.tsx
+1
-1
ClearCart.tsx
examples/with-stripe-typescript/components/ClearCart.tsx
+1
-1
Products.tsx
examples/with-stripe-typescript/components/Products.tsx
+1
-1
package.json
examples/with-stripe-typescript/package.json
+14
-13
No files found.
examples/with-stripe-typescript/components/Cart.tsx
View file @
9ac231a0
import
React
,
{
ReactNode
}
from
'react'
import
React
,
{
ReactNode
}
from
'react'
import
{
CartProvider
}
from
'use-shopping-cart
/react
'
import
{
CartProvider
}
from
'use-shopping-cart'
import
*
as
config
from
'../config'
import
*
as
config
from
'../config'
const
Cart
=
({
children
}:
{
children
:
ReactNode
})
=>
(
const
Cart
=
({
children
}:
{
children
:
ReactNode
})
=>
(
...
...
examples/with-stripe-typescript/components/CartSummary.tsx
View file @
9ac231a0
...
@@ -2,7 +2,7 @@ import React, { useState, useEffect } from 'react'
...
@@ -2,7 +2,7 @@ import React, { useState, useEffect } from 'react'
import
StripeTestCards
from
'../components/StripeTestCards'
import
StripeTestCards
from
'../components/StripeTestCards'
import
{
useShoppingCart
}
from
'use-shopping-cart
/react
'
import
{
useShoppingCart
}
from
'use-shopping-cart'
import
{
fetchPostJSON
}
from
'../utils/api-helpers'
import
{
fetchPostJSON
}
from
'../utils/api-helpers'
const
CartSummary
=
()
=>
{
const
CartSummary
=
()
=>
{
...
...
examples/with-stripe-typescript/components/ClearCart.tsx
View file @
9ac231a0
import
{
useEffect
}
from
'react'
import
{
useEffect
}
from
'react'
import
{
useShoppingCart
}
from
'use-shopping-cart
/react
'
import
{
useShoppingCart
}
from
'use-shopping-cart'
export
default
function
ClearCart
()
{
export
default
function
ClearCart
()
{
const
{
clearCart
}
=
useShoppingCart
()
const
{
clearCart
}
=
useShoppingCart
()
...
...
examples/with-stripe-typescript/components/Products.tsx
View file @
9ac231a0
import
products
from
'../data/products'
import
products
from
'../data/products'
import
{
formatCurrencyString
}
from
'use-shopping-cart'
import
{
formatCurrencyString
}
from
'use-shopping-cart'
import
{
useShoppingCart
}
from
'use-shopping-cart
/react
'
import
{
useShoppingCart
}
from
'use-shopping-cart'
const
Products
=
()
=>
{
const
Products
=
()
=>
{
const
{
addItem
,
removeItem
}
=
useShoppingCart
()
const
{
addItem
,
removeItem
}
=
useShoppingCart
()
...
...
examples/with-stripe-typescript/package.json
View file @
9ac231a0
...
@@ -6,22 +6,23 @@
...
@@ -6,22 +6,23 @@
"start"
:
"next start"
"start"
:
"next start"
},
},
"dependencies"
:
{
"dependencies"
:
{
"@stripe/react-stripe-js"
:
"1.
7
.0"
,
"@stripe/react-stripe-js"
:
"1.
13
.0"
,
"@stripe/stripe-js"
:
"1.
2
2.0"
,
"@stripe/stripe-js"
:
"1.
4
2.0"
,
"micro"
:
"^9.
3.4
"
,
"micro"
:
"^9.
4.1
"
,
"micro-cors"
:
"^0.1.1"
,
"micro-cors"
:
"^0.1.1"
,
"next"
:
"latest"
,
"next"
:
"latest"
,
"react"
:
"^17.0.2"
,
"react"
:
"^18.2.0"
,
"react-dom"
:
"^17.0.2"
,
"react-dom"
:
"^18.2.0"
,
"stripe"
:
"8.200.0"
,
"stripe"
:
"10.14.0"
,
"swr"
:
"^0.1.16"
,
"swr"
:
"^1.3.0"
,
"use-shopping-cart"
:
"3.0.5"
"use-shopping-cart"
:
"3.1.2"
,
"redux"
:
"4.2.0"
},
},
"devDependencies"
:
{
"devDependencies"
:
{
"@types/micro"
:
"^7.3.
3
"
,
"@types/micro"
:
"^7.3.
7
"
,
"@types/micro-cors"
:
"^0.1.
0
"
,
"@types/micro-cors"
:
"^0.1.
2
"
,
"@types/node"
:
"^1
3.
1.2"
,
"@types/node"
:
"^1
8.1
1.2"
,
"@types/react"
:
"^1
6.9.17
"
,
"@types/react"
:
"^1
8.0.21
"
,
"typescript"
:
"4.
5.5
"
"typescript"
:
"4.
8.4
"
}
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment