-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2371 from Shopify/checkout-unstable-release
Unstable Release (checkout)
- Loading branch information
Showing
23 changed files
with
81 additions
and
67 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
'@shopify/ui-extensions-react': minor | ||
'@shopify/ui-extensions': minor | ||
--- | ||
|
||
Adds `type` property to `selectedPaymentOption` |
2 changes: 0 additions & 2 deletions
2
.../surfaces/checkout/components/ConsentCheckbox/examples/basic-consent-checkbox.example.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,3 @@ | ||
import React from 'react'; | ||
|
||
import { | ||
reactExtension, | ||
ConsentCheckbox, | ||
|
2 changes: 0 additions & 2 deletions
2
...components/ConsentCheckbox/examples/with-consent-phone-field-consent-checkbox.example.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,3 @@ | ||
import React from 'react'; | ||
|
||
import { | ||
reactExtension, | ||
BlockStack, | ||
|
2 changes: 0 additions & 2 deletions
2
...aces/checkout/components/ConsentPhoneField/examples/basic-consent-phone-field.example.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,3 @@ | ||
import React from 'react'; | ||
|
||
import { | ||
reactExtension, | ||
ConsentPhoneField, | ||
|
2 changes: 0 additions & 2 deletions
2
...mponents/ConsentPhoneField/examples/with-consent-checkbox-consent-phone-field.example.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,3 @@ | ||
import React from 'react'; | ||
|
||
import { | ||
reactExtension, | ||
BlockStack, | ||
|
2 changes: 0 additions & 2 deletions
2
...ns-react/src/surfaces/checkout/components/Select/examples/time-picking-select.example.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,3 @@ | ||
import React from 'react'; | ||
|
||
import { | ||
reactExtension, | ||
Select, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 0 additions & 1 deletion
1
packages/ui-extensions-react/src/surfaces/checkout/hooks/tests/mount.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
import React from 'react'; | ||
import {createRender} from '@quilted/react-testing'; | ||
import type { | ||
ApiForExtension, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 0 additions & 2 deletions
2
packages/ui-extensions-react/src/surfaces/checkout/hooks/tests/translate.test.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,3 @@ | ||
import React from 'react'; | ||
|
||
import {useTranslate} from '../translate'; | ||
|
||
import {mount} from './mount'; | ||
|
2 changes: 1 addition & 1 deletion
2
packages/ui-extensions-react/src/surfaces/checkout/hooks/tests/tsconfig.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...ges/ui-extensions/docs/surfaces/checkout/reference/examples/analytics-publish.example.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...ges/ui-extensions/docs/surfaces/checkout/reference/examples/analytics-visitor.example.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...extensions/docs/surfaces/checkout/reference/examples/customer-privacy/default.example.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 0 additions & 1 deletion
1
...ces/checkout/reference/examples/purchase.checkout.footer.render-after/default.example.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
import React from 'react'; | ||
import { | ||
BlockStack, | ||
reactExtension, | ||
|
1 change: 0 additions & 1 deletion
1
...ces/checkout/reference/examples/purchase.checkout.header.render-after/default.example.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
import React from 'react'; | ||
import { | ||
BlockStack, | ||
reactExtension, | ||
|
1 change: 0 additions & 1 deletion
1
...es/checkout/reference/examples/purchase.thank-you.footer.render-after/default.example.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
import React from 'react'; | ||
import { | ||
BlockStack, | ||
reactExtension, | ||
|
1 change: 0 additions & 1 deletion
1
...es/checkout/reference/examples/purchase.thank-you.header.render-after/default.example.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
import React from 'react'; | ||
import { | ||
BlockStack, | ||
reactExtension, | ||
|
45 changes: 45 additions & 0 deletions
45
packages/ui-extensions/docs/surfaces/checkout/reference/examples/storage.example.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
import {useEffect, useState} from 'react'; | ||
import { | ||
reactExtension, | ||
Checkbox, | ||
useApi, | ||
} from '@shopify/ui-extensions-react/checkout'; | ||
|
||
export default reactExtension( | ||
'purchase.checkout.block.render', | ||
() => <Extension />, | ||
); | ||
|
||
function Extension() { | ||
const {storage} = useApi(); | ||
const [tosConsent, setTosConsent] = | ||
useState(false); | ||
|
||
useEffect(() => { | ||
async function readFromStorage() { | ||
const tosConsent = await storage.read( | ||
'tos-consent', | ||
); | ||
|
||
setTosConsent(Boolean(tosConsent)); | ||
} | ||
|
||
readFromStorage(); | ||
}, [storage]); | ||
|
||
async function cacheConsent(value: boolean) { | ||
setTosConsent(value); | ||
await storage.write('tos-consent', value); | ||
} | ||
|
||
return ( | ||
<Checkbox | ||
id="tos" | ||
name="tos" | ||
onChange={cacheConsent} | ||
checked={tosConsent} | ||
> | ||
I agree with the terms of service | ||
</Checkbox> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters