gatsby-matrix-theme 4.0.3 → 4.0.4
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 +13 -0
- package/package.json +1 -1
- package/src/gatsby-core-theme/components/atoms/spotlights/spotlights-theme.module.scss +1 -0
- package/src/gatsby-core-theme/components/molecules/header/index.js +0 -1
- package/src/gatsby-core-theme/components/organisms/anchor/anchor.module.scss +7 -2
- package/src/gatsby-core-theme/components/organisms/anchor/index.js +25 -14
- package/src/gatsby-core-theme/components/pages/body/index.js +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,16 @@
|
|
|
1
|
+
## [4.0.4](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/compare/v4.0.3...v4.0.4) (2022-02-22)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* add label for anchor title ([43eb394](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/43eb3942cee3dfdaced842f5d765c7a3ba4a4b83))
|
|
7
|
+
* change html structure of anchor ([f56376d](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/f56376d9bf4a527b11f806ed66d3185d46c5f9c1))
|
|
8
|
+
* minor styling fixes ([fed0936](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/fed0936e0a4cc2d396838100bf69408ca82d9497))
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
* Merge branch 'master' of git.ilcd.rocks:team-floyd/themes/matrix-theme ([4fb14fe](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/4fb14fe9b51426c3536119d665994ec289e82f19))
|
|
12
|
+
* Merge branch 'tm-2721-fixhtml-anchor' into 'master' ([032cdb3](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/032cdb3a5ec2177cacde594734c41d326b3ec308))
|
|
13
|
+
|
|
1
14
|
## [4.0.3](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/compare/v4.0.2...v4.0.3) (2022-02-22)
|
|
2
15
|
|
|
3
16
|
|
package/package.json
CHANGED
|
@@ -1,11 +1,15 @@
|
|
|
1
|
-
import React, { useState } from 'react';
|
|
1
|
+
import React, { useContext, useState } from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
|
+
import { Context } from 'gatsby-core-theme/src/context/TranslationsProvider';
|
|
4
|
+
import { translate } from 'gatsby-core-theme/src/helpers/getters';
|
|
3
5
|
import keygen from '~helpers/keygen';
|
|
4
6
|
import { anchorLink } from '~helpers/strings';
|
|
5
7
|
import styles from './anchor.module.scss';
|
|
6
8
|
|
|
7
9
|
function Anchor({ module: { items }, headerOffset = 80, isFixed = false, icon = null }) {
|
|
8
10
|
const [isFixedMenu, setIsFixedMenu] = useState(false);
|
|
11
|
+
const { translations } = useContext(Context) || {};
|
|
12
|
+
|
|
9
13
|
if (isFixed && typeof window !== 'undefined') {
|
|
10
14
|
window.addEventListener('scroll', () => {
|
|
11
15
|
const element = document.getElementById('faq-container').offsetTop - 120;
|
|
@@ -40,19 +44,26 @@ function Anchor({ module: { items }, headerOffset = 80, isFixed = false, icon =
|
|
|
40
44
|
};
|
|
41
45
|
|
|
42
46
|
return (
|
|
43
|
-
|
|
44
|
-
{
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
47
|
+
<>
|
|
48
|
+
<div className={styles.anchorTitle}>
|
|
49
|
+
{translate(translations, 'anchor_title', 'Table of Contents')}
|
|
50
|
+
</div>
|
|
51
|
+
<ul id="faq-container" className={`${styles.anchor} ${isFixedMenu && styles.isFixed}`}>
|
|
52
|
+
{items?.map((anchor) => (
|
|
53
|
+
<li>
|
|
54
|
+
<a
|
|
55
|
+
className={`${styles.link} anchor-carousel-gtm anchor-menu-gtm`}
|
|
56
|
+
key={keygen()}
|
|
57
|
+
onClick={handleClick}
|
|
58
|
+
href={`#${anchor.label && anchorLink(anchor?.label?.toLowerCase().trim())}`}
|
|
59
|
+
>
|
|
60
|
+
{anchor.label}
|
|
61
|
+
{icon}
|
|
62
|
+
</a>
|
|
63
|
+
</li>
|
|
64
|
+
))}
|
|
65
|
+
</ul>
|
|
66
|
+
</>
|
|
56
67
|
);
|
|
57
68
|
}
|
|
58
69
|
|
|
@@ -21,8 +21,8 @@ function Body({ pageContext, children }) {
|
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
if (
|
|
24
|
-
document.domain !== `prelive.${process.env.GATSBY_SITE_NAME}`
|
|
25
|
-
document.domain !== process.env.GATSBY_SITE_NAME
|
|
24
|
+
document.domain !== `prelive.${process.env.GATSBY_SITE_NAME}` &&
|
|
25
|
+
document.domain !== process.env.GATSBY_SITE_NAME &&
|
|
26
26
|
document.domain !== `www.${process.env.GATSBY_SITE_NAME}`
|
|
27
27
|
) {
|
|
28
28
|
// eslint-disable-next-line no-restricted-globals
|