@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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@treely/strapi-slices",
3
- "version": "4.4.0",
3
+ "version": "4.4.2",
4
4
  "license": "MIT",
5
5
  "author": "Tree.ly GmbH",
6
6
  "description": "@treely/strapi-slices is a open source library maintained by Tree.ly.",
@@ -252,9 +252,8 @@ const SmallCheckout = ({
252
252
  {button && (
253
253
  <StrapiLinkButton
254
254
  link={{
255
- id: 1,
256
255
  intercomLauncher: true,
257
- text: button.text,
256
+ ...button,
258
257
  }}
259
258
  variant="outline"
260
259
  />
@@ -13,8 +13,8 @@ interface StrapiBlogPost {
13
13
  slug: string;
14
14
  teaser: string | null;
15
15
  img: StrapiImage;
16
- author?: IStrapi<IStrapiData<StrapiAuthor>>;
17
- category?: IStrapi<IStrapiData<StrapiCategory>>;
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
 
@@ -5,7 +5,7 @@ import StrapiLinkPage from './StrapiLinkPage';
5
5
  interface StrapiLink {
6
6
  id: number;
7
7
  text: string;
8
- page?: IStrapi<IStrapiData<StrapiLinkPage>>;
8
+ page?: IStrapi<IStrapiData<StrapiLinkPage> | null>;
9
9
  url?: string;
10
10
  intercomLauncher?: boolean;
11
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
 
@@ -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,
@@ -12,6 +12,7 @@ const defaultProps: BlogCardsProps = {
12
12
  title: 'Main Title',
13
13
  subTitle: 'Subtitle',
14
14
  variant: 'white',
15
+ blogPostCategory: { data: null },
15
16
  },
16
17
  blogPosts: [strapiBlogPostMock],
17
18
  };
@@ -34,7 +34,7 @@ export interface BlogCardsProps {
34
34
  subTitle: string;
35
35
  button?: StrapiLink;
36
36
  variant: 'white' | 'gray';
37
- blogPostCategory?: IStrapi<IStrapiData<StrapiCategory>>;
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?.data.attributes.name ===
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.attributes.name}
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: (
@@ -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