gatsby-matrix-theme 3.0.5 → 3.0.9

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.
Files changed (21) hide show
  1. package/CHANGELOG.md +52 -0
  2. package/package.json +2 -2
  3. package/src/gatsby-core-theme/components/molecules/content/content.module.scss +34 -1
  4. package/src/gatsby-core-theme/components/molecules/content/index.js +15 -3
  5. package/src/gatsby-core-theme/components/molecules/main/index.js +2 -2
  6. package/src/gatsby-core-theme/components/organisms/head/index.js +2 -1
  7. package/src/gatsby-core-theme/components/organisms/navigation/index.js +9 -1
  8. package/src/gatsby-core-theme/components/pages/body/index.js +7 -6
  9. package/storybook/public/{5.58b2efe7.iframe.bundle.js → 5.6fafb5f4.iframe.bundle.js} +3 -3
  10. package/storybook/public/{5.58b2efe7.iframe.bundle.js.LICENSE.txt → 5.6fafb5f4.iframe.bundle.js.LICENSE.txt} +0 -0
  11. package/storybook/public/5.6fafb5f4.iframe.bundle.js.map +1 -0
  12. package/storybook/public/iframe.html +1 -1
  13. package/storybook/public/main.4c12afb7.iframe.bundle.js +1 -0
  14. package/storybook/public/{runtime~main.39a81a69.iframe.bundle.js → runtime~main.7b867edc.iframe.bundle.js} +1 -1
  15. package/storybook/public/vendors~main.be5d297a.iframe.bundle.js +7 -0
  16. package/storybook/public/{vendors~main.cc70e3aa.iframe.bundle.js.LICENSE.txt → vendors~main.be5d297a.iframe.bundle.js.LICENSE.txt} +0 -0
  17. package/storybook/public/vendors~main.be5d297a.iframe.bundle.js.map +1 -0
  18. package/storybook/public/5.58b2efe7.iframe.bundle.js.map +0 -1
  19. package/storybook/public/main.436e9745.iframe.bundle.js +0 -1
  20. package/storybook/public/vendors~main.cc70e3aa.iframe.bundle.js +0 -7
  21. package/storybook/public/vendors~main.cc70e3aa.iframe.bundle.js.map +0 -1
package/CHANGELOG.md CHANGED
@@ -1,3 +1,55 @@
1
+ ## [3.0.9](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/compare/v3.0.8...v3.0.9) (2021-12-09)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * added loadable ([2caaf41](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/2caaf41131f0fcb1caa8eeb65ec886fd11963489))
7
+
8
+
9
+ * Merge branch 'master' of git.ilcd.rocks:team-floyd/themes/matrix-theme ([e171920](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/e1719202cc8e06e3904dd84b0089caf9af65dcc5))
10
+
11
+ ## [3.0.8](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/compare/v3.0.7...v3.0.8) (2021-12-09)
12
+
13
+
14
+ ### Bug Fixes
15
+
16
+ * moved footer navigation before main content ([bf923b2](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/bf923b2660f3e826668b89814890793baa37f6a9))
17
+
18
+ ## [3.0.7](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/compare/v3.0.6...v3.0.7) (2021-12-07)
19
+
20
+
21
+ ### Bug Fixes
22
+
23
+ * canonical url generator ([32b68cd](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/32b68cd094fb1492db12d863fc986f680e8476e8))
24
+
25
+
26
+ * Merge branch 'master' of git.ilcd.rocks:team-floyd/themes/matrix-theme ([a7d5f57](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/a7d5f5766f182b2d062a3bb277d6e8db8e5e62e1))
27
+
28
+ ## [3.0.6](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/compare/v3.0.5...v3.0.6) (2021-12-07)
29
+
30
+
31
+ ### Bug Fixes
32
+
33
+ * content read more ([6f00226](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/6f00226ebc277e02a78103e9987871200af0bb17))
34
+ * issue fix ([ac5b5e6](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/ac5b5e67e43d31d67cf0c37ecfbf0eb0c979323c))
35
+ * small style issue ([2e32e03](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/2e32e03904e809a3d2cc1ed444fc5dd1fc16cdeb))
36
+
37
+
38
+ ### Code Refactoring
39
+
40
+ * add custom styles to menu ([5fb35db](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/5fb35db8cdc8a4afdb72a768e62ff8c49661371c))
41
+
42
+
43
+ ### Config
44
+
45
+ * update core theme ([e2885b8](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/e2885b856a689cc0f2501d87d39d4f6e92b40f37))
46
+ * updated core theme ([2d2e722](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/2d2e72239cba3cf0f6239fede523adf901ee21de))
47
+ * updated core version ([6c83579](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/6c8357910c12a57d527d691afaab74f2e6debc89))
48
+
49
+
50
+ * Merge branch 'show-more-content' into 'master' ([dfbe31f](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/dfbe31fd8cf1788ab3546f8ff0663ea5e21bd1e3))
51
+ * Merge branch 'tm-navigation-sticky' into 'master' ([239e204](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/239e2044d341183d843ed06548cfa330b3358bc4))
52
+
1
53
  ## [3.0.5](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/compare/v3.0.4...v3.0.5) (2021-12-02)
2
54
 
3
55
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gatsby-matrix-theme",
3
- "version": "3.0.5",
3
+ "version": "3.0.9",
4
4
  "main": "index.js",
5
5
  "description": "Matrix Theme NPM Package",
6
6
  "author": "",
@@ -31,7 +31,7 @@
31
31
  "cross-env": "^7.0.2",
32
32
  "dotenv": "8.2.0",
33
33
  "gatsby": "^3.3.1",
34
- "gatsby-core-theme": "^1.6.15",
34
+ "gatsby-core-theme": "^1.6.21",
35
35
  "gatsby-image": "^3.3.0",
36
36
  "gatsby-plugin-image": "^1.3.1",
37
37
  "gatsby-plugin-postcss": "^4.3.0",
@@ -129,7 +129,7 @@
129
129
  td {
130
130
  color: white !important;
131
131
  background: var(--table-head-background);
132
-
132
+
133
133
  border-radius: 0;
134
134
 
135
135
  &:first-child {
@@ -237,6 +237,39 @@
237
237
  }
238
238
  }
239
239
  }
240
+
241
+ @include max(mobile) {
242
+ &.showMore {
243
+ max-height: 17.8rem;
244
+ overflow: hidden;
245
+ position: relative;
246
+
247
+ &::before {
248
+ content: '';
249
+ position: absolute;
250
+ transition: all .25s ease-in-out;
251
+ height: 4rem;
252
+ right: 0;
253
+ bottom: 0;
254
+ left: 0;
255
+ background-image: linear-gradient(to bottom, rgba(209, 209, 209, 0), #ffffff);
256
+ }
257
+ }
258
+ }
259
+ }
260
+
261
+ .button {
262
+ margin: 3rem 0 0 1.6rem !important;
263
+ border: 2px solid #171f49;
264
+ width: calc(100% - 3.2rem);
265
+ font-style: normal;
266
+ font-weight: bold;
267
+ font-size: 1.8rem;
268
+ line-height: 3rem;
269
+ color: #171f49;
270
+ @include min(tablet) {
271
+ display: none;
272
+ }
240
273
  }
241
274
 
242
275
  .floatLeft {
@@ -1,13 +1,16 @@
1
+ /* eslint-disable camelcase */
1
2
  /* eslint-disable import/no-extraneous-dependencies */
2
- import React from 'react';
3
+ import React, { useState } from 'react';
3
4
  import parse from 'html-react-parser';
4
5
  import PropTypes from 'prop-types';
5
-
6
6
  import LazyImage from 'gatsby-core-theme/src/hooks/lazy-image';
7
7
  import { parseCss } from 'gatsby-core-theme/src/helpers/css-parser';
8
8
  import styles from './content.module.scss';
9
9
 
10
10
  const Content = ({ module }) => {
11
+ const { show_more_label, show_more_enabled } = module || {};
12
+ const [showMore, setShowMore] = useState(show_more_enabled === '1');
13
+
11
14
  const replaceMedia = (node) => {
12
15
  if (node.name === 'img') {
13
16
  let stylesClass = null;
@@ -64,9 +67,13 @@ const Content = ({ module }) => {
64
67
  }
65
68
  };
66
69
 
70
+ const handleChange = () => {
71
+ setShowMore(!showMore);
72
+ };
73
+
67
74
  return (
68
75
  <>
69
- <div className={styles.content}>
76
+ <div className={`${styles.content} ${showMore && styles.showMore}`}>
70
77
  <div className={`${switchStyle(module.style)}`}>
71
78
  {module.value &&
72
79
  parse(module.value, {
@@ -74,6 +81,11 @@ const Content = ({ module }) => {
74
81
  })}
75
82
  </div>
76
83
  </div>
84
+ {showMore && (
85
+ <button type="button" className={styles.button} onClick={handleChange}>
86
+ {show_more_label}
87
+ </button>
88
+ )}
77
89
  </>
78
90
  );
79
91
  };
@@ -7,7 +7,6 @@ import Module from 'gatsby-core-theme/src/components/molecules/module';
7
7
 
8
8
  import styles from 'gatsby-core-theme/src/components/molecules/main/main.module.scss';
9
9
  import keygen from 'gatsby-core-theme/src/helpers/keygen';
10
- import AuthorBox from 'gatsby-core-theme/src/components/atoms/author-box';
11
10
  import Newsletter from '../../../../components/molecules/newsletter';
12
11
 
13
12
  const Main = ({ section = {}, pageContext = {}, showNewsletter = false }) => {
@@ -27,6 +26,7 @@ const Main = ({ section = {}, pageContext = {}, showNewsletter = false }) => {
27
26
  const NotFound = page.path.includes('404')
28
27
  ? loadable(() => import(`gatsby-core-theme/src/components/atoms/not-found`))
29
28
  : null;
29
+ const AuthorBox = page.author ? loadable(() => import(`~atoms/author-box`)) : null;
30
30
 
31
31
  return (
32
32
  <main className={styles.modulePage}>
@@ -39,7 +39,7 @@ const Main = ({ section = {}, pageContext = {}, showNewsletter = false }) => {
39
39
  {SearchPage && <SearchPage page={page} />}
40
40
  {showNewsletter && <Newsletter page={page} />}
41
41
  {NewsletterSuccess && showNewsletter && <NewsletterSuccess />}
42
- {page.author && <AuthorBox author={page.author} />}
42
+ {AuthorBox && <AuthorBox author={page.author} />}
43
43
  </main>
44
44
  );
45
45
  };
@@ -21,7 +21,8 @@ export function getCanonicalUrl(page) {
21
21
  if (page.path === '/') {
22
22
  return process.env.GATSBY_SITE_URL;
23
23
  }
24
- return `${process.env.GATSBY_SITE_URL}${page.path}`;
24
+
25
+ return `${process.env.GATSBY_SITE_URL}${page.path.replace(/^\//, '')}`;
25
26
  }
26
27
  export function getRobotOptions(options) {
27
28
  const array = [];
@@ -32,6 +32,7 @@ const Navigation = ({
32
32
  sticky = true,
33
33
  template,
34
34
  children,
35
+ customStyles,
35
36
  }) => {
36
37
  const navRef = useRef(React.createRef());
37
38
  const showMenu = template !== 'ppc';
@@ -74,7 +75,13 @@ const Navigation = ({
74
75
  </Link>
75
76
  {showMenu && (
76
77
  <>
77
- <Menu section={section} menu={menu} options={options} gtmClass="main-menu-gtm" />
78
+ <Menu
79
+ section={section}
80
+ menu={menu}
81
+ options={options}
82
+ customStyles={customStyles}
83
+ gtmClass="main-menu-gtm"
84
+ />
78
85
  {hasSearch && <SearchForm className={styles.search} searchIcon={searchIcon} />}
79
86
  </>
80
87
  )}
@@ -121,6 +128,7 @@ Navigation.propTypes = {
121
128
  }),
122
129
  }),
123
130
  sticky: PropTypes.bool,
131
+ customStyles: PropTypes.string,
124
132
  };
125
133
 
126
134
  export default Navigation;
@@ -4,7 +4,6 @@ import PropTypes from 'prop-types';
4
4
  import loadable from '@loadable/component';
5
5
  import { getSection } from 'gatsby-core-theme/src/helpers/getters';
6
6
  import Navigation from 'gatsby-core-theme/src/components/organisms/navigation';
7
- import OperatorBanner from 'gatsby-core-theme/src/components/molecules/operator-banner';
8
7
  import ScrollToTop from 'gatsby-core-theme/src/components/atoms/scroll-to-top';
9
8
  import CookieConsent from 'gatsby-core-theme/src/components/organisms/cookie-consent';
10
9
  import Main from 'gatsby-core-theme/src/components/molecules/main';
@@ -52,6 +51,11 @@ function Body({ pageContext, children }) {
52
51
  ? loadable(() => import(`../../../../components/organisms/footer-navigation`))
53
52
  : null;
54
53
 
54
+ const OperatorBanner =
55
+ pageType === 'operator' && !hideBanner
56
+ ? loadable(() => import(`gatsby-core-theme/src/components/molecules/operator-banner`))
57
+ : null;
58
+
55
59
  return (
56
60
  <>
57
61
  {navigation && (
@@ -74,6 +78,7 @@ function Body({ pageContext, children }) {
74
78
  }}
75
79
  />
76
80
  )}
81
+ {FooterNavigation && <FooterNavigation section={footerNavigationData} />}
77
82
  {ContactUs ? (
78
83
  <ContactUs page={pageContext} />
79
84
  ) : (
@@ -81,7 +86,7 @@ function Body({ pageContext, children }) {
81
86
  {!isSearch && !is404 && <Header section={pageContext} />}
82
87
  {main && !children && <Main section={main} pageContext={pageContext} />}
83
88
  {children && <main>{children}</main>}
84
- {pageType === 'operator' && !hideBanner && (
89
+ {OperatorBanner && (
85
90
  <OperatorBanner
86
91
  template={template}
87
92
  sticky
@@ -97,12 +102,8 @@ function Body({ pageContext, children }) {
97
102
  )}
98
103
  </>
99
104
  )}
100
-
101
105
  <ScrollToTop />
102
106
  {OpenGraph && <OpenGraph text="Del på" page={pageContext?.page} />}
103
-
104
- {FooterNavigation && <FooterNavigation section={footerNavigationData} />}
105
-
106
107
  <Footer
107
108
  footerTopCustom={FooterTop}
108
109
  footerBottomCustom={FooterBottom}