@treely/strapi-slices 5.2.2 → 5.2.4
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/strapi-slices.cjs.development.js +12 -3
- package/dist/strapi-slices.cjs.development.js.map +1 -1
- package/dist/strapi-slices.cjs.production.min.js +1 -1
- package/dist/strapi-slices.cjs.production.min.js.map +1 -1
- package/dist/strapi-slices.esm.js +12 -3
- package/dist/strapi-slices.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/slices/IconGrid/IconGrid.tsx +85 -70
- package/src/slices/TextCarousel/TextCarousel.tsx +1 -1
package/package.json
CHANGED
|
@@ -31,76 +31,91 @@ export interface IconGridProps {
|
|
|
31
31
|
};
|
|
32
32
|
}
|
|
33
33
|
|
|
34
|
-
export const IconGrid: React.FC<IconGridProps> = ({ slice }: IconGridProps) =>
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
34
|
+
export const IconGrid: React.FC<IconGridProps> = ({ slice }: IconGridProps) => {
|
|
35
|
+
const columns = () => {
|
|
36
|
+
if (slice.iconsWithTextAndButton.length === 2) {
|
|
37
|
+
return [1, null, null, 2, 2];
|
|
38
|
+
}
|
|
39
|
+
if (slice.iconsWithTextAndButton.length === 1) {
|
|
40
|
+
return 1;
|
|
41
|
+
}
|
|
42
|
+
return [1, null, null, 2, 3];
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
return (
|
|
46
|
+
<DefaultSectionContainer>
|
|
47
|
+
<Wrapper>
|
|
48
|
+
{slice.title ? (
|
|
49
|
+
<>
|
|
50
|
+
<Flex alignItems="center" flexDirection="column">
|
|
51
|
+
<DefaultSectionHeader
|
|
52
|
+
tagline={slice.tagline}
|
|
53
|
+
title={slice.title}
|
|
54
|
+
text={slice.subTitle}
|
|
55
|
+
taglineProps={{ maxW: '2xl', textAlign: 'center' }}
|
|
56
|
+
titleProps={{ maxW: '3xl', textAlign: 'center' }}
|
|
57
|
+
textProps={{ maxW: '3xl', textAlign: 'center' }}
|
|
58
|
+
/>
|
|
59
|
+
</Flex>
|
|
60
|
+
<Spacer h="20" />
|
|
61
|
+
</>
|
|
62
|
+
) : (
|
|
63
|
+
<></>
|
|
64
|
+
)}
|
|
54
65
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
66
|
+
<SimpleGrid
|
|
67
|
+
columns={columns()}
|
|
68
|
+
gap={slice.iconsWithTextAndButton.length === 2 ? '14' : '16'}
|
|
69
|
+
rowGap={['16', null, null, '20']}
|
|
70
|
+
>
|
|
71
|
+
{slice.iconsWithTextAndButton.map((iconWithTextAndButton) => (
|
|
72
|
+
<Box key={iconWithTextAndButton.id}>
|
|
73
|
+
<Box
|
|
74
|
+
margin="0 auto"
|
|
75
|
+
backgroundColor="primary.50"
|
|
76
|
+
borderRadius="full"
|
|
77
|
+
display="flex"
|
|
78
|
+
alignItems="center"
|
|
79
|
+
justifyContent="space-around"
|
|
80
|
+
width="6.5rem"
|
|
81
|
+
height="6.5rem"
|
|
82
|
+
>
|
|
83
|
+
<Box position="absolute" width="12" height="12">
|
|
84
|
+
<Image
|
|
85
|
+
src={strapiMediaUrl(
|
|
86
|
+
iconWithTextAndButton.icon.img,
|
|
87
|
+
'xSmall'
|
|
88
|
+
)}
|
|
89
|
+
alt={iconWithTextAndButton.icon.alt}
|
|
90
|
+
fill
|
|
91
|
+
style={{
|
|
92
|
+
objectFit:
|
|
93
|
+
iconWithTextAndButton.icon.objectFit || 'contain',
|
|
94
|
+
}}
|
|
95
|
+
/>
|
|
96
|
+
</Box>
|
|
82
97
|
</Box>
|
|
98
|
+
<Heading size="xl" textAlign="center" mb="4" mt="8">
|
|
99
|
+
{iconWithTextAndButton.title}
|
|
100
|
+
</Heading>
|
|
101
|
+
<Text size="mdRegularNormal" textAlign="center">
|
|
102
|
+
{iconWithTextAndButton.text}
|
|
103
|
+
</Text>
|
|
104
|
+
{iconWithTextAndButton.button && (
|
|
105
|
+
<Box textAlign="center">
|
|
106
|
+
<StrapiLinkButton
|
|
107
|
+
key={iconWithTextAndButton.button.id}
|
|
108
|
+
mt="8"
|
|
109
|
+
size="md"
|
|
110
|
+
variant="outline"
|
|
111
|
+
link={iconWithTextAndButton.button}
|
|
112
|
+
/>
|
|
113
|
+
</Box>
|
|
114
|
+
)}
|
|
83
115
|
</Box>
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
{iconWithTextAndButton.button && (
|
|
91
|
-
<Box textAlign="center">
|
|
92
|
-
<StrapiLinkButton
|
|
93
|
-
key={iconWithTextAndButton.button.id}
|
|
94
|
-
mt="8"
|
|
95
|
-
size="md"
|
|
96
|
-
variant="outline"
|
|
97
|
-
link={iconWithTextAndButton.button}
|
|
98
|
-
/>
|
|
99
|
-
</Box>
|
|
100
|
-
)}
|
|
101
|
-
</Box>
|
|
102
|
-
))}
|
|
103
|
-
</SimpleGrid>
|
|
104
|
-
</Wrapper>
|
|
105
|
-
</DefaultSectionContainer>
|
|
106
|
-
);
|
|
116
|
+
))}
|
|
117
|
+
</SimpleGrid>
|
|
118
|
+
</Wrapper>
|
|
119
|
+
</DefaultSectionContainer>
|
|
120
|
+
);
|
|
121
|
+
};
|