@shopify/shop-minis-react 0.0.21 → 0.0.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_virtual/___vite-browser-external.js +7 -0
- package/dist/_virtual/___vite-browser-external.js.map +1 -0
- package/dist/_virtual/__vite-browser-external.js +5 -0
- package/dist/_virtual/__vite-browser-external.js.map +1 -0
- package/dist/_virtual/_commonjsHelpers.js +24 -4
- package/dist/_virtual/_commonjsHelpers.js.map +1 -1
- package/dist/_virtual/browser-index.js +8 -0
- package/dist/_virtual/browser-index.js.map +1 -0
- package/dist/_virtual/browser-index2.js +5 -0
- package/dist/_virtual/browser-index2.js.map +1 -0
- package/dist/_virtual/clock.js +6 -0
- package/dist/_virtual/clock.js.map +1 -0
- package/dist/_virtual/conventions.js +5 -0
- package/dist/_virtual/conventions.js.map +1 -0
- package/dist/_virtual/document.js +8 -0
- package/dist/_virtual/document.js.map +1 -0
- package/dist/_virtual/dom-parser.js +5 -0
- package/dist/_virtual/dom-parser.js.map +1 -0
- package/dist/_virtual/dom.js +5 -0
- package/dist/_virtual/dom.js.map +1 -0
- package/dist/_virtual/entities.js +5 -0
- package/dist/_virtual/entities.js.map +1 -0
- package/dist/_virtual/extends.js +5 -0
- package/dist/_virtual/extends.js.map +1 -0
- package/dist/_virtual/index10.js +5 -0
- package/dist/_virtual/index10.js.map +1 -0
- package/dist/_virtual/index11.js +5 -0
- package/dist/_virtual/index11.js.map +1 -0
- package/dist/_virtual/index2.js +5 -2
- package/dist/_virtual/index2.js.map +1 -1
- package/dist/_virtual/index3.js +5 -3
- package/dist/_virtual/index3.js.map +1 -1
- package/dist/_virtual/index5.js +6 -0
- package/dist/_virtual/index5.js.map +1 -0
- package/dist/_virtual/index6.js +6 -0
- package/dist/_virtual/index6.js.map +1 -0
- package/dist/_virtual/index7.js +5 -0
- package/dist/_virtual/index7.js.map +1 -0
- package/dist/_virtual/index8.js +5 -0
- package/dist/_virtual/index8.js.map +1 -0
- package/dist/_virtual/index9.js +5 -0
- package/dist/_virtual/index9.js.map +1 -0
- package/dist/_virtual/parse-sidx.js +8 -0
- package/dist/_virtual/parse-sidx.js.map +1 -0
- package/dist/_virtual/sax.js +5 -0
- package/dist/_virtual/sax.js.map +1 -0
- package/dist/_virtual/window.js +8 -0
- package/dist/_virtual/window.js.map +1 -0
- package/dist/components/atoms/video-player.js +121 -0
- package/dist/components/atoms/video-player.js.map +1 -0
- package/dist/components/commerce/merchant-card.js +236 -106
- package/dist/components/commerce/merchant-card.js.map +1 -1
- package/dist/index.js +199 -192
- package/dist/index.js.map +1 -1
- package/dist/mocks.js +114 -87
- package/dist/mocks.js.map +1 -1
- package/dist/shop-minis-react/node_modules/.pnpm/@babel_runtime@7.27.6/node_modules/@babel/runtime/helpers/extends.js +20 -0
- package/dist/shop-minis-react/node_modules/.pnpm/@babel_runtime@7.27.6/node_modules/@babel/runtime/helpers/extends.js.map +1 -0
- package/dist/shop-minis-react/node_modules/.pnpm/@radix-ui_react-use-is-hydrated@0.1.0_@types_react@19.1.6_react@19.1.0/node_modules/@radix-ui/react-use-is-hydrated/dist/index.js +1 -1
- package/dist/shop-minis-react/node_modules/.pnpm/@videojs_vhs-utils@4.1.1/node_modules/@videojs/vhs-utils/es/byte-helpers.js +79 -0
- package/dist/shop-minis-react/node_modules/.pnpm/@videojs_vhs-utils@4.1.1/node_modules/@videojs/vhs-utils/es/byte-helpers.js.map +1 -0
- package/dist/shop-minis-react/node_modules/.pnpm/@videojs_vhs-utils@4.1.1/node_modules/@videojs/vhs-utils/es/codecs.js +102 -0
- package/dist/shop-minis-react/node_modules/.pnpm/@videojs_vhs-utils@4.1.1/node_modules/@videojs/vhs-utils/es/codecs.js.map +1 -0
- package/dist/shop-minis-react/node_modules/.pnpm/@videojs_vhs-utils@4.1.1/node_modules/@videojs/vhs-utils/es/containers.js +149 -0
- package/dist/shop-minis-react/node_modules/.pnpm/@videojs_vhs-utils@4.1.1/node_modules/@videojs/vhs-utils/es/containers.js.map +1 -0
- package/dist/shop-minis-react/node_modules/.pnpm/@videojs_vhs-utils@4.1.1/node_modules/@videojs/vhs-utils/es/decode-b64-to-uint8-array.js +13 -0
- package/dist/shop-minis-react/node_modules/.pnpm/@videojs_vhs-utils@4.1.1/node_modules/@videojs/vhs-utils/es/decode-b64-to-uint8-array.js.map +1 -0
- package/dist/shop-minis-react/node_modules/.pnpm/@videojs_vhs-utils@4.1.1/node_modules/@videojs/vhs-utils/es/ebml-helpers.js +77 -0
- package/dist/shop-minis-react/node_modules/.pnpm/@videojs_vhs-utils@4.1.1/node_modules/@videojs/vhs-utils/es/ebml-helpers.js.map +1 -0
- package/dist/shop-minis-react/node_modules/.pnpm/@videojs_vhs-utils@4.1.1/node_modules/@videojs/vhs-utils/es/id3-helpers.js +15 -0
- package/dist/shop-minis-react/node_modules/.pnpm/@videojs_vhs-utils@4.1.1/node_modules/@videojs/vhs-utils/es/id3-helpers.js.map +1 -0
- package/dist/shop-minis-react/node_modules/.pnpm/@videojs_vhs-utils@4.1.1/node_modules/@videojs/vhs-utils/es/media-groups.js +13 -0
- package/dist/shop-minis-react/node_modules/.pnpm/@videojs_vhs-utils@4.1.1/node_modules/@videojs/vhs-utils/es/media-groups.js.map +1 -0
- package/dist/shop-minis-react/node_modules/.pnpm/@videojs_vhs-utils@4.1.1/node_modules/@videojs/vhs-utils/es/media-types.js +7 -0
- package/dist/shop-minis-react/node_modules/.pnpm/@videojs_vhs-utils@4.1.1/node_modules/@videojs/vhs-utils/es/media-types.js.map +1 -0
- package/dist/shop-minis-react/node_modules/.pnpm/@videojs_vhs-utils@4.1.1/node_modules/@videojs/vhs-utils/es/mp4-helpers.js +31 -0
- package/dist/shop-minis-react/node_modules/.pnpm/@videojs_vhs-utils@4.1.1/node_modules/@videojs/vhs-utils/es/mp4-helpers.js.map +1 -0
- package/dist/shop-minis-react/node_modules/.pnpm/@videojs_vhs-utils@4.1.1/node_modules/@videojs/vhs-utils/es/nal-helpers.js +39 -0
- package/dist/shop-minis-react/node_modules/.pnpm/@videojs_vhs-utils@4.1.1/node_modules/@videojs/vhs-utils/es/nal-helpers.js.map +1 -0
- package/dist/shop-minis-react/node_modules/.pnpm/@videojs_vhs-utils@4.1.1/node_modules/@videojs/vhs-utils/es/resolve-url.js +14 -0
- package/dist/shop-minis-react/node_modules/.pnpm/@videojs_vhs-utils@4.1.1/node_modules/@videojs/vhs-utils/es/resolve-url.js.map +1 -0
- package/dist/shop-minis-react/node_modules/.pnpm/@videojs_vhs-utils@4.1.1/node_modules/@videojs/vhs-utils/es/stream.js +33 -0
- package/dist/shop-minis-react/node_modules/.pnpm/@videojs_vhs-utils@4.1.1/node_modules/@videojs/vhs-utils/es/stream.js.map +1 -0
- package/dist/shop-minis-react/node_modules/.pnpm/@videojs_xhr@2.7.0/node_modules/@videojs/xhr/lib/http-handler.js +42 -0
- package/dist/shop-minis-react/node_modules/.pnpm/@videojs_xhr@2.7.0/node_modules/@videojs/xhr/lib/http-handler.js.map +1 -0
- package/dist/shop-minis-react/node_modules/.pnpm/@videojs_xhr@2.7.0/node_modules/@videojs/xhr/lib/index.js +169 -0
- package/dist/shop-minis-react/node_modules/.pnpm/@videojs_xhr@2.7.0/node_modules/@videojs/xhr/lib/index.js.map +1 -0
- package/dist/shop-minis-react/node_modules/.pnpm/@videojs_xhr@2.7.0/node_modules/@videojs/xhr/lib/interceptors.js +75 -0
- package/dist/shop-minis-react/node_modules/.pnpm/@videojs_xhr@2.7.0/node_modules/@videojs/xhr/lib/interceptors.js.map +1 -0
- package/dist/shop-minis-react/node_modules/.pnpm/@videojs_xhr@2.7.0/node_modules/@videojs/xhr/lib/retry.js +70 -0
- package/dist/shop-minis-react/node_modules/.pnpm/@videojs_xhr@2.7.0/node_modules/@videojs/xhr/lib/retry.js.map +1 -0
- package/dist/shop-minis-react/node_modules/.pnpm/@xmldom_xmldom@0.8.10/node_modules/@xmldom/xmldom/lib/conventions.js +124 -0
- package/dist/shop-minis-react/node_modules/.pnpm/@xmldom_xmldom@0.8.10/node_modules/@xmldom/xmldom/lib/conventions.js.map +1 -0
- package/dist/shop-minis-react/node_modules/.pnpm/@xmldom_xmldom@0.8.10/node_modules/@xmldom/xmldom/lib/dom-parser.js +151 -0
- package/dist/shop-minis-react/node_modules/.pnpm/@xmldom_xmldom@0.8.10/node_modules/@xmldom/xmldom/lib/dom-parser.js.map +1 -0
- package/dist/shop-minis-react/node_modules/.pnpm/@xmldom_xmldom@0.8.10/node_modules/@xmldom/xmldom/lib/dom.js +993 -0
- package/dist/shop-minis-react/node_modules/.pnpm/@xmldom_xmldom@0.8.10/node_modules/@xmldom/xmldom/lib/dom.js.map +1 -0
- package/dist/shop-minis-react/node_modules/.pnpm/@xmldom_xmldom@0.8.10/node_modules/@xmldom/xmldom/lib/entities.js +2146 -0
- package/dist/shop-minis-react/node_modules/.pnpm/@xmldom_xmldom@0.8.10/node_modules/@xmldom/xmldom/lib/entities.js.map +1 -0
- package/dist/shop-minis-react/node_modules/.pnpm/@xmldom_xmldom@0.8.10/node_modules/@xmldom/xmldom/lib/index.js +14 -0
- package/dist/shop-minis-react/node_modules/.pnpm/@xmldom_xmldom@0.8.10/node_modules/@xmldom/xmldom/lib/index.js.map +1 -0
- package/dist/shop-minis-react/node_modules/.pnpm/@xmldom_xmldom@0.8.10/node_modules/@xmldom/xmldom/lib/sax.js +346 -0
- package/dist/shop-minis-react/node_modules/.pnpm/@xmldom_xmldom@0.8.10/node_modules/@xmldom/xmldom/lib/sax.js.map +1 -0
- package/dist/shop-minis-react/node_modules/.pnpm/color-convert@2.0.1/node_modules/color-convert/conversions.js +308 -0
- package/dist/shop-minis-react/node_modules/.pnpm/color-convert@2.0.1/node_modules/color-convert/conversions.js.map +1 -0
- package/dist/shop-minis-react/node_modules/.pnpm/color-convert@2.0.1/node_modules/color-convert/index.js +41 -0
- package/dist/shop-minis-react/node_modules/.pnpm/color-convert@2.0.1/node_modules/color-convert/index.js.map +1 -0
- package/dist/shop-minis-react/node_modules/.pnpm/color-convert@2.0.1/node_modules/color-convert/route.js +53 -0
- package/dist/shop-minis-react/node_modules/.pnpm/color-convert@2.0.1/node_modules/color-convert/route.js.map +1 -0
- package/dist/shop-minis-react/node_modules/.pnpm/color-name@1.1.4/node_modules/color-name/index.js +157 -0
- package/dist/shop-minis-react/node_modules/.pnpm/color-name@1.1.4/node_modules/color-name/index.js.map +1 -0
- package/dist/shop-minis-react/node_modules/.pnpm/color-string@1.9.1/node_modules/color-string/index.js +103 -0
- package/dist/shop-minis-react/node_modules/.pnpm/color-string@1.9.1/node_modules/color-string/index.js.map +1 -0
- package/dist/shop-minis-react/node_modules/.pnpm/color@4.2.3/node_modules/color/index.js +269 -0
- package/dist/shop-minis-react/node_modules/.pnpm/color@4.2.3/node_modules/color/index.js.map +1 -0
- package/dist/shop-minis-react/node_modules/.pnpm/global@4.4.0/node_modules/global/document.js +13 -0
- package/dist/shop-minis-react/node_modules/.pnpm/global@4.4.0/node_modules/global/document.js.map +1 -0
- package/dist/shop-minis-react/node_modules/.pnpm/global@4.4.0/node_modules/global/window.js +12 -0
- package/dist/shop-minis-react/node_modules/.pnpm/global@4.4.0/node_modules/global/window.js.map +1 -0
- package/dist/shop-minis-react/node_modules/.pnpm/is-arrayish@0.3.2/node_modules/is-arrayish/index.js +10 -0
- package/dist/shop-minis-react/node_modules/.pnpm/is-arrayish@0.3.2/node_modules/is-arrayish/index.js.map +1 -0
- package/dist/shop-minis-react/node_modules/.pnpm/is-function@1.0.2/node_modules/is-function/index.js +18 -0
- package/dist/shop-minis-react/node_modules/.pnpm/is-function@1.0.2/node_modules/is-function/index.js.map +1 -0
- package/dist/shop-minis-react/node_modules/.pnpm/m3u8-parser@7.2.0/node_modules/m3u8-parser/dist/m3u8-parser.es.js +855 -0
- package/dist/shop-minis-react/node_modules/.pnpm/m3u8-parser@7.2.0/node_modules/m3u8-parser/dist/m3u8-parser.es.js.map +1 -0
- package/dist/shop-minis-react/node_modules/.pnpm/mpd-parser@1.3.1/node_modules/mpd-parser/dist/mpd-parser.es.js +1102 -0
- package/dist/shop-minis-react/node_modules/.pnpm/mpd-parser@1.3.1/node_modules/mpd-parser/dist/mpd-parser.es.js.map +1 -0
- package/dist/shop-minis-react/node_modules/.pnpm/mux.js@7.1.0/node_modules/mux.js/lib/tools/parse-sidx.js +32 -0
- package/dist/shop-minis-react/node_modules/.pnpm/mux.js@7.1.0/node_modules/mux.js/lib/tools/parse-sidx.js.map +1 -0
- package/dist/shop-minis-react/node_modules/.pnpm/mux.js@7.1.0/node_modules/mux.js/lib/utils/clock.js +34 -0
- package/dist/shop-minis-react/node_modules/.pnpm/mux.js@7.1.0/node_modules/mux.js/lib/utils/clock.js.map +1 -0
- package/dist/shop-minis-react/node_modules/.pnpm/mux.js@7.1.0/node_modules/mux.js/lib/utils/numbers.js +17 -0
- package/dist/shop-minis-react/node_modules/.pnpm/mux.js@7.1.0/node_modules/mux.js/lib/utils/numbers.js.map +1 -0
- package/dist/shop-minis-react/node_modules/.pnpm/querystringify@2.2.0/node_modules/querystringify/index.js +1 -1
- package/dist/shop-minis-react/node_modules/.pnpm/simple-swizzle@0.2.2/node_modules/simple-swizzle/index.js +23 -0
- package/dist/shop-minis-react/node_modules/.pnpm/simple-swizzle@0.2.2/node_modules/simple-swizzle/index.js.map +1 -0
- package/dist/shop-minis-react/node_modules/.pnpm/use-sync-external-store@1.5.0_react@19.1.0/node_modules/use-sync-external-store/shim/index.js +1 -1
- package/dist/shop-minis-react/node_modules/.pnpm/video.js@8.23.3/node_modules/video.js/dist/video.es.js +27824 -0
- package/dist/shop-minis-react/node_modules/.pnpm/video.js@8.23.3/node_modules/video.js/dist/video.es.js.map +1 -0
- package/dist/shop-minis-react/node_modules/.pnpm/videojs-vtt.js@0.15.5/node_modules/videojs-vtt.js/lib/browser-index.js +26 -0
- package/dist/shop-minis-react/node_modules/.pnpm/videojs-vtt.js@0.15.5/node_modules/videojs-vtt.js/lib/browser-index.js.map +1 -0
- package/dist/shop-minis-react/node_modules/.pnpm/videojs-vtt.js@0.15.5/node_modules/videojs-vtt.js/lib/vtt.js +802 -0
- package/dist/shop-minis-react/node_modules/.pnpm/videojs-vtt.js@0.15.5/node_modules/videojs-vtt.js/lib/vtt.js.map +1 -0
- package/dist/shop-minis-react/node_modules/.pnpm/videojs-vtt.js@0.15.5/node_modules/videojs-vtt.js/lib/vttcue.js +188 -0
- package/dist/shop-minis-react/node_modules/.pnpm/videojs-vtt.js@0.15.5/node_modules/videojs-vtt.js/lib/vttcue.js.map +1 -0
- package/dist/shop-minis-react/node_modules/.pnpm/videojs-vtt.js@0.15.5/node_modules/videojs-vtt.js/lib/vttregion.js +104 -0
- package/dist/shop-minis-react/node_modules/.pnpm/videojs-vtt.js@0.15.5/node_modules/videojs-vtt.js/lib/vttregion.js.map +1 -0
- package/dist/shop-minis-react.css +1 -1
- package/dist/utils/colors.js +6 -0
- package/dist/utils/colors.js.map +1 -0
- package/dist/utils/merchant-card.js +44 -0
- package/dist/utils/merchant-card.js.map +1 -0
- package/package.json +5 -1
- package/src/components/atoms/video-player.tsx +213 -0
- package/src/components/commerce/merchant-card.tsx +219 -49
- package/src/components/index.ts +1 -0
- package/src/mocks.ts +148 -16
- package/src/stories/MerchantCard.stories.tsx +63 -9
- package/src/utils/colors.ts +5 -0
- package/src/utils/index.ts +1 -0
- package/src/utils/merchant-card.ts +99 -0
- package/src/hooks/navigation/useCloseMini.doc.ts +0 -32
- package/src/hooks/navigation/useCloseMini.example.tsx +0 -7
- package/src/hooks/navigation/useDeeplink.doc.ts +0 -32
- package/src/hooks/navigation/useDeeplink.example.tsx +0 -7
- package/src/hooks/navigation/useShopNavigation.doc.ts +0 -32
- package/src/hooks/navigation/useShopNavigation.example.tsx +0 -32
- package/src/hooks/product/useCuratedProducts.doc.ts +0 -32
- package/src/hooks/product/useCuratedProducts.example.tsx +0 -10
- package/src/hooks/product/useProductList.doc.ts +0 -32
- package/src/hooks/product/useProductList.example.tsx +0 -9
- package/src/hooks/product/useProductListActions.doc.ts +0 -32
- package/src/hooks/product/useProductListActions.example.tsx +0 -60
- package/src/hooks/product/useProductLists.doc.ts +0 -32
- package/src/hooks/product/useProductLists.example.tsx +0 -9
- package/src/hooks/product/useProductSearch.doc.ts +0 -32
- package/src/hooks/product/useProductSearch.example.tsx +0 -13
- package/src/hooks/product/useRecommendedProducts.doc.ts +0 -32
- package/src/hooks/product/useRecommendedProducts.example.tsx +0 -7
- package/src/hooks/shop/useRecommendedShops.doc.ts +0 -32
- package/src/hooks/shop/useRecommendedShops.example.tsx +0 -7
- package/src/hooks/shop/useShop.doc.ts +0 -31
- package/src/hooks/shop/useShop.example.tsx +0 -7
- package/src/hooks/shop/useShopCartActions.doc.ts +0 -32
- package/src/hooks/shop/useShopCartActions.example.tsx +0 -28
- package/src/hooks/storage/useAsyncStorage.doc.ts +0 -32
- package/src/hooks/storage/useAsyncStorage.example.tsx +0 -30
- package/src/hooks/storage/useImageUpload.doc.ts +0 -32
- package/src/hooks/storage/useImageUpload.example.tsx +0 -20
- package/src/hooks/storage/useSecureStorage.doc.ts +0 -32
- package/src/hooks/storage/useSecureStorage.example.tsx +0 -23
- package/src/hooks/user/useBuyerAttributes.doc.ts +0 -32
- package/src/hooks/user/useBuyerAttributes.example.tsx +0 -14
- package/src/hooks/user/useCurrentUser.doc.ts +0 -31
- package/src/hooks/user/useCurrentUser.example.tsx +0 -7
- package/src/hooks/user/useFollowedShopsActions.doc.ts +0 -32
- package/src/hooks/user/useFollowedShopsActions.example.tsx +0 -16
- package/src/hooks/user/useOrders.doc.ts +0 -32
- package/src/hooks/user/useOrders.example.tsx +0 -7
- package/src/hooks/user/useRecentProducts.doc.ts +0 -32
- package/src/hooks/user/useRecentProducts.example.tsx +0 -13
- package/src/hooks/user/useSavedProducts.doc.ts +0 -32
- package/src/hooks/user/useSavedProducts.example.tsx +0 -13
- package/src/hooks/user/useSavedProductsActions.doc.ts +0 -32
- package/src/hooks/user/useSavedProductsActions.example.tsx +0 -32
- package/src/hooks/util/useErrorScreen.doc.ts +0 -32
- package/src/hooks/util/useErrorScreen.example.tsx +0 -15
- package/src/hooks/util/useErrorToast.doc.ts +0 -32
- package/src/hooks/util/useErrorToast.example.tsx +0 -15
- package/src/hooks/util/useImagePicker.example.tsx +0 -77
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
import {useProductListActions, Button} from '@shopify/shop-minis-react'
|
|
2
|
-
|
|
3
|
-
export default function MyComponent() {
|
|
4
|
-
const {
|
|
5
|
-
addProductList,
|
|
6
|
-
removeProductList,
|
|
7
|
-
renameProductList,
|
|
8
|
-
addProductListItem,
|
|
9
|
-
removeProductListItem,
|
|
10
|
-
} = useProductListActions()
|
|
11
|
-
|
|
12
|
-
return (
|
|
13
|
-
<>
|
|
14
|
-
<Button onClick={() => addProductList({name: 'My product list'})}>
|
|
15
|
-
Add product list
|
|
16
|
-
</Button>
|
|
17
|
-
<Button
|
|
18
|
-
onClick={() => removeProductList({id: 'gid://shopapp/ProductList/123'})}
|
|
19
|
-
>
|
|
20
|
-
Remove product list
|
|
21
|
-
</Button>
|
|
22
|
-
<Button
|
|
23
|
-
onClick={() =>
|
|
24
|
-
renameProductList({
|
|
25
|
-
id: 'gid://shopapp/ProductList/123',
|
|
26
|
-
name: 'My renamed product list',
|
|
27
|
-
})
|
|
28
|
-
}
|
|
29
|
-
>
|
|
30
|
-
Rename product list
|
|
31
|
-
</Button>
|
|
32
|
-
<Button
|
|
33
|
-
onClick={() =>
|
|
34
|
-
addProductListItem({
|
|
35
|
-
shopId: 'gid://shopify/Shop/42',
|
|
36
|
-
productId: 'gid://shopify/Product/123',
|
|
37
|
-
productVariantId: 'gid://shopify/ProductVariant/101',
|
|
38
|
-
listId: 'gid://shopapp/ProductList/99',
|
|
39
|
-
publicListId: 'abc123',
|
|
40
|
-
})
|
|
41
|
-
}
|
|
42
|
-
>
|
|
43
|
-
Add product to list
|
|
44
|
-
</Button>
|
|
45
|
-
<Button
|
|
46
|
-
onClick={() =>
|
|
47
|
-
removeProductListItem({
|
|
48
|
-
shopId: 'gid://shopify/Shop/42',
|
|
49
|
-
productId: 'gid://shopify/Product/123',
|
|
50
|
-
productVariantId: 'gid://shopify/ProductVariant/101',
|
|
51
|
-
listId: 'gid://shopapp/ProductList/99',
|
|
52
|
-
publicListId: 'abc123',
|
|
53
|
-
})
|
|
54
|
-
}
|
|
55
|
-
>
|
|
56
|
-
Remove product from list
|
|
57
|
-
</Button>
|
|
58
|
-
</>
|
|
59
|
-
)
|
|
60
|
-
}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import {ReferenceEntityTemplateSchema} from '@shopify/generate-docs'
|
|
2
|
-
|
|
3
|
-
const data: ReferenceEntityTemplateSchema = {
|
|
4
|
-
name: 'useProductLists',
|
|
5
|
-
category: 'hooks',
|
|
6
|
-
subCategory: 'product',
|
|
7
|
-
isVisualComponent: false,
|
|
8
|
-
related: [],
|
|
9
|
-
description:
|
|
10
|
-
'The `useProductLists` hook fetches all the users product lists.',
|
|
11
|
-
type: 'hook',
|
|
12
|
-
defaultExample: {
|
|
13
|
-
codeblock: {
|
|
14
|
-
tabs: [
|
|
15
|
-
{
|
|
16
|
-
code: './useProductLists.example.tsx',
|
|
17
|
-
language: 'tsx',
|
|
18
|
-
},
|
|
19
|
-
],
|
|
20
|
-
title: 'Example code',
|
|
21
|
-
},
|
|
22
|
-
},
|
|
23
|
-
definitions: [
|
|
24
|
-
{
|
|
25
|
-
title: '',
|
|
26
|
-
type: 'UseProductListsGeneratedType',
|
|
27
|
-
description: '',
|
|
28
|
-
},
|
|
29
|
-
],
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
export default data
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import {ReferenceEntityTemplateSchema} from '@shopify/generate-docs'
|
|
2
|
-
|
|
3
|
-
const data: ReferenceEntityTemplateSchema = {
|
|
4
|
-
name: 'useProductSearch',
|
|
5
|
-
category: 'hooks',
|
|
6
|
-
subCategory: 'product',
|
|
7
|
-
isVisualComponent: false,
|
|
8
|
-
related: [],
|
|
9
|
-
description:
|
|
10
|
-
'The `useProductSearch` hook fetches products based on a search query.',
|
|
11
|
-
type: 'hook',
|
|
12
|
-
defaultExample: {
|
|
13
|
-
codeblock: {
|
|
14
|
-
tabs: [
|
|
15
|
-
{
|
|
16
|
-
code: './useProductSearch.example.tsx',
|
|
17
|
-
language: 'tsx',
|
|
18
|
-
},
|
|
19
|
-
],
|
|
20
|
-
title: 'Example code',
|
|
21
|
-
},
|
|
22
|
-
},
|
|
23
|
-
definitions: [
|
|
24
|
-
{
|
|
25
|
-
title: '',
|
|
26
|
-
type: 'UseProductSearchGeneratedType',
|
|
27
|
-
description: '',
|
|
28
|
-
},
|
|
29
|
-
],
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
export default data
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import {useProductSearch} from '@shopify/shop-minis-react'
|
|
2
|
-
|
|
3
|
-
export default function MyComponent() {
|
|
4
|
-
const {products, loading} = useProductSearch({
|
|
5
|
-
query: 'shirt',
|
|
6
|
-
first: 10,
|
|
7
|
-
filters: {
|
|
8
|
-
color: ['RED'],
|
|
9
|
-
},
|
|
10
|
-
})
|
|
11
|
-
|
|
12
|
-
console.log({products, loading})
|
|
13
|
-
}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import {ReferenceEntityTemplateSchema} from '@shopify/generate-docs'
|
|
2
|
-
|
|
3
|
-
const data: ReferenceEntityTemplateSchema = {
|
|
4
|
-
name: 'useRecommendedProducts',
|
|
5
|
-
category: 'hooks',
|
|
6
|
-
subCategory: 'product',
|
|
7
|
-
isVisualComponent: false,
|
|
8
|
-
related: [],
|
|
9
|
-
description:
|
|
10
|
-
'The `useRecommendedProducts` hook enables fetching a list of recommended products for the user. The list may be empty if the user has no recommended products.',
|
|
11
|
-
type: 'hook',
|
|
12
|
-
defaultExample: {
|
|
13
|
-
codeblock: {
|
|
14
|
-
tabs: [
|
|
15
|
-
{
|
|
16
|
-
code: './useRecommendedProducts.example.tsx',
|
|
17
|
-
language: 'tsx',
|
|
18
|
-
},
|
|
19
|
-
],
|
|
20
|
-
title: 'Example code',
|
|
21
|
-
},
|
|
22
|
-
},
|
|
23
|
-
definitions: [
|
|
24
|
-
{
|
|
25
|
-
title: '',
|
|
26
|
-
type: 'UseRecommendedProductsGeneratedType',
|
|
27
|
-
description: '',
|
|
28
|
-
},
|
|
29
|
-
],
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
export default data
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import {ReferenceEntityTemplateSchema} from '@shopify/generate-docs'
|
|
2
|
-
|
|
3
|
-
const data: ReferenceEntityTemplateSchema = {
|
|
4
|
-
name: 'useRecommendedShops',
|
|
5
|
-
category: 'hooks',
|
|
6
|
-
subCategory: 'shop',
|
|
7
|
-
isVisualComponent: false,
|
|
8
|
-
related: [],
|
|
9
|
-
description:
|
|
10
|
-
'The `useRecommendedShops` hook enables fetching a list of recommended shops for the user. The list may be empty if the user has no recommended shops.',
|
|
11
|
-
type: 'hook',
|
|
12
|
-
defaultExample: {
|
|
13
|
-
codeblock: {
|
|
14
|
-
tabs: [
|
|
15
|
-
{
|
|
16
|
-
code: './useRecommendedShops.example.tsx',
|
|
17
|
-
language: 'tsx',
|
|
18
|
-
},
|
|
19
|
-
],
|
|
20
|
-
title: 'Example code',
|
|
21
|
-
},
|
|
22
|
-
},
|
|
23
|
-
definitions: [
|
|
24
|
-
{
|
|
25
|
-
title: '',
|
|
26
|
-
type: 'UseRecommendedShopsGeneratedType',
|
|
27
|
-
description: '',
|
|
28
|
-
},
|
|
29
|
-
],
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
export default data
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import {ReferenceEntityTemplateSchema} from '@shopify/generate-docs'
|
|
2
|
-
|
|
3
|
-
const data: ReferenceEntityTemplateSchema = {
|
|
4
|
-
name: 'useShop',
|
|
5
|
-
category: 'hooks',
|
|
6
|
-
subCategory: 'shop',
|
|
7
|
-
isVisualComponent: false,
|
|
8
|
-
related: [],
|
|
9
|
-
description: 'The `useShop` hook enables fetching a shop by its ID.',
|
|
10
|
-
type: 'hook',
|
|
11
|
-
defaultExample: {
|
|
12
|
-
codeblock: {
|
|
13
|
-
tabs: [
|
|
14
|
-
{
|
|
15
|
-
code: './useShop.example.tsx',
|
|
16
|
-
language: 'tsx',
|
|
17
|
-
},
|
|
18
|
-
],
|
|
19
|
-
title: 'Example code',
|
|
20
|
-
},
|
|
21
|
-
},
|
|
22
|
-
definitions: [
|
|
23
|
-
{
|
|
24
|
-
title: '',
|
|
25
|
-
type: 'UseShopGeneratedType',
|
|
26
|
-
description: '',
|
|
27
|
-
},
|
|
28
|
-
],
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
export default data
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import {ReferenceEntityTemplateSchema} from '@shopify/generate-docs'
|
|
2
|
-
|
|
3
|
-
const data: ReferenceEntityTemplateSchema = {
|
|
4
|
-
name: 'useShopCartActions',
|
|
5
|
-
category: 'hooks',
|
|
6
|
-
subCategory: 'shop',
|
|
7
|
-
isVisualComponent: false,
|
|
8
|
-
related: [],
|
|
9
|
-
description:
|
|
10
|
-
'The `useShopCartActions` hook provides functions for managing the shopping cart. It includes operations for adding products to the cart and buying products directly.',
|
|
11
|
-
type: 'hook',
|
|
12
|
-
defaultExample: {
|
|
13
|
-
codeblock: {
|
|
14
|
-
tabs: [
|
|
15
|
-
{
|
|
16
|
-
code: './useShopCartActions.example.tsx',
|
|
17
|
-
language: 'tsx',
|
|
18
|
-
},
|
|
19
|
-
],
|
|
20
|
-
title: 'Example code',
|
|
21
|
-
},
|
|
22
|
-
},
|
|
23
|
-
definitions: [
|
|
24
|
-
{
|
|
25
|
-
title: '',
|
|
26
|
-
type: 'UseShopCartActionsGeneratedType',
|
|
27
|
-
description: '',
|
|
28
|
-
},
|
|
29
|
-
],
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
export default data
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import {Button, useShopCartActions} from '@shopify/shop-minis-react'
|
|
2
|
-
|
|
3
|
-
export default function MyComponent() {
|
|
4
|
-
const {addToCart, buyProduct} = useShopCartActions()
|
|
5
|
-
|
|
6
|
-
const handleAddToCart = async () => {
|
|
7
|
-
await addToCart({
|
|
8
|
-
productId: 'gid://shopify/Product/123',
|
|
9
|
-
productVariantId: 'gid://shopify/ProductVariant/456',
|
|
10
|
-
quantity: 1,
|
|
11
|
-
})
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
const handleBuyNow = async () => {
|
|
15
|
-
await buyProduct({
|
|
16
|
-
productId: 'gid://shopify/Product/123',
|
|
17
|
-
productVariantId: 'gid://shopify/ProductVariant/456',
|
|
18
|
-
quantity: 1,
|
|
19
|
-
})
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
return (
|
|
23
|
-
<>
|
|
24
|
-
<Button onClick={handleAddToCart}>Add to cart</Button>
|
|
25
|
-
<Button onClick={handleBuyNow}>Buy now</Button>
|
|
26
|
-
</>
|
|
27
|
-
)
|
|
28
|
-
}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import {ReferenceEntityTemplateSchema} from '@shopify/generate-docs'
|
|
2
|
-
|
|
3
|
-
const data: ReferenceEntityTemplateSchema = {
|
|
4
|
-
name: 'useAsyncStorage',
|
|
5
|
-
category: 'hooks',
|
|
6
|
-
subCategory: 'storage',
|
|
7
|
-
isVisualComponent: false,
|
|
8
|
-
related: [],
|
|
9
|
-
description:
|
|
10
|
-
'The `useAsyncStorage` hook provides functions to interact with persistent storage. It allows you to store, retrieve, and manage data that persists between app sessions.',
|
|
11
|
-
type: 'hook',
|
|
12
|
-
defaultExample: {
|
|
13
|
-
codeblock: {
|
|
14
|
-
tabs: [
|
|
15
|
-
{
|
|
16
|
-
code: './useAsyncStorage.example.tsx',
|
|
17
|
-
language: 'tsx',
|
|
18
|
-
},
|
|
19
|
-
],
|
|
20
|
-
title: 'Example code',
|
|
21
|
-
},
|
|
22
|
-
},
|
|
23
|
-
definitions: [
|
|
24
|
-
{
|
|
25
|
-
title: '',
|
|
26
|
-
type: 'UseAsyncStorageGeneratedType',
|
|
27
|
-
description: '',
|
|
28
|
-
},
|
|
29
|
-
],
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
export default data
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import {useEffect} from 'react'
|
|
2
|
-
|
|
3
|
-
import {useAsyncStorage} from '@shopify/shop-minis-react'
|
|
4
|
-
|
|
5
|
-
export default function MyComponent() {
|
|
6
|
-
const {getItem, setItem, removeItem, getAllKeys, clear} = useAsyncStorage()
|
|
7
|
-
|
|
8
|
-
useEffect(() => {
|
|
9
|
-
async function handleStorageOperations() {
|
|
10
|
-
// Get an item from storage
|
|
11
|
-
const value = await getItem({key: 'myKey'})
|
|
12
|
-
console.log({value})
|
|
13
|
-
|
|
14
|
-
// Set an item in storage
|
|
15
|
-
await setItem({key: 'myKey', value: 'Hello, World!'})
|
|
16
|
-
|
|
17
|
-
// Remove an item from storage
|
|
18
|
-
await removeItem({key: 'myKey'})
|
|
19
|
-
|
|
20
|
-
// Get all keys in storage
|
|
21
|
-
const keys = await getAllKeys()
|
|
22
|
-
console.log({keys})
|
|
23
|
-
|
|
24
|
-
// Clear all items from storage
|
|
25
|
-
await clear()
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
handleStorageOperations()
|
|
29
|
-
}, [getItem, removeItem, setItem, getAllKeys, clear])
|
|
30
|
-
}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import {ReferenceEntityTemplateSchema} from '@shopify/generate-docs'
|
|
2
|
-
|
|
3
|
-
const data: ReferenceEntityTemplateSchema = {
|
|
4
|
-
name: 'useImageUpload',
|
|
5
|
-
category: 'hooks',
|
|
6
|
-
subCategory: 'storage',
|
|
7
|
-
isVisualComponent: false,
|
|
8
|
-
related: [],
|
|
9
|
-
description:
|
|
10
|
-
'The `useImageUpload` hook provides functionality for uploading images attached to the current user. It handles the upload process, including getting upload links, uploading to storage, and polling for completion.',
|
|
11
|
-
type: 'hook',
|
|
12
|
-
defaultExample: {
|
|
13
|
-
codeblock: {
|
|
14
|
-
tabs: [
|
|
15
|
-
{
|
|
16
|
-
code: './useImageUpload.example.tsx',
|
|
17
|
-
language: 'tsx',
|
|
18
|
-
},
|
|
19
|
-
],
|
|
20
|
-
title: 'Example code',
|
|
21
|
-
},
|
|
22
|
-
},
|
|
23
|
-
definitions: [
|
|
24
|
-
{
|
|
25
|
-
title: '',
|
|
26
|
-
type: 'UseImageUploadGeneratedType',
|
|
27
|
-
description: '',
|
|
28
|
-
},
|
|
29
|
-
],
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
export default data
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import {useCallback} from 'react'
|
|
2
|
-
|
|
3
|
-
import {useImageUpload, Button} from '@shopify/shop-minis-react'
|
|
4
|
-
|
|
5
|
-
export default function MyComponent() {
|
|
6
|
-
const {uploadImage} = useImageUpload()
|
|
7
|
-
|
|
8
|
-
const handleUpload = useCallback(async () => {
|
|
9
|
-
const result = await uploadImage([
|
|
10
|
-
{
|
|
11
|
-
mimeType: 'image/jpeg',
|
|
12
|
-
fileSize: 1024 * 1024, // 1MB
|
|
13
|
-
uri: 'file://path/to/image.jpg',
|
|
14
|
-
},
|
|
15
|
-
])
|
|
16
|
-
console.log('Uploaded image:', result[0])
|
|
17
|
-
}, [uploadImage])
|
|
18
|
-
|
|
19
|
-
return <Button onClick={handleUpload}>Upload image</Button>
|
|
20
|
-
}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import {ReferenceEntityTemplateSchema} from '@shopify/generate-docs'
|
|
2
|
-
|
|
3
|
-
const data: ReferenceEntityTemplateSchema = {
|
|
4
|
-
name: 'useSecureStorage',
|
|
5
|
-
category: 'hooks',
|
|
6
|
-
subCategory: 'storage',
|
|
7
|
-
isVisualComponent: false,
|
|
8
|
-
related: [],
|
|
9
|
-
description:
|
|
10
|
-
'The `useSecureStorage` hook provides functions to interact with secure storage. It allows you to store, retrieve, and manage sensitive data that requires encryption and secure handling. You can currently only set one secret per Mini.',
|
|
11
|
-
type: 'hook',
|
|
12
|
-
defaultExample: {
|
|
13
|
-
codeblock: {
|
|
14
|
-
tabs: [
|
|
15
|
-
{
|
|
16
|
-
code: './useSecureStorage.example.tsx',
|
|
17
|
-
language: 'tsx',
|
|
18
|
-
},
|
|
19
|
-
],
|
|
20
|
-
title: 'Example code',
|
|
21
|
-
},
|
|
22
|
-
},
|
|
23
|
-
definitions: [
|
|
24
|
-
{
|
|
25
|
-
title: '',
|
|
26
|
-
type: 'UseSecureStorageGeneratedType',
|
|
27
|
-
description: '',
|
|
28
|
-
},
|
|
29
|
-
],
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
export default data
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import {useEffect} from 'react'
|
|
2
|
-
|
|
3
|
-
import {useSecureStorage} from '@shopify/shop-minis-react'
|
|
4
|
-
|
|
5
|
-
export default function MyComponent() {
|
|
6
|
-
const {getSecret, setSecret, removeSecret} = useSecureStorage()
|
|
7
|
-
|
|
8
|
-
useEffect(() => {
|
|
9
|
-
async function handleSecureStorageOperations() {
|
|
10
|
-
// Get a secret from secure storage
|
|
11
|
-
const secret = await getSecret()
|
|
12
|
-
console.log({secret})
|
|
13
|
-
|
|
14
|
-
// Set a secret in secure storage
|
|
15
|
-
await setSecret({value: 'Sensitive Data'})
|
|
16
|
-
|
|
17
|
-
// Remove a secret from secure storage
|
|
18
|
-
await removeSecret()
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
handleSecureStorageOperations()
|
|
22
|
-
}, [getSecret, setSecret, removeSecret])
|
|
23
|
-
}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import {ReferenceEntityTemplateSchema} from '@shopify/generate-docs'
|
|
2
|
-
|
|
3
|
-
const data: ReferenceEntityTemplateSchema = {
|
|
4
|
-
name: 'useBuyerAttributes',
|
|
5
|
-
category: 'hooks',
|
|
6
|
-
subCategory: 'user',
|
|
7
|
-
isVisualComponent: false,
|
|
8
|
-
related: [],
|
|
9
|
-
description:
|
|
10
|
-
'The `useBuyerAttributes` hook fetches the current buyer attributes, such as gender affinity and category affinities.',
|
|
11
|
-
type: 'hook',
|
|
12
|
-
defaultExample: {
|
|
13
|
-
codeblock: {
|
|
14
|
-
tabs: [
|
|
15
|
-
{
|
|
16
|
-
code: './useBuyerAttributes.example.tsx',
|
|
17
|
-
language: 'tsx',
|
|
18
|
-
},
|
|
19
|
-
],
|
|
20
|
-
title: 'Example code',
|
|
21
|
-
},
|
|
22
|
-
},
|
|
23
|
-
definitions: [
|
|
24
|
-
{
|
|
25
|
-
title: 'Props',
|
|
26
|
-
type: 'UseBuyerAttributesGeneratedType',
|
|
27
|
-
description: '',
|
|
28
|
-
},
|
|
29
|
-
],
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
export default data
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import {useEffect} from 'react'
|
|
2
|
-
|
|
3
|
-
import {useBuyerAttributes} from '@shopify/shop-minis-react'
|
|
4
|
-
|
|
5
|
-
export default function MyComponent() {
|
|
6
|
-
const {buyerAttributes} = useBuyerAttributes()
|
|
7
|
-
|
|
8
|
-
useEffect(() => {
|
|
9
|
-
if (buyerAttributes) {
|
|
10
|
-
const {genderAffinity, categoryAffinities} = buyerAttributes
|
|
11
|
-
console.log({genderAffinity, categoryAffinities})
|
|
12
|
-
}
|
|
13
|
-
}, [buyerAttributes])
|
|
14
|
-
}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import {ReferenceEntityTemplateSchema} from '@shopify/generate-docs'
|
|
2
|
-
|
|
3
|
-
const data: ReferenceEntityTemplateSchema = {
|
|
4
|
-
name: 'useCurrentUser',
|
|
5
|
-
category: 'hooks',
|
|
6
|
-
subCategory: 'user',
|
|
7
|
-
isVisualComponent: false,
|
|
8
|
-
related: [],
|
|
9
|
-
description: 'The `useCurrentUser` hook fetches the current user.',
|
|
10
|
-
type: 'hook',
|
|
11
|
-
defaultExample: {
|
|
12
|
-
codeblock: {
|
|
13
|
-
tabs: [
|
|
14
|
-
{
|
|
15
|
-
code: './useCurrentUser.example.tsx',
|
|
16
|
-
language: 'tsx',
|
|
17
|
-
},
|
|
18
|
-
],
|
|
19
|
-
title: 'Example code',
|
|
20
|
-
},
|
|
21
|
-
},
|
|
22
|
-
definitions: [
|
|
23
|
-
{
|
|
24
|
-
title: '',
|
|
25
|
-
type: 'UseCurrentUserGeneratedType',
|
|
26
|
-
description: '',
|
|
27
|
-
},
|
|
28
|
-
],
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
export default data
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import {ReferenceEntityTemplateSchema} from '@shopify/generate-docs'
|
|
2
|
-
|
|
3
|
-
const data: ReferenceEntityTemplateSchema = {
|
|
4
|
-
name: 'useFollowedShopsActions',
|
|
5
|
-
category: 'hooks',
|
|
6
|
-
subCategory: 'user',
|
|
7
|
-
isVisualComponent: false,
|
|
8
|
-
related: [],
|
|
9
|
-
description:
|
|
10
|
-
'The `useFollowedShopsActions` hook allows following and unfollowing shops for the current user.',
|
|
11
|
-
type: 'hook',
|
|
12
|
-
defaultExample: {
|
|
13
|
-
codeblock: {
|
|
14
|
-
tabs: [
|
|
15
|
-
{
|
|
16
|
-
code: './useFollowedShopsActions.example.tsx',
|
|
17
|
-
language: 'tsx',
|
|
18
|
-
},
|
|
19
|
-
],
|
|
20
|
-
title: 'Example code',
|
|
21
|
-
},
|
|
22
|
-
},
|
|
23
|
-
definitions: [
|
|
24
|
-
{
|
|
25
|
-
title: '',
|
|
26
|
-
type: 'UseUpdateFollowedShopsGeneratedType',
|
|
27
|
-
description: '',
|
|
28
|
-
},
|
|
29
|
-
],
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
export default data
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import {useFollowedShopsActions, Button} from '@shopify/shop-minis-react'
|
|
2
|
-
|
|
3
|
-
export default function MyComponent() {
|
|
4
|
-
const {followShop, unfollowShop} = useFollowedShopsActions()
|
|
5
|
-
|
|
6
|
-
return (
|
|
7
|
-
<>
|
|
8
|
-
<Button onClick={() => followShop({shopId: 'gid://shopify/Shop/123'})}>
|
|
9
|
-
Follow shop
|
|
10
|
-
</Button>
|
|
11
|
-
<Button onClick={() => unfollowShop({shopId: 'gid://shopify/Shop/123'})}>
|
|
12
|
-
Unfollow shop
|
|
13
|
-
</Button>
|
|
14
|
-
</>
|
|
15
|
-
)
|
|
16
|
-
}
|