@shopify/shop-minis-cli 0.0.69 → 0.0.70
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
|
@@ -21,6 +21,7 @@ import {MultipleChoiceScreen} from './screens/MultipleChoiceScreen'
|
|
|
21
21
|
import {QuizScreen} from './screens/QuizScreen'
|
|
22
22
|
import {ImageMultipleChoiceScreen} from './screens/ImageMultipleChoiceScreen'
|
|
23
23
|
import {AccordionScreen} from './screens/AccordionScreen'
|
|
24
|
+
import {ShopActionsScreen} from './screens/ShopActionsScreen'
|
|
24
25
|
|
|
25
26
|
const Stack = createNativeStackNavigator()
|
|
26
27
|
|
|
@@ -132,6 +133,11 @@ export const __MINI_APP_HANDLE_PASCAL_CASE__Navigator = () => {
|
|
|
132
133
|
component={AccordionScreen}
|
|
133
134
|
options={{headerShown: false}}
|
|
134
135
|
/>
|
|
136
|
+
<Stack.Screen
|
|
137
|
+
name="__MINI_APP_HANDLE_PASCAL_CASE__.ShopActions"
|
|
138
|
+
component={ShopActionsScreen}
|
|
139
|
+
options={{headerShown: false}}
|
|
140
|
+
/>
|
|
135
141
|
</Stack.Navigator>
|
|
136
142
|
)
|
|
137
143
|
}
|
|
@@ -64,6 +64,17 @@ export const HomeScreen = () => {
|
|
|
64
64
|
))}
|
|
65
65
|
</Box>
|
|
66
66
|
</Box>
|
|
67
|
+
<Box flex={1} p="gutter" backgroundColor="backgrounds-regular">
|
|
68
|
+
<Text variant="label" mb="s" mt="l">
|
|
69
|
+
Hooks
|
|
70
|
+
</Text>
|
|
71
|
+
<Box flexDirection="column">
|
|
72
|
+
<ComponentListItem
|
|
73
|
+
name="Shop actions"
|
|
74
|
+
screen="__MINI_APP_HANDLE_PASCAL_CASE__.ShopActions"
|
|
75
|
+
/>
|
|
76
|
+
</Box>
|
|
77
|
+
</Box>
|
|
67
78
|
</ScrollView>
|
|
68
79
|
</SafeAreaView>
|
|
69
80
|
)
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import {useState} from 'react'
|
|
2
|
+
import {SafeAreaView, ScrollView} from 'react-native'
|
|
3
|
+
import {
|
|
4
|
+
Box,
|
|
5
|
+
Button,
|
|
6
|
+
KeyboardAvoidingView,
|
|
7
|
+
Text,
|
|
8
|
+
TextField,
|
|
9
|
+
} from '@shopify/shop-minis-platform-sdk'
|
|
10
|
+
import {useShopActions} from '@shopify/shop-minis-platform-sdk/actions'
|
|
11
|
+
|
|
12
|
+
import {Header} from '../components/Header'
|
|
13
|
+
|
|
14
|
+
export const ShopActionsScreen = () => {
|
|
15
|
+
const [navigateToCheckoutUrl, setNavigateToCheckoutUrl] = useState('')
|
|
16
|
+
const {navigateToCheckout} = useShopActions()
|
|
17
|
+
|
|
18
|
+
return (
|
|
19
|
+
<SafeAreaView style={{flex: 1}}>
|
|
20
|
+
<KeyboardAvoidingView>
|
|
21
|
+
<ScrollView style={{flex: 1}}>
|
|
22
|
+
<Header />
|
|
23
|
+
<Box px="gutter">
|
|
24
|
+
<Text variant="headerBold" mb="xs">
|
|
25
|
+
Shop Actions
|
|
26
|
+
</Text>
|
|
27
|
+
<Box marginBottom="m">
|
|
28
|
+
<Box marginBottom="xs">
|
|
29
|
+
<Text variant="bodyLargeBold">Checkout with URL</Text>
|
|
30
|
+
</Box>
|
|
31
|
+
<Box marginBottom="xs">
|
|
32
|
+
<TextField
|
|
33
|
+
placeholder="URL"
|
|
34
|
+
value={navigateToCheckoutUrl}
|
|
35
|
+
onChangeText={text => setNavigateToCheckoutUrl(text)}
|
|
36
|
+
/>
|
|
37
|
+
</Box>
|
|
38
|
+
<Button
|
|
39
|
+
text="Go to checkout"
|
|
40
|
+
onPress={() => navigateToCheckout({url: navigateToCheckoutUrl})}
|
|
41
|
+
/>
|
|
42
|
+
</Box>
|
|
43
|
+
</Box>
|
|
44
|
+
</ScrollView>
|
|
45
|
+
</KeyboardAvoidingView>
|
|
46
|
+
</SafeAreaView>
|
|
47
|
+
)
|
|
48
|
+
}
|