@treely/strapi-slices 7.4.0 → 7.4.2
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 +18 -6
- 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 +18 -6
- package/dist/strapi-slices.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/slices/Events/Events.stories.tsx +2 -2
- package/src/slices/Events/Events.tsx +6 -10
- package/src/slices/TextCarousel/TextCarousel.tsx +46 -44
package/package.json
CHANGED
|
@@ -16,7 +16,7 @@ const Template: StoryFn<typeof Events> = (args) => <Events {...args} />;
|
|
|
16
16
|
export const Minimal = Template.bind({});
|
|
17
17
|
Minimal.args = {
|
|
18
18
|
slice: {
|
|
19
|
-
upcomingTitle: '
|
|
19
|
+
upcomingTitle: 'Ready to Learn more about Forest Climate Protection?',
|
|
20
20
|
upcomingDescription: 'Join us for these amazing events',
|
|
21
21
|
pastTitle: 'Past Events',
|
|
22
22
|
pastDescription: 'Check out our past events',
|
|
@@ -27,7 +27,7 @@ Minimal.args = {
|
|
|
27
27
|
export const WithFilterSearch = Template.bind({});
|
|
28
28
|
WithFilterSearch.args = {
|
|
29
29
|
slice: {
|
|
30
|
-
upcomingTitle: '
|
|
30
|
+
upcomingTitle: 'Ready to Learn more about Forest Climate Protection?',
|
|
31
31
|
upcomingDescription: 'Join us for these amazing events',
|
|
32
32
|
pastTitle: 'Past Events',
|
|
33
33
|
pastDescription: 'Check out our past events',
|
|
@@ -236,6 +236,8 @@ export const Events: React.FC<EventsProps> = ({ slice }: EventsProps) => {
|
|
|
236
236
|
<DefaultSectionHeader
|
|
237
237
|
title={slice.upcomingTitle}
|
|
238
238
|
text={slice.upcomingDescription}
|
|
239
|
+
titleProps={{ maxW: '3xl' }}
|
|
240
|
+
textProps={{ maxW: '3xl' }}
|
|
239
241
|
/>
|
|
240
242
|
<Spacer h="10" />
|
|
241
243
|
</>
|
|
@@ -388,11 +390,7 @@ export const Events: React.FC<EventsProps> = ({ slice }: EventsProps) => {
|
|
|
388
390
|
placeItems="center"
|
|
389
391
|
>
|
|
390
392
|
{upcomingEvents.map((event: IStrapiData<StrapiEvent>) => (
|
|
391
|
-
<Box
|
|
392
|
-
key={event.id}
|
|
393
|
-
width="full"
|
|
394
|
-
height={['full', null, null, 'xl']}
|
|
395
|
-
>
|
|
393
|
+
<Box key={event.id} width="full" height="full">
|
|
396
394
|
<EventCard event={event.attributes} />
|
|
397
395
|
</Box>
|
|
398
396
|
))}
|
|
@@ -420,6 +418,8 @@ export const Events: React.FC<EventsProps> = ({ slice }: EventsProps) => {
|
|
|
420
418
|
<DefaultSectionHeader
|
|
421
419
|
title={slice.pastTitle}
|
|
422
420
|
text={slice.pastDescription}
|
|
421
|
+
titleProps={{ maxW: '3xl' }}
|
|
422
|
+
textProps={{ maxW: '3xl' }}
|
|
423
423
|
/>
|
|
424
424
|
|
|
425
425
|
<Spacer h="10" />
|
|
@@ -442,11 +442,7 @@ export const Events: React.FC<EventsProps> = ({ slice }: EventsProps) => {
|
|
|
442
442
|
mb={['10', null, null, '20']}
|
|
443
443
|
>
|
|
444
444
|
{pastEvents.map((event: IStrapiData<StrapiEvent>) => (
|
|
445
|
-
<Box
|
|
446
|
-
key={event.id}
|
|
447
|
-
height={['full', null, null, 'xl']}
|
|
448
|
-
width="full"
|
|
449
|
-
>
|
|
445
|
+
<Box key={event.id} height="full" width="full">
|
|
450
446
|
<EventCard event={event.attributes} />
|
|
451
447
|
</Box>
|
|
452
448
|
))}
|
|
@@ -105,54 +105,56 @@ export const TextCarousel: React.FC<TextCarouselProps> = ({
|
|
|
105
105
|
|
|
106
106
|
<CarouselContainer ref={containerRef}>
|
|
107
107
|
<Box position="relative" width="full">
|
|
108
|
-
<
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
<
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
src={strapiMediaUrl(icon.img, 'small')}
|
|
127
|
-
alt={icon.alt}
|
|
128
|
-
fill
|
|
129
|
-
style={{ objectFit: icon.objectFit || 'contain' }}
|
|
130
|
-
/>
|
|
131
|
-
}
|
|
132
|
-
image={
|
|
133
|
-
image && (
|
|
108
|
+
<Wrapper>
|
|
109
|
+
<CarouselInnerContainer
|
|
110
|
+
numberOfItems={slice.slides.length}
|
|
111
|
+
animate={{
|
|
112
|
+
x: offsetLeft,
|
|
113
|
+
}}
|
|
114
|
+
transition={{
|
|
115
|
+
duration: 0.3,
|
|
116
|
+
ease: 'easeInOut',
|
|
117
|
+
}}
|
|
118
|
+
>
|
|
119
|
+
{displaySlides.map(({ id, title, text, icon, image, button }) => (
|
|
120
|
+
<CardContainer key={id} ref={itemRef}>
|
|
121
|
+
<TextCardWithIcon
|
|
122
|
+
title={title}
|
|
123
|
+
text={text}
|
|
124
|
+
height="full"
|
|
125
|
+
icon={
|
|
134
126
|
<Image
|
|
135
|
-
src={strapiMediaUrl(
|
|
136
|
-
alt={
|
|
127
|
+
src={strapiMediaUrl(icon.img, 'small')}
|
|
128
|
+
alt={icon.alt}
|
|
137
129
|
fill
|
|
138
|
-
style={{
|
|
139
|
-
objectFit: image?.objectFit || 'cover',
|
|
140
|
-
borderRadius: 'var(--boemly-radii-xl)',
|
|
141
|
-
}}
|
|
130
|
+
style={{ objectFit: icon.objectFit || 'contain' }}
|
|
142
131
|
/>
|
|
143
|
-
)
|
|
144
|
-
}
|
|
145
|
-
button={
|
|
146
|
-
button && {
|
|
147
|
-
text: button.text,
|
|
148
|
-
onClick: () => push(strapiLinkUrl(button)),
|
|
149
132
|
}
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
133
|
+
image={
|
|
134
|
+
image && (
|
|
135
|
+
<Image
|
|
136
|
+
src={strapiMediaUrl(image?.img, 'medium')}
|
|
137
|
+
alt={image?.alt}
|
|
138
|
+
fill
|
|
139
|
+
style={{
|
|
140
|
+
objectFit: image?.objectFit || 'cover',
|
|
141
|
+
borderRadius: 'var(--boemly-radii-xl)',
|
|
142
|
+
}}
|
|
143
|
+
/>
|
|
144
|
+
)
|
|
145
|
+
}
|
|
146
|
+
button={
|
|
147
|
+
button && {
|
|
148
|
+
text: button.text,
|
|
149
|
+
onClick: () => push(strapiLinkUrl(button)),
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
displayAs="column"
|
|
153
|
+
/>
|
|
154
|
+
</CardContainer>
|
|
155
|
+
))}
|
|
156
|
+
</CarouselInnerContainer>
|
|
157
|
+
</Wrapper>
|
|
156
158
|
<Box
|
|
157
159
|
display={['none', null, null, !!allowScroll ? 'flex' : 'none']}
|
|
158
160
|
pointerEvents="none"
|