gatsby-core-theme 38.0.1 → 38.0.3

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,39 @@
1
+ ## [38.0.3](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/compare/v38.0.2...v38.0.3) (2024-09-02)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * edit page admin bar ([c3bc9c6](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/c3bc9c640e4cd65461af0be28cf288a13da4ded4))
7
+ * styling for storybook ([d677898](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/d67789874f09f00b2fdd8ef3aa886ab591027bba))
8
+ * styling for storybook ([40b45b1](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/40b45b19ac2aef925585c6ef0a6c85770ed8433c))
9
+ * styling for storybook ([189fdb8](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/189fdb8ca98cb6f67cbdbb87484f6d098859ce7c))
10
+ * styling for storybook ([3a63b68](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/3a63b68831086abcec57f293d6497bb0bd3a396c))
11
+ * styling for storybook ([53d0e13](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/53d0e13c174cec2ef0be061605823b9e6d55777e))
12
+ * styling for storybook ([93c65e9](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/93c65e941ce0388cbea504547cb33431a4eb363c))
13
+ * styling for storybook ([2b329a3](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/2b329a316fd134644750290cd2705edee5e42ed3))
14
+ * styling for storybook ([cc388af](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/cc388af8f1860ac19827ce9002d72b8de4386d20))
15
+ * styling for storybook ([aa73531](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/aa73531e10513123425c3fa874cff1ae7e150a68))
16
+ * styling for storybook ([85e8a22](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/85e8a228ae61e28a72246360bf26ada0a424848f))
17
+
18
+
19
+ ### Code Refactoring
20
+
21
+ * correction to path ([95d6f32](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/95d6f32f08103ecb06db890d6747d9fb03855f4c))
22
+ * remove stylelint scss rule ([66e920e](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/66e920e6c29768d76d5419ee770241047c49f8b8))
23
+
24
+
25
+ * Merge branch 'tm-4567-feedback-modal' into 'master' ([2d4383e](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/2d4383e86bc0cf5683e2516ac5fc5fd5be737f0e))
26
+ * Merge branch 'master' into tm-4567-feedback-modal ([32226c7](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/32226c78ccb26c0d70e7930a7848ee802251c9bc))
27
+
28
+ ## [38.0.2](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/compare/v38.0.1...v38.0.2) (2024-09-02)
29
+
30
+
31
+ ### Bug Fixes
32
+
33
+ * added Admin bar ([b018a7e](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/b018a7e34c1f29af2e83ea03b91dec0bc286df36))
34
+ * edit page admin bar ([080fb4e](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/080fb4efa91fcfe41a40c6ffbed7e809c0855b15))
35
+ * site name env ([e9122bb](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/e9122bbe969790ee8ed998e011ace4d6db8c2929))
36
+
1
37
  ## [38.0.1](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/compare/v38.0.0...v38.0.1) (2024-08-30)
2
38
 
3
39
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gatsby-core-theme",
3
- "version": "38.0.1",
3
+ "version": "38.0.3",
4
4
  "description": "Gatsby Theme NPM Package",
5
5
  "author": "",
6
6
  "license": "ISC",
@@ -0,0 +1,30 @@
1
+ .container {
2
+ background-color: #23282d;
3
+ }
4
+
5
+ .innerContainer {
6
+ max-width: var(--main-container-max);
7
+ margin: 0 auto;
8
+
9
+ @include flex-align(center, space-between);
10
+
11
+ a, span {
12
+ color: #fff;
13
+ font-size: 1.3rem;
14
+ padding: 1rem 2rem;
15
+ }
16
+
17
+ a {
18
+ @include flex-align(center, center);
19
+
20
+ gap: .5rem;
21
+
22
+ &:hover {
23
+ background-color: #32373c;
24
+ color: #00b9eb;
25
+ }
26
+ }
27
+ }
28
+
29
+
30
+
@@ -0,0 +1,17 @@
1
+ /* eslint-disable no-unused-expressions */
2
+ import React from "react";
3
+ import { render } from "@testing-library/react";
4
+ import "@testing-library/jest-dom/extend-expect";
5
+ import Admin from ".";
6
+
7
+ describe("OperatorCtaButton Component", () => {
8
+ test("OperatorCtaButton with status active", () => {
9
+ const { getByText, container } = render(
10
+ <Admin page={{ id:123 } } />
11
+ );
12
+
13
+ expect(getByText("Edit Page")).toBeInTheDocument();
14
+ expect(container.querySelector('a').getAttribute('href')).toBe('https://hercules.g2m.com/site-pages/123');
15
+
16
+ });
17
+ });
@@ -0,0 +1,24 @@
1
+ import React from "react";
2
+ import { FaEdit } from '@react-icons/all-files/fa/FaEdit';
3
+ import styles from "./admin.module.scss";
4
+
5
+ const index = ({ page }) => (
6
+ <div className={styles.container}>
7
+ <div className={styles.innerContainer}>
8
+ <span>Hercules CMS</span>
9
+ <ul>
10
+ <li>
11
+ <a
12
+ target="_blank"
13
+ href={`${process.env.HERCULES_BACKEND_URL}site-pages/${page.id}`}
14
+ rel="noreferrer"
15
+ >
16
+ <FaEdit /> Edit Page
17
+ </a>
18
+ </li>
19
+ </ul>
20
+ </div>
21
+ </div>
22
+ );
23
+
24
+ export default index;
@@ -1,5 +1,5 @@
1
1
  /* eslint-disable import/no-named-as-default */
2
- import React, { useRef } from "react";
2
+ import React, { useRef, useEffect, useState } from "react";
3
3
  import PropTypes from "prop-types";
4
4
  import Search from "~organisms/search";
5
5
  import Link from "~hooks/link";
@@ -8,6 +8,8 @@ import MarketDropdown from "~atoms/market-dropdown";
8
8
  import Notifications from "~atoms/notifications";
9
9
  import { toggleScroll } from "~helpers/scroll";
10
10
  import ConditionalWrapper from "~atoms/conditional-wrapper";
11
+ import { getCookie } from "~helpers/cookies";
12
+ import Admin from "~atoms/admin";
11
13
  import Sticky from "~molecules/sticky";
12
14
  import CustomComponent from "~atoms/menu/variables";
13
15
  import { pageTypes } from "../../../constants/site-settings/navigation";
@@ -36,16 +38,17 @@ const Navigation = ({
36
38
  megaMenu = false,
37
39
  menu,
38
40
  }) => {
41
+ const [showAdminBar, setShowAdminBar] = useState(false);
39
42
  const navRef = useRef(React.createRef());
40
43
  const showMenu =
41
44
  pageTypes[template]?.showNavMenu ?? pageTypes.default.showNavMenu;
42
-
45
+
43
46
  const showNotifications =
44
47
  pageTypes[template]?.showNotification ?? pageTypes.default.showNotification;
45
48
 
46
49
  let searchURLPageName = "s";
47
50
 
48
- const showLogoWithLink =
51
+ const showLogoWithLink =
49
52
  pageTypes[template]?.showLogoWithLink ?? pageTypes.default.showLogoWithLink;
50
53
 
51
54
  const logoImg = (
@@ -76,6 +79,15 @@ const Navigation = ({
76
79
  }
77
80
  };
78
81
 
82
+ useEffect(() => {
83
+ if (
84
+ typeof window !== `undefined` &&
85
+ getCookie("showAdminBar") === "true"
86
+ ) {
87
+ setShowAdminBar(true);
88
+ }
89
+ }, []);
90
+
79
91
  return (
80
92
  <ConditionalWrapper
81
93
  condition={sticky}
@@ -90,6 +102,7 @@ const Navigation = ({
90
102
  </Sticky>
91
103
  )}
92
104
  >
105
+ {showAdminBar && <Admin page={pageContext.page} />}
93
106
  <nav className={styles.nav || ""} ref={navRef}>
94
107
  <NavigationProvider>
95
108
  {showMenu && showLogoWithLink ? (
@@ -102,7 +115,7 @@ const Navigation = ({
102
115
  {logoImg}
103
116
  </Link>
104
117
  ) : (
105
- <div className={`${styles.logo || ''}`}>{logoImg}</div>
118
+ <div className={`${styles.logo || ""}`}>{logoImg}</div>
106
119
  )}
107
120
  {showMenu && (
108
121
  <>
@@ -12,7 +12,7 @@
12
12
  height: 100vh;
13
13
  top: 0;
14
14
  left: 0;
15
- z-index: --custom-zindex(modal);
15
+ z-index: map.get($z-index, modal);
16
16
  }
17
17
 
18
18
  .activeModal {
@@ -26,7 +26,7 @@
26
26
  height: 100vh;
27
27
  top: 0;
28
28
  left: 0;
29
- z-index: --custom-zindex(modal);
29
+ z-index: map.get($z-index, modal);
30
30
  }
31
31
 
32
32
  .modalContent {
@@ -37,7 +37,7 @@
37
37
  width: 100%;
38
38
  max-width: calc(var(--main-container-max) - 48px);
39
39
  border-radius: 1rem;
40
- z-index: --custom-zindex(modal);
40
+ z-index: map.get($z-index, modal);
41
41
  position: relative;
42
42
  }
43
43
 
@@ -0,0 +1 @@
1
+ @use 'sass:map';
@@ -1,6 +1,6 @@
1
- // Global styles extended in each theme
2
-
3
- // Utils
1
+ /* stylelint-disable no-invalid-position-at-import-rule */
2
+ @use 'sass:map';
3
+ // NOTE: Styles
4
4
  @import './utils/variables/typography';
5
5
  @import './utils/variables/layout';
6
6
  @import './utils/variables/stack-order';
@@ -10,4 +10,4 @@
10
10
  @import './utils/loader';
11
11
  @import './utils/mixins';
12
12
  @import './utils/scrollbar';
13
- @import './utils/animations';
13
+ @import './utils/animations';
@@ -1,5 +1,3 @@
1
- @use 'sass:map';
2
-
3
1
  $z-index: (
4
2
  modal: var(--modal-index),
5
3
  navigation: var(--navigation-index),
@@ -9,8 +7,4 @@ $z-index: (
9
7
  above-content: 1,
10
8
  content: 0,
11
9
  below-content: -1,
12
- );
13
-
14
- @function --custom-zindex($key){
15
- @return map.get($z-index, $key);
16
- };
10
+ );
package/tests/envVars.js CHANGED
@@ -3,7 +3,7 @@ process.env.GATSBY_SITE_URL = 'http://urltest.com/';
3
3
  process.env.IMAGE_CDN_URL = 'https://cdn.images.com';
4
4
  process.env.TRACKER_LINK_FORMAT_MAIN = '[no],[visit],short_name';
5
5
  process.env.TRACKER_LINK_FORMAT_NON_MAIN = '[no],[visit],short_name,type,[tracker]';
6
-
6
+ process.env.HERCULES_BACKEND_URL="https://hercules.g2m.com/"
7
7
  process.env.SITE_ID = 82;
8
8
  process.env.GATSBY_TRACKING_API_URL = 'testlink';
9
9
  process.env.IS_TRACKING_SSR = true;