@shopify/shop-minis-cli 0.0.131 → 0.0.132
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
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import {SurveySingleResponse} from '@shopify/shop-minis-ui-extensions'
|
|
2
|
+
|
|
3
|
+
import type {__QUERY_NAME__QueryData} from './input.graphql'
|
|
4
|
+
import seedData from './seed'
|
|
5
|
+
|
|
6
|
+
export function Render({
|
|
7
|
+
extensionData,
|
|
8
|
+
}: {
|
|
9
|
+
extensionData: __QUERY_NAME__QueryData | null
|
|
10
|
+
}) {
|
|
11
|
+
// Here we are using seed data to populate the initial state of the survey.
|
|
12
|
+
// You can replace this with the actual data from `extensionData`
|
|
13
|
+
__EXAMPLE_QUERY_DATA_USE__
|
|
14
|
+
|
|
15
|
+
return (
|
|
16
|
+
<SurveySingleResponse
|
|
17
|
+
choices={seedData}
|
|
18
|
+
onChoiceSelected={(index, value) =>
|
|
19
|
+
console.log('Selected:', index, value)
|
|
20
|
+
}
|
|
21
|
+
title="How did you find our store?"
|
|
22
|
+
seeMoreChoice={{label: 'Other', value: 'seeMore'}}
|
|
23
|
+
singleQuestionSurvey={false}
|
|
24
|
+
/>
|
|
25
|
+
)
|
|
26
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
const MINIS_TEST_STORE_DATA = {
|
|
2
|
+
id: 'gid://shopify/Shop/62104633599',
|
|
3
|
+
image: null,
|
|
4
|
+
name: 'Shop Minis Test Store',
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
const data = [
|
|
8
|
+
{label: 'Google', value: 'google'},
|
|
9
|
+
{label: 'Facebook', value: 'facebook'},
|
|
10
|
+
{label: 'Pinterest', value: 'pinterest'},
|
|
11
|
+
{label: 'Instagram', value: 'instagram'},
|
|
12
|
+
{label: 'Snapchat', value: 'snapchat'},
|
|
13
|
+
{label: 'TikTok', value: 'tikTok'},
|
|
14
|
+
{label: 'From a friend, family member or coworker', value: 'friends'},
|
|
15
|
+
{label: 'In a retail store', value: 'store'},
|
|
16
|
+
{label: 'Podcast/Radio', value: 'podcast'},
|
|
17
|
+
{label: 'Press or other article', value: 'press'},
|
|
18
|
+
{label: 'Youtube', value: 'youtube'},
|
|
19
|
+
{label: 'Other', value: 'other'},
|
|
20
|
+
]
|
|
21
|
+
|
|
22
|
+
export default data
|