@shopify/shop-minis-cli 0.0.110 → 0.0.111
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/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {useState} from 'react'
|
|
2
1
|
import {BundleCollection} from '@shopify/shop-minis-ui-extensions'
|
|
2
|
+
import {useExtensionShopActions} from '@shopify/shop-minis-platform-sdk/actions'
|
|
3
3
|
|
|
4
4
|
import type {__QUERY_NAME__QueryData} from './input.graphql'
|
|
5
5
|
import seedData from './seed'
|
|
@@ -9,10 +9,21 @@ export function Render({
|
|
|
9
9
|
}: {
|
|
10
10
|
extensionData: __QUERY_NAME__QueryData | null
|
|
11
11
|
}) {
|
|
12
|
+
const {openMiniViewer} = useExtensionShopActions()
|
|
13
|
+
|
|
12
14
|
// Here we are using seed data to populate the initial state of the bundle selector.
|
|
13
15
|
// You can replace this with the actual data from `extensionData`
|
|
14
16
|
__EXAMPLE_QUERY_DATA_USE__
|
|
15
17
|
const {bundles: initialBundles, title} = seedData
|
|
18
|
+
|
|
19
|
+
const bundles = initialBundles.map(initialBundle => {
|
|
20
|
+
return {
|
|
21
|
+
...initialBundle,
|
|
22
|
+
onActionButtonPress: () => {
|
|
23
|
+
openMiniViewer(initialBundle)
|
|
24
|
+
},
|
|
25
|
+
}
|
|
26
|
+
})
|
|
16
27
|
const [bundles, setBundles] = useState(initialBundles)
|
|
17
28
|
|
|
18
29
|
if (!bundles) return null
|