@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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@treely/strapi-slices",
3
- "version": "4.4.5",
3
+ "version": "4.4.7",
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.",
@@ -341,7 +341,7 @@ export const Cta: React.FC<CtaProps> = ({ slice }: CtaProps) => {
341
341
  }}
342
342
  title={ctaCard.title}
343
343
  titleProps={{
344
- fontFamily: 'Inter',
344
+ fontFamily: 'heading',
345
345
  fontSize: '4xl',
346
346
  fontWeight: '600',
347
347
  lineHeight: '9',
@@ -106,7 +106,7 @@ export const Facts: React.FC<FactsProps> = ({ slice }: FactsProps) => (
106
106
  >
107
107
  <Heading
108
108
  fontSize="6xl"
109
- fontFamily="GintoNord"
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
- <Box
34
- id={convertToKebabCase(slice.title)}
35
- position="relative"
36
- paddingTop="28"
37
- paddingBottom={!!slice.hero ? '80' : '28'}
38
- >
39
- {slice.shapes && slice.shapes.length === 2 && (
40
- <>
41
- <Shape
42
- shape={
43
- <Image
44
- src={strapiMediaUrl(slice.shapes[0].img, 'small')}
45
- alt={slice.shapes[0].alt}
46
- fill
47
- style={{ objectFit: slice.shapes[0].objectFit || 'cover' }}
48
- />
49
- }
50
- top="0"
51
- right="0"
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
- image={
123
- slice.hero.image && (
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.hero.image.img, 'xLarge')}
126
- alt={slice.hero.image.alt}
62
+ src={strapiMediaUrl(slice.shapes[1].img, 'small')}
63
+ alt={slice.shapes[1].alt}
127
64
  fill
128
- style={{ objectFit: slice.hero.image.objectFit || 'cover' }}
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
+ };