@treely/strapi-slices 4.4.0 → 4.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/models/strapi/StrapiBlogPost.d.ts +2 -2
- package/dist/models/strapi/StrapiHeroCard.d.ts +2 -5
- package/dist/models/strapi/StrapiLink.d.ts +1 -1
- package/dist/models/strapi/StrapiProject.d.ts +1 -1
- package/dist/slices/BlogCards/BlogCards.d.ts +1 -1
- package/dist/strapi-slices.cjs.development.js +21 -15
- 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 +21 -15
- package/dist/strapi-slices.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/portfolio/SmallCheckout/SmallCheckout.tsx +1 -2
- package/src/models/strapi/StrapiBlogPost.ts +2 -2
- package/src/models/strapi/StrapiHeroCard.ts +2 -5
- package/src/models/strapi/StrapiLink.ts +1 -1
- package/src/models/strapi/StrapiProject.ts +1 -1
- package/src/slices/Blog/Blog.tsx +2 -2
- package/src/slices/BlogCards/BlogCards.test.tsx +1 -0
- package/src/slices/BlogCards/BlogCards.tsx +4 -4
- package/src/slices/Cta/Cta.tsx +5 -0
- package/src/slices/MapHero/MapHero.tsx +1 -1
package/package.json
CHANGED
|
@@ -13,8 +13,8 @@ interface StrapiBlogPost {
|
|
|
13
13
|
slug: string;
|
|
14
14
|
teaser: string | null;
|
|
15
15
|
img: StrapiImage;
|
|
16
|
-
author
|
|
17
|
-
category
|
|
16
|
+
author: IStrapi<IStrapiData<StrapiAuthor> | null>;
|
|
17
|
+
category: IStrapi<IStrapiData<StrapiCategory> | null>;
|
|
18
18
|
locale: Locale;
|
|
19
19
|
createdAt: string;
|
|
20
20
|
updatedAt: string;
|
|
@@ -1,14 +1,11 @@
|
|
|
1
1
|
import StrapiImage from './StrapiImage';
|
|
2
|
+
import StrapiLink from './StrapiLink';
|
|
2
3
|
|
|
3
4
|
interface StrapiHeroCard {
|
|
4
5
|
id: number;
|
|
5
6
|
title: string;
|
|
6
7
|
subTitle: string;
|
|
7
|
-
button?:
|
|
8
|
-
id: number;
|
|
9
|
-
url: string;
|
|
10
|
-
text: string;
|
|
11
|
-
};
|
|
8
|
+
button?: StrapiLink;
|
|
12
9
|
image?: StrapiImage;
|
|
13
10
|
}
|
|
14
11
|
|
|
@@ -20,7 +20,7 @@ interface StrapiProject {
|
|
|
20
20
|
thumbnail: StrapiImage | null;
|
|
21
21
|
slices: any[];
|
|
22
22
|
localizations: StrapiLocalization[];
|
|
23
|
-
portfolio: IStrapi<IStrapiData<StrapiPortfolio
|
|
23
|
+
portfolio: IStrapi<IStrapiData<StrapiPortfolio> | null>;
|
|
24
24
|
topBanner?: StrapiTopBanner;
|
|
25
25
|
}
|
|
26
26
|
|
package/src/slices/Blog/Blog.tsx
CHANGED
|
@@ -59,7 +59,7 @@ export const Blog: React.FC<BlogProps> = ({ slice, blogPosts }: BlogProps) => {
|
|
|
59
59
|
/>
|
|
60
60
|
</ImageContainer>
|
|
61
61
|
<Box px="2" py="8">
|
|
62
|
-
{blogPost.attributes.category && (
|
|
62
|
+
{blogPost.attributes.category.data && (
|
|
63
63
|
<Text size="smMonoUppercase" color="primary.800" mb="2">
|
|
64
64
|
{blogPost.attributes.category.data.attributes.name}
|
|
65
65
|
</Text>
|
|
@@ -74,7 +74,7 @@ export const Blog: React.FC<BlogProps> = ({ slice, blogPosts }: BlogProps) => {
|
|
|
74
74
|
<DatePersonPair
|
|
75
75
|
date={formatDate(blogPost.attributes.createdAt)}
|
|
76
76
|
person={
|
|
77
|
-
blogPost.attributes.author
|
|
77
|
+
blogPost.attributes.author.data
|
|
78
78
|
? {
|
|
79
79
|
name: blogPost.attributes.author.data.attributes
|
|
80
80
|
.name,
|
|
@@ -34,7 +34,7 @@ export interface BlogCardsProps {
|
|
|
34
34
|
subTitle: string;
|
|
35
35
|
button?: StrapiLink;
|
|
36
36
|
variant: 'white' | 'gray';
|
|
37
|
-
blogPostCategory
|
|
37
|
+
blogPostCategory: IStrapi<IStrapiData<StrapiCategory> | null>;
|
|
38
38
|
};
|
|
39
39
|
blogPosts: IStrapiData<StrapiBlogPost>[];
|
|
40
40
|
}
|
|
@@ -74,7 +74,7 @@ export const BlogCards: React.FC<BlogCardsProps> = ({
|
|
|
74
74
|
? sortedBlogPosts
|
|
75
75
|
.filter(
|
|
76
76
|
(blogPost) =>
|
|
77
|
-
blogPost.attributes.category?.
|
|
77
|
+
blogPost.attributes.category.data?.attributes.name ===
|
|
78
78
|
slice.blogPostCategory?.data?.attributes.name
|
|
79
79
|
)
|
|
80
80
|
.slice(0, 3)
|
|
@@ -142,7 +142,7 @@ export const BlogCards: React.FC<BlogCardsProps> = ({
|
|
|
142
142
|
<Box px="2" py="8">
|
|
143
143
|
{blogPost.attributes.category && (
|
|
144
144
|
<Text size="smMonoUppercase" color="primary.800" mb="2">
|
|
145
|
-
{blogPost.attributes.category.data
|
|
145
|
+
{blogPost.attributes.category.data?.attributes.name}
|
|
146
146
|
</Text>
|
|
147
147
|
)}
|
|
148
148
|
<Heading size="lg">{blogPost.attributes.title}</Heading>
|
|
@@ -157,7 +157,7 @@ export const BlogCards: React.FC<BlogCardsProps> = ({
|
|
|
157
157
|
<DatePersonPair
|
|
158
158
|
date={formatDate(blogPost.attributes.createdAt)}
|
|
159
159
|
person={
|
|
160
|
-
blogPost.attributes.author
|
|
160
|
+
blogPost.attributes.author.data
|
|
161
161
|
? {
|
|
162
162
|
name: blogPost.attributes.author.data.attributes.name,
|
|
163
163
|
image: (
|
package/src/slices/Cta/Cta.tsx
CHANGED
|
@@ -56,6 +56,7 @@ const STATES: Record<CtaCardType, Record<string, any>> = {
|
|
|
56
56
|
justifyContent: 'space-between',
|
|
57
57
|
buttonJustifyContent: 'start',
|
|
58
58
|
textMarginLeft: ['0', null, null, null, '14'],
|
|
59
|
+
textMarginRight: '0',
|
|
59
60
|
},
|
|
60
61
|
centerWithoutImage: {
|
|
61
62
|
textAlign: 'center',
|
|
@@ -64,6 +65,7 @@ const STATES: Record<CtaCardType, Record<string, any>> = {
|
|
|
64
65
|
justifyContent: 'center',
|
|
65
66
|
buttonJustifyContent: 'center',
|
|
66
67
|
textMarginLeft: '0',
|
|
68
|
+
textMarginRight: '0',
|
|
67
69
|
},
|
|
68
70
|
centerWithImage: {
|
|
69
71
|
textAlign: 'center',
|
|
@@ -72,6 +74,7 @@ const STATES: Record<CtaCardType, Record<string, any>> = {
|
|
|
72
74
|
justifyContent: 'center',
|
|
73
75
|
buttonJustifyContent: 'center',
|
|
74
76
|
textMarginLeft: '0',
|
|
77
|
+
textMarginRight: '0',
|
|
75
78
|
},
|
|
76
79
|
right: {
|
|
77
80
|
textAlign: 'left',
|
|
@@ -80,6 +83,7 @@ const STATES: Record<CtaCardType, Record<string, any>> = {
|
|
|
80
83
|
justifyContent: 'start',
|
|
81
84
|
buttonJustifyContent: 'start',
|
|
82
85
|
textMarginLeft: '0',
|
|
86
|
+
textMarginRight: ['0', null, null, null, '10'],
|
|
83
87
|
},
|
|
84
88
|
};
|
|
85
89
|
|
|
@@ -316,6 +320,7 @@ export const Cta: React.FC<CtaProps> = ({ slice }: CtaProps) => {
|
|
|
316
320
|
<Box
|
|
317
321
|
zIndex="base"
|
|
318
322
|
marginLeft={STATES[ctaCardType].textMarginLeft}
|
|
323
|
+
marginRight={STATES[ctaCardType].textMarginRight}
|
|
319
324
|
maxWidth="3xl"
|
|
320
325
|
>
|
|
321
326
|
<Spacer height={['0', null, null, null, '20']} />
|
|
@@ -30,7 +30,7 @@ export const MapHero: React.FC<MapHeroProps> = ({ slice }: MapHeroProps) => {
|
|
|
30
30
|
const [belowBreakpoint] = useMediaQuery(BREAKPOINT_LG_QUERY);
|
|
31
31
|
|
|
32
32
|
return (
|
|
33
|
-
<MapHeroContainer>
|
|
33
|
+
<MapHeroContainer maxWidth="full">
|
|
34
34
|
{slice.shape && (
|
|
35
35
|
<ShapeContainer>
|
|
36
36
|
<Image
|