@shopify/shop-minis-cli 0.0.35
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/README.md +8 -0
- package/build/commands/create-mini/index.d.ts +2 -0
- package/build/commands/create-mini/index.js +116 -0
- package/build/commands/create-mini/index.js.map +1 -0
- package/build/commands/create-mini/utils/template-app.d.ts +1 -0
- package/build/commands/create-mini/utils/template-app.js +44 -0
- package/build/commands/create-mini/utils/template-app.js.map +1 -0
- package/build/commands/dev/index.d.ts +6 -0
- package/build/commands/dev/index.js +31 -0
- package/build/commands/dev/index.js.map +1 -0
- package/build/commands/dev/utils/android.d.ts +16 -0
- package/build/commands/dev/utils/android.js +165 -0
- package/build/commands/dev/utils/android.js.map +1 -0
- package/build/commands/dev/utils/binaries.d.ts +83 -0
- package/build/commands/dev/utils/binaries.js +173 -0
- package/build/commands/dev/utils/binaries.js.map +1 -0
- package/build/commands/dev/utils/binaries.test.d.ts +1 -0
- package/build/commands/dev/utils/binaries.test.js +275 -0
- package/build/commands/dev/utils/binaries.test.js.map +1 -0
- package/build/commands/dev/utils/deeplink.d.ts +3 -0
- package/build/commands/dev/utils/deeplink.js +30 -0
- package/build/commands/dev/utils/deeplink.js.map +1 -0
- package/build/commands/dev/utils/interactive-terminal.d.ts +23 -0
- package/build/commands/dev/utils/interactive-terminal.js +252 -0
- package/build/commands/dev/utils/interactive-terminal.js.map +1 -0
- package/build/commands/dev/utils/metro/metro-config.d.ts +2 -0
- package/build/commands/dev/utils/metro/metro-config.js +31 -0
- package/build/commands/dev/utils/metro/metro-config.js.map +1 -0
- package/build/commands/dev/utils/metro/metro-reporter.d.ts +14 -0
- package/build/commands/dev/utils/metro/metro-reporter.js +34 -0
- package/build/commands/dev/utils/metro/metro-reporter.js.map +1 -0
- package/build/commands/dev/utils/metro/metro-server-middleware.d.ts +6 -0
- package/build/commands/dev/utils/metro/metro-server-middleware.js +45 -0
- package/build/commands/dev/utils/metro/metro-server-middleware.js.map +1 -0
- package/build/commands/dev/utils/metro/metro-server.d.ts +2 -0
- package/build/commands/dev/utils/metro/metro-server.js +24 -0
- package/build/commands/dev/utils/metro/metro-server.js.map +1 -0
- package/build/commands/dev/utils/minis-manifest.d.ts +1 -0
- package/build/commands/dev/utils/minis-manifest.js +24 -0
- package/build/commands/dev/utils/minis-manifest.js.map +1 -0
- package/build/commands/dev/utils/qr-code.d.ts +1 -0
- package/build/commands/dev/utils/qr-code.js +12 -0
- package/build/commands/dev/utils/qr-code.js.map +1 -0
- package/build/commands/dev/utils/simulator.d.ts +19 -0
- package/build/commands/dev/utils/simulator.js +89 -0
- package/build/commands/dev/utils/simulator.js.map +1 -0
- package/build/commands/dev/utils/with-retries.d.ts +4 -0
- package/build/commands/dev/utils/with-retries.js +28 -0
- package/build/commands/dev/utils/with-retries.js.map +1 -0
- package/build/commands/generate-graphql-types/index.d.ts +5 -0
- package/build/commands/generate-graphql-types/index.js +90 -0
- package/build/commands/generate-graphql-types/index.js.map +1 -0
- package/build/commands/utils/exec-async-child-process.d.ts +18 -0
- package/build/commands/utils/exec-async-child-process.js +48 -0
- package/build/commands/utils/exec-async-child-process.js.map +1 -0
- package/build/commands/utils/wrap-with-loading-indicator.d.ts +9 -0
- package/build/commands/utils/wrap-with-loading-indicator.js +23 -0
- package/build/commands/utils/wrap-with-loading-indicator.js.map +1 -0
- package/build/dev-panel/images/bottomsheet.png +0 -0
- package/build/dev-panel/images/checkmark.svg +3 -0
- package/build/dev-panel/images/chevron.svg +3 -0
- package/build/dev-panel/images/copy.svg +4 -0
- package/build/dev-panel/images/get-started.svg +3 -0
- package/build/dev-panel/images/how-to.svg +3 -0
- package/build/dev-panel/images/navigation.png +0 -0
- package/build/dev-panel/images/references.svg +3 -0
- package/build/dev-panel/images/shop-minis-logo-inverse.svg +5 -0
- package/build/dev-panel/images/shop-minis-logo.svg +5 -0
- package/build/dev-panel/images/stories.png +0 -0
- package/build/dev-panel/images/topics.svg +3 -0
- package/build/dev-panel/index.html +302 -0
- package/build/dev-panel/middleware.d.ts +4 -0
- package/build/dev-panel/middleware.js +11 -0
- package/build/dev-panel/middleware.js.map +1 -0
- package/build/dev-panel/middleware.ts +6 -0
- package/build/dev-panel/styles.css +507 -0
- package/build/index.d.ts +2 -0
- package/build/index.js +26 -0
- package/build/index.js.map +1 -0
- package/package.json +83 -0
- package/templates/__template_blank/src/custom.d.ts +4 -0
- package/templates/__template_blank/src/index.tsx +9 -0
- package/templates/__template_blank/src/screens/HomeScreen.tsx +12 -0
- package/templates/__template_blank/src/types.ts +5 -0
- package/templates/__template_common/.eslintignore +1 -0
- package/templates/__template_common/.eslintrc.json +132 -0
- package/templates/__template_common/.prettierrc.json +8 -0
- package/templates/__template_common/babel.config.js +19 -0
- package/templates/__template_common/gitignore +3 -0
- package/templates/__template_common/index.tsx +43 -0
- package/templates/__template_common/metro.config.js +31 -0
- package/templates/__template_common/package.json +68 -0
- package/templates/__template_common/patches/react-native+0.68.5.patch +173 -0
- package/templates/__template_common/src/manifest.json +29 -0
- package/templates/__template_common/tsconfig.json +36 -0
- package/templates/__template_hello_world/src/assets/Modal-component-thumbnail.png +0 -0
- package/templates/__template_hello_world/src/assets/ProductCard-component-thumbnail.png +0 -0
- package/templates/__template_hello_world/src/assets/ProductLink-component-thumbnail.png +0 -0
- package/templates/__template_hello_world/src/assets/assets.d.ts +4 -0
- package/templates/__template_hello_world/src/assets/figma-logo.svg +14 -0
- package/templates/__template_hello_world/src/assets/shop-minis-logo.svg +7 -0
- package/templates/__template_hello_world/src/components/ButtonCTA.tsx +31 -0
- package/templates/__template_hello_world/src/components/ComponentLink.ts +70 -0
- package/templates/__template_hello_world/src/components/ComponentListItem.tsx +38 -0
- package/templates/__template_hello_world/src/components/FeaturedComponents.tsx +108 -0
- package/templates/__template_hello_world/src/components/Header.tsx +40 -0
- package/templates/__template_hello_world/src/data/Test.graphql +33 -0
- package/templates/__template_hello_world/src/data/Test.graphql.d.ts +114 -0
- package/templates/__template_hello_world/src/data/TestProducts.graphql +34 -0
- package/templates/__template_hello_world/src/data/TestProducts.graphql.d.ts +119 -0
- package/templates/__template_hello_world/src/index.tsx +9 -0
- package/templates/__template_hello_world/src/routes.tsx +107 -0
- package/templates/__template_hello_world/src/screens/AvatarScreen.tsx +95 -0
- package/templates/__template_hello_world/src/screens/BottomSheetScreen.tsx +711 -0
- package/templates/__template_hello_world/src/screens/ButtonsScreen.tsx +90 -0
- package/templates/__template_hello_world/src/screens/GridScreen.tsx +74 -0
- package/templates/__template_hello_world/src/screens/HomeScreen.tsx +70 -0
- package/templates/__template_hello_world/src/screens/IconsScreen.tsx +181 -0
- package/templates/__template_hello_world/src/screens/MediaScreen.tsx +130 -0
- package/templates/__template_hello_world/src/screens/ModalScreen.tsx +379 -0
- package/templates/__template_hello_world/src/screens/ProductCardGridScreen.tsx +68 -0
- package/templates/__template_hello_world/src/screens/ProductCardScreen.tsx +62 -0
- package/templates/__template_hello_world/src/screens/ProductLinkScreen.tsx +215 -0
- package/templates/__template_hello_world/src/screens/ProgressIndicatorScreen.tsx +77 -0
- package/templates/__template_hello_world/src/screens/QuantityPickerScreen.tsx +76 -0
- package/templates/__template_hello_world/src/screens/SpinnerScreen.tsx +63 -0
- package/templates/__template_hello_world/src/screens/TypographyScreen.tsx +274 -0
- package/templates/__template_hello_world/src/screens/WebViewScreen.tsx +42 -0
- package/templates/__template_hello_world/src/types.ts +25 -0
- package/templates/__template_snowboardz/src/assets/assets.d.ts +4 -0
- package/templates/__template_snowboardz/src/assets/circle-blue.svg +9 -0
- package/templates/__template_snowboardz/src/assets/circle-green.svg +9 -0
- package/templates/__template_snowboardz/src/assets/circle-purple.svg +9 -0
- package/templates/__template_snowboardz/src/assets/circle-rainbow.svg +34 -0
- package/templates/__template_snowboardz/src/assets/circle-red.svg +9 -0
- package/templates/__template_snowboardz/src/assets/circle-yellow.svg +9 -0
- package/templates/__template_snowboardz/src/assets/skill-level-icon-advanced.svg +3 -0
- package/templates/__template_snowboardz/src/assets/skill-level-icon-beginner.svg +3 -0
- package/templates/__template_snowboardz/src/assets/skill-level-icon-intermediate.svg +3 -0
- package/templates/__template_snowboardz/src/components/ColorButton.tsx +79 -0
- package/templates/__template_snowboardz/src/components/ColorPicker.tsx +40 -0
- package/templates/__template_snowboardz/src/components/EmptyResult.tsx +52 -0
- package/templates/__template_snowboardz/src/components/SkillLevelIcon.tsx +44 -0
- package/templates/__template_snowboardz/src/components/SkillLevelPicker.tsx +86 -0
- package/templates/__template_snowboardz/src/data/TestProducts.graphql +34 -0
- package/templates/__template_snowboardz/src/data/TestProducts.graphql.d.ts +108 -0
- package/templates/__template_snowboardz/src/hooks/useSnowboardData.tsx +37 -0
- package/templates/__template_snowboardz/src/index.tsx +9 -0
- package/templates/__template_snowboardz/src/routes.tsx +17 -0
- package/templates/__template_snowboardz/src/screens/HomeScreen.tsx +126 -0
- package/templates/__template_snowboardz/src/types.ts +12 -0
- package/templates/__template_snowboardz/src/utils.ts +17 -0
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import {Alert, SafeAreaView, ScrollView} from 'react-native'
|
|
2
|
+
import {
|
|
3
|
+
Button,
|
|
4
|
+
ButtonProps,
|
|
5
|
+
Box,
|
|
6
|
+
FastImageBox,
|
|
7
|
+
Text,
|
|
8
|
+
useTheme,
|
|
9
|
+
} from '@shopify/shop-minis-platform-sdk'
|
|
10
|
+
|
|
11
|
+
import {Header} from '../components/Header'
|
|
12
|
+
|
|
13
|
+
export const ButtonsScreen = () => {
|
|
14
|
+
const theme = useTheme()
|
|
15
|
+
return (
|
|
16
|
+
<SafeAreaView
|
|
17
|
+
style={{backgroundColor: theme.colors['backgrounds-regular']}}
|
|
18
|
+
>
|
|
19
|
+
<ScrollView
|
|
20
|
+
style={{backgroundColor: theme.colors['backgrounds-regular']}}
|
|
21
|
+
>
|
|
22
|
+
<Header />
|
|
23
|
+
<Box px="gutter">
|
|
24
|
+
<Text variant="headerBold" mb="xs">
|
|
25
|
+
Button
|
|
26
|
+
</Text>
|
|
27
|
+
<Text variant="bodyTitleLarge" mt="m">
|
|
28
|
+
Sizes
|
|
29
|
+
</Text>
|
|
30
|
+
{(['s', 'm', 'l'] as ButtonProps['size'][]).map(size => (
|
|
31
|
+
<Box key={size} paddingVertical="xs">
|
|
32
|
+
<Button size={size} text={size as string} onPress={() => {}} />
|
|
33
|
+
</Box>
|
|
34
|
+
))}
|
|
35
|
+
<Text variant="bodyTitleLarge" mt="m">
|
|
36
|
+
Variants
|
|
37
|
+
</Text>
|
|
38
|
+
{(
|
|
39
|
+
[
|
|
40
|
+
'primary',
|
|
41
|
+
'secondary',
|
|
42
|
+
'tertiary',
|
|
43
|
+
'outlined',
|
|
44
|
+
'overlay',
|
|
45
|
+
] as ButtonProps['variant'][]
|
|
46
|
+
).map(variant => (
|
|
47
|
+
<Box key={variant as string} paddingVertical="xs">
|
|
48
|
+
<Button
|
|
49
|
+
variant={variant}
|
|
50
|
+
text={variant as string}
|
|
51
|
+
onPress={() => {}}
|
|
52
|
+
/>
|
|
53
|
+
</Box>
|
|
54
|
+
))}
|
|
55
|
+
<Box paddingVertical="xs">
|
|
56
|
+
<FastImageBox
|
|
57
|
+
height={200}
|
|
58
|
+
resizeMode="cover"
|
|
59
|
+
source={{uri: 'https://picsum.photos/id/1080/1000/1500'}}
|
|
60
|
+
borderRadius={16}
|
|
61
|
+
/>
|
|
62
|
+
<Box position="absolute" bottom={20} right={20} width={150}>
|
|
63
|
+
<Box height={100} width={100} />
|
|
64
|
+
<Button variant="overlay" text="overlay" onPress={() => {}} />
|
|
65
|
+
</Box>
|
|
66
|
+
</Box>
|
|
67
|
+
<Text variant="bodyTitleLarge" mt="m">
|
|
68
|
+
States
|
|
69
|
+
</Text>
|
|
70
|
+
<Box paddingVertical="xs">
|
|
71
|
+
<Button
|
|
72
|
+
disabled
|
|
73
|
+
text="inactive"
|
|
74
|
+
onPress={() => Alert.alert('Pressed')}
|
|
75
|
+
/>
|
|
76
|
+
</Box>
|
|
77
|
+
<Text variant="bodyTitleLarge" mt="m">
|
|
78
|
+
Event handling
|
|
79
|
+
</Text>
|
|
80
|
+
<Box paddingVertical="xs">
|
|
81
|
+
<Button
|
|
82
|
+
text="Will alert when pressed"
|
|
83
|
+
onPress={() => Alert.alert('Pressed')}
|
|
84
|
+
/>
|
|
85
|
+
</Box>
|
|
86
|
+
</Box>
|
|
87
|
+
</ScrollView>
|
|
88
|
+
</SafeAreaView>
|
|
89
|
+
)
|
|
90
|
+
}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import {SafeAreaView} from 'react-native'
|
|
2
|
+
import {Grid, Box, Text, useTheme} from '@shopify/shop-minis-platform-sdk'
|
|
3
|
+
|
|
4
|
+
import {Header} from '../components/Header'
|
|
5
|
+
|
|
6
|
+
export type GridRenderItem = (info: any) => React.ReactElement | null
|
|
7
|
+
|
|
8
|
+
export const GridScreen = () => {
|
|
9
|
+
const theme = useTheme()
|
|
10
|
+
const elements = [
|
|
11
|
+
{
|
|
12
|
+
name: 'First',
|
|
13
|
+
color: theme.colors['primary-button-background'],
|
|
14
|
+
id: 1,
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
name: 'Second',
|
|
18
|
+
color: theme.colors['backgrounds-success'],
|
|
19
|
+
id: 2,
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
name: 'Third',
|
|
23
|
+
color: theme.colors['backgrounds-success-subdued'],
|
|
24
|
+
id: 7,
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
name: 'Fourth',
|
|
28
|
+
color: theme.colors['primary-button-background'],
|
|
29
|
+
id: 5,
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
name: 'Fifth',
|
|
33
|
+
color: theme.colors['inactive-button-foreground'],
|
|
34
|
+
id: 4,
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
name: 'Fourth',
|
|
38
|
+
color: theme.colors['highlights-discounted'],
|
|
39
|
+
id: 3,
|
|
40
|
+
},
|
|
41
|
+
]
|
|
42
|
+
|
|
43
|
+
// TODO: forwardRef breaks <Grid />s generic types so using any for now
|
|
44
|
+
const renderItem = ({item}: {item: any}) => {
|
|
45
|
+
return (
|
|
46
|
+
<Box
|
|
47
|
+
alignItems="center"
|
|
48
|
+
justifyContent="center"
|
|
49
|
+
height={item.id % 2 === 0 ? 300 : 200}
|
|
50
|
+
style={{
|
|
51
|
+
backgroundColor: item.color,
|
|
52
|
+
}}
|
|
53
|
+
>
|
|
54
|
+
<Text>{item.name}</Text>
|
|
55
|
+
</Box>
|
|
56
|
+
)
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
return (
|
|
60
|
+
<SafeAreaView style={{flex: 1}}>
|
|
61
|
+
<Header />
|
|
62
|
+
<Box px="gutter">
|
|
63
|
+
<Text variant="headerBold" mb="s">
|
|
64
|
+
Grid
|
|
65
|
+
</Text>
|
|
66
|
+
</Box>
|
|
67
|
+
<Grid
|
|
68
|
+
data={elements}
|
|
69
|
+
renderItem={renderItem}
|
|
70
|
+
contentContainerStyle={{padding: theme.spacing.gutter}}
|
|
71
|
+
/>
|
|
72
|
+
</SafeAreaView>
|
|
73
|
+
)
|
|
74
|
+
}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import {Box, Text, useTheme} from '@shopify/shop-minis-platform-sdk'
|
|
2
|
+
import {SafeAreaView, ScrollView} from 'react-native'
|
|
3
|
+
|
|
4
|
+
import ShopMinisLogo from '../assets/shop-minis-logo.svg'
|
|
5
|
+
import {ButtonCTA} from '../components/ButtonCTA'
|
|
6
|
+
import {ComponentListItem} from '../components/ComponentListItem'
|
|
7
|
+
import {FeaturedComponents} from '../components/FeaturedComponents'
|
|
8
|
+
import {ComponentLink, componentLinks} from '../components/ComponentLink'
|
|
9
|
+
|
|
10
|
+
const featuredComponents: ComponentLink[] = [
|
|
11
|
+
{
|
|
12
|
+
name: 'Modal',
|
|
13
|
+
thumbnail: require('../assets/Modal-component-thumbnail.png'),
|
|
14
|
+
screen: '__MINI_APP_HANDLE_PASCAL_CASE__.Modal',
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
name: 'ProductLink',
|
|
18
|
+
thumbnail: require('../assets/ProductLink-component-thumbnail.png'),
|
|
19
|
+
screen: '__MINI_APP_HANDLE_PASCAL_CASE__.ProductLink',
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
name: 'ProductCard',
|
|
23
|
+
thumbnail: require('../assets/ProductCard-component-thumbnail.png'),
|
|
24
|
+
screen: '__MINI_APP_HANDLE_PASCAL_CASE__.ProductCard',
|
|
25
|
+
},
|
|
26
|
+
]
|
|
27
|
+
|
|
28
|
+
export const HomeScreen = () => {
|
|
29
|
+
const theme = useTheme()
|
|
30
|
+
return (
|
|
31
|
+
<SafeAreaView
|
|
32
|
+
style={{flex: 1, backgroundColor: theme.colors['backgrounds-regular']}}
|
|
33
|
+
>
|
|
34
|
+
<ScrollView>
|
|
35
|
+
<Box flex={1} p="gutter" backgroundColor="backgrounds-regular">
|
|
36
|
+
<ShopMinisLogo width={100} />
|
|
37
|
+
<Text variant="heroBold" mb="s" mt="xs">
|
|
38
|
+
Hello, World!
|
|
39
|
+
</Text>
|
|
40
|
+
<Text variant="subtitle" mb="s">
|
|
41
|
+
A Shop Mini to showcase UI components available in the SDK.
|
|
42
|
+
</Text>
|
|
43
|
+
|
|
44
|
+
<ButtonCTA />
|
|
45
|
+
|
|
46
|
+
<Text variant="label" mb="s" mt="l">
|
|
47
|
+
Featured components
|
|
48
|
+
</Text>
|
|
49
|
+
</Box>
|
|
50
|
+
<Box backgroundColor="backgrounds-regular">
|
|
51
|
+
<FeaturedComponents components={featuredComponents} />
|
|
52
|
+
</Box>
|
|
53
|
+
<Box flex={1} p="gutter" backgroundColor="backgrounds-regular">
|
|
54
|
+
<Text variant="label" mb="s" mt="l">
|
|
55
|
+
All components
|
|
56
|
+
</Text>
|
|
57
|
+
<Box flexDirection="column">
|
|
58
|
+
{componentLinks.map(component => (
|
|
59
|
+
<ComponentListItem
|
|
60
|
+
key={component.name}
|
|
61
|
+
name={component.name}
|
|
62
|
+
screen={component.screen}
|
|
63
|
+
/>
|
|
64
|
+
))}
|
|
65
|
+
</Box>
|
|
66
|
+
</Box>
|
|
67
|
+
</ScrollView>
|
|
68
|
+
</SafeAreaView>
|
|
69
|
+
)
|
|
70
|
+
}
|
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
import {Alert, SafeAreaView, ScrollView} from 'react-native'
|
|
2
|
+
import {
|
|
3
|
+
Box,
|
|
4
|
+
FastImageBox,
|
|
5
|
+
Icon,
|
|
6
|
+
IconButton,
|
|
7
|
+
Text,
|
|
8
|
+
AVAILABLE_ICONS,
|
|
9
|
+
useTheme,
|
|
10
|
+
} from '@shopify/shop-minis-platform-sdk'
|
|
11
|
+
|
|
12
|
+
import {Header} from '../components/Header'
|
|
13
|
+
|
|
14
|
+
export const IconsScreen = () => {
|
|
15
|
+
const theme = useTheme()
|
|
16
|
+
return (
|
|
17
|
+
<SafeAreaView
|
|
18
|
+
style={{flex: 1, backgroundColor: theme.colors['backgrounds-regular']}}
|
|
19
|
+
>
|
|
20
|
+
<ScrollView>
|
|
21
|
+
<Header />
|
|
22
|
+
<Box px="gutter" pb="xs">
|
|
23
|
+
<Text variant="headerBold">Icon</Text>
|
|
24
|
+
|
|
25
|
+
<Box
|
|
26
|
+
marginTop="xs"
|
|
27
|
+
flexDirection="row"
|
|
28
|
+
flexWrap="wrap"
|
|
29
|
+
justifyContent="space-between"
|
|
30
|
+
>
|
|
31
|
+
{AVAILABLE_ICONS.map(icon => {
|
|
32
|
+
return (
|
|
33
|
+
<Box
|
|
34
|
+
key={icon}
|
|
35
|
+
alignItems="center"
|
|
36
|
+
padding="s"
|
|
37
|
+
flexGrow={1}
|
|
38
|
+
flexBasis={100}
|
|
39
|
+
>
|
|
40
|
+
<Icon name={icon} />
|
|
41
|
+
<Box marginTop="xs">
|
|
42
|
+
<Text textAlign="center" variant="caption">
|
|
43
|
+
{icon}
|
|
44
|
+
</Text>
|
|
45
|
+
</Box>
|
|
46
|
+
</Box>
|
|
47
|
+
)
|
|
48
|
+
})}
|
|
49
|
+
</Box>
|
|
50
|
+
|
|
51
|
+
<Text variant="bodyLargeBold" mt="m">
|
|
52
|
+
IconButton
|
|
53
|
+
</Text>
|
|
54
|
+
|
|
55
|
+
<Box flexDirection="row" alignItems="center" paddingVertical="xs">
|
|
56
|
+
<Box minWidth={100}>
|
|
57
|
+
<Text variant="bodySmall">default</Text>
|
|
58
|
+
</Box>
|
|
59
|
+
<IconButton
|
|
60
|
+
name="favorites-heart"
|
|
61
|
+
onPress={DEFAULT_ON_PRESS}
|
|
62
|
+
accessibilityLabel="Favorite"
|
|
63
|
+
/>
|
|
64
|
+
</Box>
|
|
65
|
+
<Box flexDirection="row" alignItems="center" paddingVertical="xs">
|
|
66
|
+
<Box minWidth={100}>
|
|
67
|
+
<Text variant="bodySmall">overlay</Text>
|
|
68
|
+
</Box>
|
|
69
|
+
<IconButton
|
|
70
|
+
name="favorites-heart"
|
|
71
|
+
variant="overlay"
|
|
72
|
+
onPress={DEFAULT_ON_PRESS}
|
|
73
|
+
accessibilityLabel="Favorite"
|
|
74
|
+
/>
|
|
75
|
+
</Box>
|
|
76
|
+
<Box flexDirection="row" alignItems="center" paddingVertical="xs">
|
|
77
|
+
<Box minWidth={100}>
|
|
78
|
+
<Text variant="bodySmall">plain</Text>
|
|
79
|
+
</Box>
|
|
80
|
+
<IconButton
|
|
81
|
+
name="favorites-heart"
|
|
82
|
+
variant="plain"
|
|
83
|
+
onPress={DEFAULT_ON_PRESS}
|
|
84
|
+
accessibilityLabel="Favorite"
|
|
85
|
+
/>
|
|
86
|
+
</Box>
|
|
87
|
+
<Box flexDirection="row" alignItems="center" paddingVertical="xs">
|
|
88
|
+
<Box minWidth={100}>
|
|
89
|
+
<Text variant="bodySmall">filled</Text>
|
|
90
|
+
</Box>
|
|
91
|
+
<IconButton
|
|
92
|
+
name="heart"
|
|
93
|
+
variant="filled"
|
|
94
|
+
backgroundColor="primary-button-background"
|
|
95
|
+
onPress={DEFAULT_ON_PRESS}
|
|
96
|
+
accessibilityLabel="Favorite"
|
|
97
|
+
/>
|
|
98
|
+
</Box>
|
|
99
|
+
|
|
100
|
+
<Text variant="headerBold">Disabled icon buttons</Text>
|
|
101
|
+
|
|
102
|
+
<Box flexDirection="row" alignItems="center" paddingVertical="xs">
|
|
103
|
+
<Box minWidth={100}>
|
|
104
|
+
<Text variant="bodySmall">default</Text>
|
|
105
|
+
</Box>
|
|
106
|
+
<IconButton
|
|
107
|
+
name="favorites-heart"
|
|
108
|
+
disabled
|
|
109
|
+
onPress={DEFAULT_ON_PRESS}
|
|
110
|
+
accessibilityLabel="Favorite"
|
|
111
|
+
/>
|
|
112
|
+
</Box>
|
|
113
|
+
<Box flexDirection="row" alignItems="center" paddingVertical="xs">
|
|
114
|
+
<Box minWidth={100}>
|
|
115
|
+
<Text variant="bodySmall">overlay</Text>
|
|
116
|
+
</Box>
|
|
117
|
+
<IconButton
|
|
118
|
+
name="favorites-heart"
|
|
119
|
+
disabled
|
|
120
|
+
variant="overlay"
|
|
121
|
+
onPress={DEFAULT_ON_PRESS}
|
|
122
|
+
accessibilityLabel="Favorite"
|
|
123
|
+
/>
|
|
124
|
+
</Box>
|
|
125
|
+
<Box flexDirection="row" alignItems="center" paddingVertical="xs">
|
|
126
|
+
<Box minWidth={100}>
|
|
127
|
+
<Text variant="bodySmall">plain</Text>
|
|
128
|
+
</Box>
|
|
129
|
+
<IconButton
|
|
130
|
+
name="favorites-heart"
|
|
131
|
+
disabled
|
|
132
|
+
variant="plain"
|
|
133
|
+
onPress={DEFAULT_ON_PRESS}
|
|
134
|
+
accessibilityLabel="Favorite"
|
|
135
|
+
/>
|
|
136
|
+
</Box>
|
|
137
|
+
<Box flexDirection="row" alignItems="center" paddingVertical="xs">
|
|
138
|
+
<Box minWidth={100}>
|
|
139
|
+
<Text variant="bodySmall">filled</Text>
|
|
140
|
+
</Box>
|
|
141
|
+
<IconButton
|
|
142
|
+
name="heart"
|
|
143
|
+
disabled
|
|
144
|
+
variant="filled"
|
|
145
|
+
backgroundColor="primary-button-background"
|
|
146
|
+
onPress={DEFAULT_ON_PRESS}
|
|
147
|
+
accessibilityLabel="Favorite"
|
|
148
|
+
/>
|
|
149
|
+
</Box>
|
|
150
|
+
|
|
151
|
+
<Box paddingVertical="xs">
|
|
152
|
+
<FastImageBox
|
|
153
|
+
height={200}
|
|
154
|
+
resizeMode="cover"
|
|
155
|
+
source={{uri: 'https://picsum.photos/id/1080/1000/1000'}}
|
|
156
|
+
/>
|
|
157
|
+
<Box position="absolute" bottom={20} right={80}>
|
|
158
|
+
<IconButton
|
|
159
|
+
name="favorites-heart"
|
|
160
|
+
variant="overlay"
|
|
161
|
+
onPress={DEFAULT_ON_PRESS}
|
|
162
|
+
accessibilityLabel="Favorite"
|
|
163
|
+
/>
|
|
164
|
+
</Box>
|
|
165
|
+
<Box position="absolute" bottom={20} right={20}>
|
|
166
|
+
<IconButton
|
|
167
|
+
name="heart"
|
|
168
|
+
variant="filled"
|
|
169
|
+
backgroundColor="primary-button-background"
|
|
170
|
+
onPress={DEFAULT_ON_PRESS}
|
|
171
|
+
accessibilityLabel="Favorite"
|
|
172
|
+
/>
|
|
173
|
+
</Box>
|
|
174
|
+
</Box>
|
|
175
|
+
</Box>
|
|
176
|
+
</ScrollView>
|
|
177
|
+
</SafeAreaView>
|
|
178
|
+
)
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
const DEFAULT_ON_PRESS = () => Alert.alert('Pressed!')
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
import {SafeAreaView, ScrollView} from 'react-native'
|
|
2
|
+
import {
|
|
3
|
+
Box,
|
|
4
|
+
FastImageBox,
|
|
5
|
+
Text,
|
|
6
|
+
Avatar,
|
|
7
|
+
CollectionThumbnail,
|
|
8
|
+
useTheme,
|
|
9
|
+
} from '@shopify/shop-minis-platform-sdk'
|
|
10
|
+
|
|
11
|
+
import {Header} from '../components/Header'
|
|
12
|
+
|
|
13
|
+
export const MediaScreen = () => {
|
|
14
|
+
const theme = useTheme()
|
|
15
|
+
return (
|
|
16
|
+
<SafeAreaView
|
|
17
|
+
style={{backgroundColor: theme.colors['backgrounds-regular']}}
|
|
18
|
+
>
|
|
19
|
+
<ScrollView>
|
|
20
|
+
<Header />
|
|
21
|
+
<Box px="gutter">
|
|
22
|
+
<Text variant="headerBold" mb="xs">
|
|
23
|
+
Media
|
|
24
|
+
</Text>
|
|
25
|
+
</Box>
|
|
26
|
+
<Box>
|
|
27
|
+
<Box padding="gutter">
|
|
28
|
+
<Text variant="sectionTitle">Avatar</Text>
|
|
29
|
+
|
|
30
|
+
<Box
|
|
31
|
+
mt="xs"
|
|
32
|
+
p="gutter"
|
|
33
|
+
backgroundColor="unbranded-button-background"
|
|
34
|
+
borderRadius={16}
|
|
35
|
+
>
|
|
36
|
+
<Avatar
|
|
37
|
+
color="backgrounds-regular"
|
|
38
|
+
title="John Doe"
|
|
39
|
+
source={{uri: 'https://picsum.photos/200/200'}}
|
|
40
|
+
/>
|
|
41
|
+
</Box>
|
|
42
|
+
|
|
43
|
+
<Box
|
|
44
|
+
mt="xs"
|
|
45
|
+
p="gutter"
|
|
46
|
+
backgroundColor="backgrounds-subdued"
|
|
47
|
+
borderRadius={16}
|
|
48
|
+
>
|
|
49
|
+
<Avatar
|
|
50
|
+
color="foregrounds-regular"
|
|
51
|
+
title="Joe Dohn"
|
|
52
|
+
source={{uri: 'https://picsum.photos/150/150'}}
|
|
53
|
+
/>
|
|
54
|
+
</Box>
|
|
55
|
+
</Box>
|
|
56
|
+
|
|
57
|
+
<Box px="gutter" mt="s">
|
|
58
|
+
<Text variant="sectionTitle">Thumbnails</Text>
|
|
59
|
+
<Box marginTop="s" flexDirection="row">
|
|
60
|
+
<Box>
|
|
61
|
+
<CollectionThumbnail
|
|
62
|
+
borderColor="foregrounds-regular"
|
|
63
|
+
imageSources={[{uri: 'https://picsum.photos/200/200'}]}
|
|
64
|
+
onPress={() => {}}
|
|
65
|
+
/>
|
|
66
|
+
</Box>
|
|
67
|
+
<Box marginLeft="xs">
|
|
68
|
+
<CollectionThumbnail
|
|
69
|
+
borderColor="backgrounds-regular"
|
|
70
|
+
imageSources={[
|
|
71
|
+
{uri: 'https://picsum.photos/200/200'},
|
|
72
|
+
{uri: 'https://picsum.photos/150/150'},
|
|
73
|
+
{uri: 'https://picsum.photos/100/100'},
|
|
74
|
+
]}
|
|
75
|
+
onPress={() => {}}
|
|
76
|
+
/>
|
|
77
|
+
</Box>
|
|
78
|
+
</Box>
|
|
79
|
+
</Box>
|
|
80
|
+
|
|
81
|
+
<Box padding="gutter">
|
|
82
|
+
<Text variant="sectionTitle">Images</Text>
|
|
83
|
+
<Text variant="bodySmall" mt="m">
|
|
84
|
+
resizeMode: contain
|
|
85
|
+
</Text>
|
|
86
|
+
<FastImageBox
|
|
87
|
+
height={200}
|
|
88
|
+
resizeMode="contain"
|
|
89
|
+
source={{uri: 'https://picsum.photos/200/300'}}
|
|
90
|
+
/>
|
|
91
|
+
<Text variant="bodySmall" mt="m">
|
|
92
|
+
resizeMode: cover
|
|
93
|
+
</Text>
|
|
94
|
+
<FastImageBox
|
|
95
|
+
height={200}
|
|
96
|
+
resizeMode="cover"
|
|
97
|
+
source={{uri: 'https://picsum.photos/200/300'}}
|
|
98
|
+
/>
|
|
99
|
+
<Text variant="bodySmall" mt="m">
|
|
100
|
+
resizeMode: stretch
|
|
101
|
+
</Text>
|
|
102
|
+
<FastImageBox
|
|
103
|
+
height={200}
|
|
104
|
+
resizeMode="stretch"
|
|
105
|
+
source={{uri: 'https://picsum.photos/200/300'}}
|
|
106
|
+
/>
|
|
107
|
+
<Text variant="bodySmall" mt="m">
|
|
108
|
+
resizeMode: center
|
|
109
|
+
</Text>
|
|
110
|
+
<FastImageBox
|
|
111
|
+
height={200}
|
|
112
|
+
resizeMode="center"
|
|
113
|
+
source={{uri: 'https://picsum.photos/200/300'}}
|
|
114
|
+
/>
|
|
115
|
+
<Text variant="bodySmall" mt="m">
|
|
116
|
+
With Box styling
|
|
117
|
+
</Text>
|
|
118
|
+
<FastImageBox
|
|
119
|
+
height={200}
|
|
120
|
+
aspectRatio={1}
|
|
121
|
+
borderRadius={16}
|
|
122
|
+
resizeMode="center"
|
|
123
|
+
source={{uri: 'https://picsum.photos/200/300'}}
|
|
124
|
+
/>
|
|
125
|
+
</Box>
|
|
126
|
+
</Box>
|
|
127
|
+
</ScrollView>
|
|
128
|
+
</SafeAreaView>
|
|
129
|
+
)
|
|
130
|
+
}
|