gatsby-core-theme 30.0.45 → 30.0.47

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/CHANGELOG.md CHANGED
@@ -1,3 +1,22 @@
1
+ ## [30.0.47](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/compare/v30.0.46...v30.0.47) (2024-01-08)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * added lang value to .env ([3571ad7](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/3571ad7b0f9b929c13e546a654e313e056b733cf))
7
+ * added prop to hide captions ([ce903f6](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/ce903f67e1f8ff2de59ed976440802633e78e7b3))
8
+ * remove quote marks ([0c5b5d6](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/0c5b5d6e9b85bd8072d3a6bbd18c85968ee44058))
9
+
10
+
11
+ * Merge branch 'tm-3969-html-lang' into 'master' ([b94b620](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/b94b62097c889162e9b18915ef3e4239397971a8))
12
+
13
+ ## [30.0.46](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/compare/v30.0.45...v30.0.46) (2024-01-08)
14
+
15
+
16
+ ### Bug Fixes
17
+
18
+ * spotlight bugs ([d7524c2](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/d7524c21e021ab860576f4279f3a5a353d1fd581))
19
+
1
20
  ## [30.0.45](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/compare/v30.0.44...v30.0.45) (2024-01-05)
2
21
 
3
22
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gatsby-core-theme",
3
- "version": "30.0.45",
3
+ "version": "30.0.47",
4
4
  "description": "Gatsby Theme NPM Package",
5
5
  "author": "",
6
6
  "license": "ISC",
@@ -7,10 +7,15 @@ import LazyImage from '~hooks/lazy-image';
7
7
  import { imagePrettyUrl, getAltText } from '~helpers/getters';
8
8
  import styles from './default-slide.module.scss';
9
9
 
10
- const Slide = ({ item = {}, imageSizes = { width: null, height: 930 }, slideTitle = '' }) => {
10
+ const Slide = ({
11
+ item = {},
12
+ imageSizes = { width: null, height: 930 },
13
+ slideTitle = '',
14
+ hideCaptions = false,
15
+ }) => {
11
16
  return (
12
17
  <>
13
- {item.title && <span className={styles.title || ''}>{item.title}</span>}
18
+ {item.title && !hideCaptions && <span className={styles.title || ''}>{item.title}</span>}
14
19
  {item.image && (
15
20
  <LazyImage
16
21
  className={styles.image || ''}
@@ -35,6 +40,7 @@ Slide.propTypes = {
35
40
  }),
36
41
  primaryBtnText: PropTypes.string,
37
42
  secondaryBtnText: PropTypes.string,
43
+ hideCaptions: PropTypes.bool,
38
44
  imageSizes: PropTypes.shape({ width: PropTypes.any, height: PropTypes.any }),
39
45
  slideTitle: PropTypes.string,
40
46
  };
@@ -7,24 +7,31 @@ import styles from './template-one.module.scss';
7
7
 
8
8
  export default function TemplateOne({ module }) {
9
9
  const { items } = module;
10
+
11
+ const content = (res) => (
12
+ <>
13
+ {res?.icon && (
14
+ <LazyImage height={106} width={106} src={imagePrettyUrl(res?.icon)} alt={res?.link_text} />
15
+ )}
16
+ {res?.link_text && <p>{res?.link_text}</p>}
17
+ {res.subtitle && <span>{res.subtitle}</span>}
18
+ </>
19
+ );
20
+
10
21
  return (
11
22
  <div className={styles?.spotlightsIcon || ''}>
12
23
  {
13
24
  // eslint-disable-next-line react/prop-types
14
- items?.map((res) => (
15
- <Link to={res?.link?.value} external={res?.link?.type === 'external'}>
16
- {res?.icon && (
17
- <LazyImage
18
- height={106}
19
- width={106}
20
- src={imagePrettyUrl(res?.icon)}
21
- alt={res?.link_text}
22
- />
23
- )}
24
- {res?.link_text && <p>{res?.link_text}</p>}
25
- {res.subtitle && <span>{res.subtitle}</span>}
26
- </Link>
27
- ))
25
+ items?.map((res) => {
26
+ if (res.link?.value) {
27
+ return (
28
+ <Link to={res?.link?.value} external={res?.link?.type === 'external'}>
29
+ {content(res)}
30
+ </Link>
31
+ );
32
+ }
33
+ return <div>{content(res)}</div>;
34
+ })
28
35
  }
29
36
  </div>
30
37
  );
@@ -31,16 +31,20 @@ export default function TemplateOne({ module, scrollableContent = false }) {
31
31
  />
32
32
  </div>
33
33
 
34
- <Button
35
- icon={<FaArrowRight />}
36
- buttonType="secondary"
37
- buttonSize="m"
38
- isInternalLink={res?.link?.type !== 'page'}
39
- to={res?.link?.value}
40
- btnText={
41
- res?.link_text || translate(translations, 'read_review_spotlight', 'Read review')
42
- }
43
- />
34
+ {res?.link?.value && (
35
+ <Button
36
+ icon={<FaArrowRight />}
37
+ buttonType="secondary"
38
+ buttonSize="m"
39
+ isInternalLink={res?.link?.type !== 'external'}
40
+ targetBlank={res?.link?.type !== 'page'}
41
+ to={res?.link?.value}
42
+ btnText={
43
+ res?.link_text ||
44
+ translate(translations, 'read_review_spotlight', 'Read review')
45
+ }
46
+ />
47
+ )}
44
48
  </div>
45
49
  );
46
50
  })
@@ -20,8 +20,9 @@
20
20
  @include flex-direction(column);
21
21
  @include flex-align(start, space-between);
22
22
  > a {
23
- height: 5.6rem;
23
+ min-height: 5.6rem;
24
24
  width: 100%;
25
+ white-space: normal;
25
26
  }
26
27
  }
27
28
  .topSection {
@@ -34,13 +35,25 @@
34
35
  border-radius: 1.6rem;
35
36
  margin-bottom: 0.8rem;
36
37
  }
37
- > label {
38
+
39
+
40
+ a > label,
41
+ a > span,
42
+ a > h1,
43
+ a > h2,
44
+ a > h3,
45
+ > label,
46
+ > span,
47
+ > h1,
48
+ > h2,
49
+ > h3 {
38
50
  color: var(--spotlight-template-one-label-image-text-mode, #1b1b1c);
39
51
  font-size: 2rem;
40
52
  font-style: normal;
41
53
  font-weight: 700;
42
54
  line-height: 2.8rem;
43
55
  text-transform: capitalize;
56
+ margin: 0 !important;
44
57
  }
45
58
  }
46
59
 
@@ -49,7 +49,8 @@ export default function TemplateOne({ item, readMore = false, scrollableContent
49
49
  icon={<FaArrowRight />}
50
50
  buttonType="secondary"
51
51
  buttonSize="m"
52
- isInternalLink={item?.link?.type !== 'page'}
52
+ isInternalLink={item?.link?.type !== 'external'}
53
+ targetBlank={item?.link?.type !== 'page'}
53
54
  to={item?.link?.value}
54
55
  btnText={
55
56
  item?.link_text || translate(translations, 'read_review_spotlight', 'Read review')
@@ -27,17 +27,20 @@ export default function TemplateOne({ module }) {
27
27
  {res.subtitle && <span>{res.subtitle}</span>}
28
28
  <div className={`${styles.desc}`} dangerouslySetInnerHTML={{ __html: res?.text }} />
29
29
  </div>
30
-
31
- <Button
32
- icon={<FaArrowRight />}
33
- buttonType="secondary"
34
- buttonSize="m"
35
- isInternalLink={res?.link?.type !== 'page'}
36
- to={res?.link?.value}
37
- btnText={
38
- res?.link_text || translate(translations, 'read_review_spotlight', 'Read review')
39
- }
40
- />
30
+ {res?.link?.value && (
31
+ <Button
32
+ icon={<FaArrowRight />}
33
+ buttonType="secondary"
34
+ buttonSize="m"
35
+ isInternalLink={res?.link?.type !== 'external'}
36
+ targetBlank={res?.link?.type !== 'page'}
37
+ to={res?.link?.value}
38
+ btnText={
39
+ res?.link_text ||
40
+ translate(translations, 'read_review_spotlight', 'Read review')
41
+ }
42
+ />
43
+ )}
41
44
  </div>
42
45
  );
43
46
  })
@@ -20,8 +20,9 @@
20
20
  @include flex-direction(column);
21
21
  @include flex-align(start, space-between);
22
22
  > a {
23
- height: 5.6rem;
23
+ min-height: 5.6rem;
24
24
  width: 100%;
25
+ white-space: normal;
25
26
  }
26
27
  }
27
28
  .topSection {
@@ -35,7 +36,18 @@
35
36
  border-radius: 100%;
36
37
  margin-bottom: 1.6rem;
37
38
  }
38
- > label {
39
+
40
+
41
+ a > label,
42
+ a > span,
43
+ a > h1,
44
+ a > h2,
45
+ a > h3,
46
+ > label,
47
+ > span,
48
+ > h1,
49
+ > h2,
50
+ > h3 {
39
51
  color: var(--spotlight-template-two-label-image-text-mode, #1b1b1c);
40
52
  font-size: 2rem;
41
53
  font-style: normal;
@@ -44,7 +56,9 @@
44
56
  text-transform: capitalize;
45
57
  text-align: center;
46
58
  }
47
- > span {
59
+
60
+
61
+ a > span, > span {
48
62
  color: #64646d;
49
63
  text-align: center;
50
64
  font-size: 1.4rem;
@@ -6,6 +6,7 @@ import { getUrl, getPageImage, imagePrettyUrl } from '~helpers/getters';
6
6
  import keygen from '~helpers/keygen';
7
7
 
8
8
  export function getLanguage(language) {
9
+ if (process.env.GATSBY_SITE_LANG) return process.env.GATSBY_SITE_LANG;
9
10
  if (language === 'no') return 'nb-NO';
10
11
  return language || 'en';
11
12
  }