@treely/strapi-slices 4.4.5 → 4.4.7
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 +5 -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 +5 -3
- package/dist/strapi-slices.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/slices/Cta/Cta.tsx +1 -1
- package/src/slices/Facts/Facts.tsx +1 -1
- package/src/slices/QuoteCards/QuoteCards.tsx +106 -101
package/package.json
CHANGED
package/src/slices/Cta/Cta.tsx
CHANGED
|
@@ -106,7 +106,7 @@ export const Facts: React.FC<FactsProps> = ({ slice }: FactsProps) => (
|
|
|
106
106
|
>
|
|
107
107
|
<Heading
|
|
108
108
|
fontSize="6xl"
|
|
109
|
-
fontFamily="
|
|
109
|
+
fontFamily="display"
|
|
110
110
|
lineHeight="10"
|
|
111
111
|
fontWeight="700"
|
|
112
112
|
color={VARIANTS[slice.variant].factValueColor}
|
|
@@ -16,6 +16,7 @@ import StrapiHeroCard from '../../models/strapi/StrapiHeroCard';
|
|
|
16
16
|
import strapiLinkUrl from '../../utils/strapiLinkUrl';
|
|
17
17
|
import StrapiImage from '../../models/strapi/StrapiImage';
|
|
18
18
|
import convertToKebabCase from '../../utils/convertToKebabCase';
|
|
19
|
+
import { useRouter } from 'next/router';
|
|
19
20
|
|
|
20
21
|
interface QuoteCardsSlice extends StrapiDefaultHeader {
|
|
21
22
|
cards: StrapiQuoteCard[];
|
|
@@ -28,110 +29,114 @@ export interface QuoteCardsProps {
|
|
|
28
29
|
|
|
29
30
|
export const QuoteCards: React.FC<QuoteCardsProps> = ({
|
|
30
31
|
slice,
|
|
31
|
-
}: QuoteCardsProps) =>
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
size="xs"
|
|
53
|
-
radius="bottom-left"
|
|
54
|
-
/>
|
|
55
|
-
<Shape
|
|
56
|
-
shape={
|
|
57
|
-
<Image
|
|
58
|
-
src={strapiMediaUrl(slice.shapes[1].img, 'small')}
|
|
59
|
-
alt={slice.shapes[1].alt}
|
|
60
|
-
fill
|
|
61
|
-
style={{ objectFit: slice.shapes[1].objectFit || 'cover' }}
|
|
62
|
-
/>
|
|
63
|
-
}
|
|
64
|
-
bottom="0"
|
|
65
|
-
left="0"
|
|
66
|
-
radius="top-right"
|
|
67
|
-
/>
|
|
68
|
-
</>
|
|
69
|
-
)}
|
|
70
|
-
<Wrapper>
|
|
71
|
-
<Box maxW="3xl">
|
|
72
|
-
<DefaultSectionHeader
|
|
73
|
-
tagline={slice.tagline}
|
|
74
|
-
title={slice.title}
|
|
75
|
-
text={slice.text}
|
|
76
|
-
/>
|
|
77
|
-
</Box>
|
|
78
|
-
<SimpleGrid
|
|
79
|
-
columns={2}
|
|
80
|
-
gap="20"
|
|
81
|
-
rowGap="6"
|
|
82
|
-
mt="16"
|
|
83
|
-
minChildWidth={['100%', null, '16rem']}
|
|
84
|
-
>
|
|
85
|
-
{slice.cards.map((card) => (
|
|
86
|
-
<Box key={card.id} width="full" maxWidth="2xl">
|
|
87
|
-
<QuoteCard
|
|
88
|
-
key={card.id}
|
|
89
|
-
avatar={{
|
|
90
|
-
name: card.avatar.name,
|
|
91
|
-
description: card.avatar.description,
|
|
92
|
-
image: (
|
|
93
|
-
<Image
|
|
94
|
-
src={strapiMediaUrl(card.avatar.image.img, 'small')}
|
|
95
|
-
alt={card.avatar.image.alt}
|
|
96
|
-
fill
|
|
97
|
-
style={{
|
|
98
|
-
objectFit: card.avatar.image.objectFit || 'cover',
|
|
99
|
-
}}
|
|
100
|
-
/>
|
|
101
|
-
),
|
|
102
|
-
}}
|
|
103
|
-
text={card.text}
|
|
104
|
-
/>
|
|
105
|
-
</Box>
|
|
106
|
-
))}
|
|
107
|
-
</SimpleGrid>
|
|
108
|
-
</Wrapper>
|
|
109
|
-
</Box>
|
|
110
|
-
{slice.hero && (
|
|
111
|
-
<Box marginTop="-40" paddingBottom="28">
|
|
112
|
-
<Wrapper>
|
|
113
|
-
<HeroCard
|
|
114
|
-
title={slice.hero.title}
|
|
115
|
-
subTitle={slice.hero.subTitle}
|
|
116
|
-
link={
|
|
117
|
-
slice.hero.button && {
|
|
118
|
-
text: slice.hero.button.text,
|
|
119
|
-
onClick: () => strapiLinkUrl(slice.hero?.button),
|
|
32
|
+
}: QuoteCardsProps) => {
|
|
33
|
+
const { push } = useRouter();
|
|
34
|
+
|
|
35
|
+
return (
|
|
36
|
+
<>
|
|
37
|
+
<Box
|
|
38
|
+
id={convertToKebabCase(slice.title)}
|
|
39
|
+
position="relative"
|
|
40
|
+
paddingTop="28"
|
|
41
|
+
paddingBottom={!!slice.hero ? '80' : '28'}
|
|
42
|
+
>
|
|
43
|
+
{slice.shapes && slice.shapes.length === 2 && (
|
|
44
|
+
<>
|
|
45
|
+
<Shape
|
|
46
|
+
shape={
|
|
47
|
+
<Image
|
|
48
|
+
src={strapiMediaUrl(slice.shapes[0].img, 'small')}
|
|
49
|
+
alt={slice.shapes[0].alt}
|
|
50
|
+
fill
|
|
51
|
+
style={{ objectFit: slice.shapes[0].objectFit || 'cover' }}
|
|
52
|
+
/>
|
|
120
53
|
}
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
54
|
+
top="0"
|
|
55
|
+
right="0"
|
|
56
|
+
size="xs"
|
|
57
|
+
radius="bottom-left"
|
|
58
|
+
/>
|
|
59
|
+
<Shape
|
|
60
|
+
shape={
|
|
124
61
|
<Image
|
|
125
|
-
src={strapiMediaUrl(slice.
|
|
126
|
-
alt={slice.
|
|
62
|
+
src={strapiMediaUrl(slice.shapes[1].img, 'small')}
|
|
63
|
+
alt={slice.shapes[1].alt}
|
|
127
64
|
fill
|
|
128
|
-
style={{ objectFit: slice.
|
|
65
|
+
style={{ objectFit: slice.shapes[1].objectFit || 'cover' }}
|
|
129
66
|
/>
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
67
|
+
}
|
|
68
|
+
bottom="0"
|
|
69
|
+
left="0"
|
|
70
|
+
radius="top-right"
|
|
71
|
+
/>
|
|
72
|
+
</>
|
|
73
|
+
)}
|
|
74
|
+
<Wrapper>
|
|
75
|
+
<Box maxW="3xl">
|
|
76
|
+
<DefaultSectionHeader
|
|
77
|
+
tagline={slice.tagline}
|
|
78
|
+
title={slice.title}
|
|
79
|
+
text={slice.text}
|
|
80
|
+
/>
|
|
81
|
+
</Box>
|
|
82
|
+
<SimpleGrid
|
|
83
|
+
columns={2}
|
|
84
|
+
gap="20"
|
|
85
|
+
rowGap="6"
|
|
86
|
+
mt="16"
|
|
87
|
+
minChildWidth={['100%', null, '16rem']}
|
|
88
|
+
>
|
|
89
|
+
{slice.cards.map((card) => (
|
|
90
|
+
<Box key={card.id} width="full" maxWidth="2xl">
|
|
91
|
+
<QuoteCard
|
|
92
|
+
key={card.id}
|
|
93
|
+
avatar={{
|
|
94
|
+
name: card.avatar.name,
|
|
95
|
+
description: card.avatar.description,
|
|
96
|
+
image: (
|
|
97
|
+
<Image
|
|
98
|
+
src={strapiMediaUrl(card.avatar.image.img, 'small')}
|
|
99
|
+
alt={card.avatar.image.alt}
|
|
100
|
+
fill
|
|
101
|
+
style={{
|
|
102
|
+
objectFit: card.avatar.image.objectFit || 'cover',
|
|
103
|
+
}}
|
|
104
|
+
/>
|
|
105
|
+
),
|
|
106
|
+
}}
|
|
107
|
+
text={card.text}
|
|
108
|
+
/>
|
|
109
|
+
</Box>
|
|
110
|
+
))}
|
|
111
|
+
</SimpleGrid>
|
|
133
112
|
</Wrapper>
|
|
134
113
|
</Box>
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
114
|
+
{slice.hero && (
|
|
115
|
+
<Box marginTop="-40" paddingBottom="28">
|
|
116
|
+
<Wrapper>
|
|
117
|
+
<HeroCard
|
|
118
|
+
title={slice.hero.title}
|
|
119
|
+
subTitle={slice.hero.subTitle}
|
|
120
|
+
link={
|
|
121
|
+
slice.hero.button && {
|
|
122
|
+
text: slice.hero.button.text,
|
|
123
|
+
onClick: () => push(strapiLinkUrl(slice.hero?.button)),
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
image={
|
|
127
|
+
slice.hero.image && (
|
|
128
|
+
<Image
|
|
129
|
+
src={strapiMediaUrl(slice.hero.image.img, 'xLarge')}
|
|
130
|
+
alt={slice.hero.image.alt}
|
|
131
|
+
fill
|
|
132
|
+
style={{ objectFit: slice.hero.image.objectFit || 'cover' }}
|
|
133
|
+
/>
|
|
134
|
+
)
|
|
135
|
+
}
|
|
136
|
+
/>
|
|
137
|
+
</Wrapper>
|
|
138
|
+
</Box>
|
|
139
|
+
)}
|
|
140
|
+
</>
|
|
141
|
+
);
|
|
142
|
+
};
|