gatsby-core-theme 1.2.2 → 1.2.6

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,44 @@
1
+ ## [1.2.6](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/compare/v1.2.5...v1.2.6) (2021-10-12)
2
+
3
+
4
+ ### Code Refactoring
5
+
6
+ * add once property to lazy images ([8487472](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/84874723d6f43816b2791f93ef75709f8bff393c))
7
+ * add once property to link-list to be passed to lazyload images ([2bbe3a0](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/2bbe3a0ede23f2eb49f6e293b7e247ded6b695fe))
8
+
9
+
10
+ * Merge branch 'tm-2496-once-lazy-images' into 'master' ([dea0f3c](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/dea0f3cb167bd8163c373990988613648c088508))
11
+
12
+ ## [1.2.5](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/compare/v1.2.4...v1.2.5) (2021-10-11)
13
+
14
+
15
+ ### Config
16
+
17
+ * settings update for playcasino ([49d215c](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/49d215cc6517706caac472f237d66b73e0ddd3b5))
18
+
19
+
20
+ * Merge branch 'master' of git.ilcd.rocks:team-floyd/themes/gatsby-themes ([87cbf84](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/87cbf843f04d6d4d14743d7cefc17fe1f1310d53))
21
+
22
+ ## [1.2.4](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/compare/v1.2.3...v1.2.4) (2021-10-11)
23
+
24
+
25
+ ### Config
26
+
27
+ * settings update for playcasino ([c258327](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/c2583274f107254c9089cae2adc4f1807bc5787b))
28
+
29
+
30
+ * Merge branch 'master' of git.ilcd.rocks:team-floyd/themes/gatsby-themes ([2e516a2](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/2e516a23c2b2b177aeb3c03accf732c7c1c4bd48))
31
+
32
+ ## [1.2.3](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/compare/v1.2.2...v1.2.3) (2021-10-08)
33
+
34
+
35
+ ### Code Refactoring
36
+
37
+ * removing all style/css props in components ([a99ca6d](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/a99ca6dd8637fbec5edcf68924c33c300ce13106))
38
+
39
+
40
+ * Merge branch 'tm-1222-style-prop-fix' into 'master' ([a3b5323](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/a3b5323a1e99ed86d6b4cf79bed0cd7de28049ee))
41
+
1
42
  ## [1.2.2](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/compare/v1.2.1...v1.2.2) (2021-10-07)
2
43
 
3
44
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gatsby-core-theme",
3
- "version": "1.2.2",
3
+ "version": "1.2.6",
4
4
  "description": "Gatsby Theme NPM Package",
5
5
  "main": "index.js",
6
6
  "GATSBY_RECAPTCHA_SITEKEY": "6LfoyvMUAAAAAO4nl_MQnqHb4XdHxEiu5cXgIqeB",
@@ -3,9 +3,9 @@ import PropTypes from 'prop-types';
3
3
 
4
4
  import LazyImage from '~hooks/lazy-image';
5
5
  import keygen from '~helpers/keygen';
6
- import Css from './content-box.module.scss';
6
+ import styles from './content-box.module.scss';
7
7
 
8
- const ContentBox = ({ data = [], styles = Css }) => (
8
+ const ContentBox = ({ data = [] }) => (
9
9
  <div className={styles.contentBoxContainer}>
10
10
  <ul className={styles.contentBoxList}>
11
11
  {data.map((item) => (
@@ -3,14 +3,9 @@ import React from 'react';
3
3
  import PropTypes from 'prop-types';
4
4
  import parse from 'html-react-parser';
5
5
 
6
- import Css from './content-and-custom-module.module.scss';
6
+ import styles from './content-and-custom-module.module.scss';
7
7
 
8
- const ContentAndCustomModule = ({
9
- content = '',
10
- CustomComponent,
11
- customComponentProps,
12
- styles = Css,
13
- }) => (
8
+ const ContentAndCustomModule = ({ content = '', CustomComponent, customComponentProps }) => (
14
9
  <>
15
10
  <div className={styles.contentAndCustomModuleContainer}>
16
11
  {content && <div className={styles.contentBox}>{parse(content)}</div>}
@@ -1,3 +1,5 @@
1
+ /* eslint-disable arrow-body-style */
2
+ /* eslint-disable no-nested-ternary */
1
3
  import React from 'react';
2
4
  import PropTypes from 'prop-types';
3
5
 
@@ -16,6 +18,9 @@ const LinkList = ({
16
18
  listIcon = <></>,
17
19
  multiIcon = false,
18
20
  classes,
21
+ once = false,
22
+ height,
23
+ width,
19
24
  }) => {
20
25
  function renderLinkContent(item, index) {
21
26
  const icon = listIcon[index];
@@ -25,10 +30,26 @@ const LinkList = ({
25
30
  <>
26
31
  {multiIcon ? icon : listIcon}
27
32
  <span>{item.title}</span>
28
- {item.image && <LazyImage src={imagePrettyUrl(item.image)} alt={item.title} />}
33
+ {item.image && (
34
+ <LazyImage
35
+ src={imagePrettyUrl(item.image)}
36
+ alt={item.title}
37
+ once={once}
38
+ width={width}
39
+ height={height}
40
+ />
41
+ )}
29
42
  </>
30
43
  )}
31
- {item.image && imageOnly && <LazyImage src={imagePrettyUrl(item.image)} alt={item.title} />}
44
+ {item.image && imageOnly && (
45
+ <LazyImage
46
+ src={imagePrettyUrl(item.image)}
47
+ alt={item.title}
48
+ once={once}
49
+ width={width}
50
+ height={height}
51
+ />
52
+ )}
32
53
  </>
33
54
  );
34
55
  }
@@ -102,6 +123,9 @@ LinkList.propTypes = {
102
123
  listIcon: PropTypes.oneOfType([PropTypes.element, PropTypes.any, PropTypes.node]),
103
124
  multiIcon: PropTypes.bool,
104
125
  classes: PropTypes.string,
126
+ once: PropTypes.bool,
127
+ width: PropTypes.number,
128
+ height: PropTypes.number,
105
129
  };
106
130
 
107
131
  export default LinkList;
@@ -1,10 +1,12 @@
1
1
  import React from 'react';
2
+
2
3
  import {
3
4
  Title,
4
5
  Description,
5
6
  Primary,
6
7
  PRIMARY_STORY,
7
8
  ArgsTable,
9
+ // eslint-disable-next-line import/no-extraneous-dependencies
8
10
  } from '@storybook/addon-docs/blocks';
9
11
  import { FaChevronRight } from 'react-icons/fa';
10
12
 
@@ -68,6 +70,38 @@ export default {
68
70
  type: null,
69
71
  },
70
72
  },
73
+ once: {
74
+ name: 'once',
75
+ type: { name: 'boolean', required: false },
76
+ defaultValue: '',
77
+ description:
78
+ 'When set to True, once this component is loaded, LazyLoad will not care about it anymore',
79
+ table: {
80
+ type: { summary: 'boolean' },
81
+ defaultValue: { summary: false },
82
+ },
83
+ },
84
+ height: {
85
+ name: 'height',
86
+ type: { name: 'number', required: false },
87
+ defaultValue: '',
88
+ description:
89
+ 'Lazy loading images is supported out of box, no extra config needed, set `height` for better experience',
90
+ table: {
91
+ type: { summary: 'number' },
92
+ defaultValue: { summary: '' },
93
+ },
94
+ },
95
+ width: {
96
+ name: 'width',
97
+ type: { name: 'number', required: false },
98
+ defaultValue: '',
99
+ description: 'set width to the image',
100
+ table: {
101
+ type: { summary: 'number' },
102
+ defaultValue: { summary: '' },
103
+ },
104
+ },
71
105
  },
72
106
  parameters: {
73
107
  docs: {
@@ -133,4 +167,6 @@ Default.args = {
133
167
  },
134
168
  ],
135
169
  },
170
+ height: 30,
171
+ width: 40,
136
172
  };
@@ -1,10 +1,10 @@
1
1
  import React from 'react';
2
2
  import PropTypes from 'prop-types';
3
3
 
4
- import Css from './pros-cons.module.scss';
4
+ import styles from './pros-cons.module.scss';
5
5
  import keygen from '~helpers/keygen';
6
6
 
7
- const ProsCons = ({ module = {}, pros = 'Pros', cons = 'Cons', icons, styles = Css }) => (
7
+ const ProsCons = ({ module = {}, pros = 'Pros', cons = 'Cons', icons }) => (
8
8
  <div className={styles.prosCons}>
9
9
  <div className={styles.pros}>
10
10
  {icons && <span className={styles.icon}>{icons[0]}</span>}
@@ -5,7 +5,7 @@ import { FaSearch } from 'react-icons/fa';
5
5
 
6
6
  import LazyImage from '~hooks/lazy-image';
7
7
  import ConditionalWrapper from '~atoms/conditional-wrapper';
8
- import Css from './search.module.scss';
8
+ import styles from './search.module.scss';
9
9
  import Tabs from '~hooks/tabs';
10
10
  import { getURLParam } from '~helpers/getters';
11
11
  import keygen from '~helpers/keygen';
@@ -29,7 +29,6 @@ const Search = ({
29
29
  pageSearchOptions = null,
30
30
  inputPlaceholder = '',
31
31
  children,
32
- styles = Css,
33
32
  }) => {
34
33
  const { setShowSearch } = useContext(NavigationContext);
35
34
  const pageSearchOptionsCopy = pageSearchOptions;
@@ -59,18 +58,14 @@ const Search = ({
59
58
  // FUNCTIONS
60
59
 
61
60
  // Get the types of children provided
62
- const getChildrenTypes = useCallback(() => {
63
- return children(sampleChildRef.current).props.children.map((child) => {
64
- return child.props.type;
65
- });
66
- }, [children]);
61
+ const getChildrenTypes = useCallback(
62
+ () => children(sampleChildRef.current).props.children.map((child) => child.props.type),
63
+ [children]
64
+ );
67
65
 
68
66
  // Get the child by the given type - a data object is required
69
- const getChildType = (item, type) => {
70
- return children(item).props.children.find((child) => {
71
- return child.props.type === type;
72
- });
73
- };
67
+ const getChildType = (item, type) =>
68
+ children(item).props.children.find((child) => child.props.type === type);
74
69
 
75
70
  // Prepare search result for auto complete
76
71
  const loadAutoComplete = useCallback(() => {
@@ -331,9 +326,7 @@ const Search = ({
331
326
  ) {
332
327
  items = searchResultsRef.current
333
328
  .filter((item) => item.type === type)
334
- .map((item) => {
335
- return getChildType(item, type);
336
- });
329
+ .map((item) => getChildType(item, type));
337
330
  } else if (items.length) {
338
331
  items = {
339
332
  items,
@@ -2,12 +2,12 @@
2
2
  import React, { useRef, useEffect } from 'react';
3
3
  import PropTypes from 'prop-types';
4
4
 
5
- import Css from './accordion.module.scss';
5
+ import styles from './accordion.module.scss';
6
6
  import keygen from '~helpers/keygen';
7
7
 
8
8
  /* eslint-disable react/no-danger */
9
9
 
10
- const Accordion = ({ module, openAll = false, openItem, closeOthers = false, styles = Css }) => {
10
+ const Accordion = ({ module, openAll = false, openItem, closeOthers = false }) => {
11
11
  const { items } = module;
12
12
  const itemRefs = useRef([]);
13
13
  const btnRefs = useRef([]);
@@ -4,9 +4,9 @@ import PropTypes from 'prop-types';
4
4
  import Slider from '~molecules/slider';
5
5
  import keygen from '~helpers/keygen';
6
6
  import { anchorLink } from '~helpers/strings';
7
- import Css from './anchor.module.scss';
7
+ import styles from './anchor.module.scss';
8
8
 
9
- function Anchor({ module: { items }, headerOffset = 80, sliderGap = 0, styles = Css }) {
9
+ function Anchor({ module: { items }, headerOffset = 80, sliderGap = 0 }) {
10
10
  const handleClick = (event) => {
11
11
  event.preventDefault();
12
12
  const scrollToElementId = event.currentTarget.getAttribute('href').replace('#', '');
@@ -5,7 +5,7 @@ import Button from '~atoms/button';
5
5
  import LazyImage from '~hooks/lazy-image';
6
6
  import { prettyTracker } from '~helpers/getters';
7
7
  import { isMobileDevice } from '~helpers/device-detect';
8
- import Css from './tracker.module.scss';
8
+ import styles from './tracker.module.scss';
9
9
 
10
10
  const Tracker = ({
11
11
  pageContext,
@@ -19,7 +19,6 @@ const Tracker = ({
19
19
  logo = '../../../../../images/logo.svg',
20
20
  counter = false,
21
21
  isStory = false,
22
- styles = Css,
23
22
  }) => {
24
23
  const { operator } = pageContext;
25
24
 
@@ -2,24 +2,28 @@ export default {
2
2
  delete_operator_software: {
3
3
  'Irishluck.ie': true,
4
4
  'norskespilleautomater.com': true,
5
+ 'playcasino.co.za': true,
5
6
  },
6
7
  keep_page_extra_fields: {
7
8
  operator: {
8
9
  'Irishluck.ie': true, // needed for card background image
9
10
  'norskespilleautomater.com': true, // needed for inoperative / placeholder fields
11
+ 'playcasino.co.za': true,
10
12
  },
11
13
  article: {
12
14
  'Irishluck.ie': true, // needed for card background image
13
15
  'norskespilleautomater.com': true,
16
+ 'playcasino.co.za': true,
14
17
  },
15
18
  game: {
16
19
  'Irishluck.ie': true, // needed for card background image
17
20
  'norskespilleautomater.com': true,
21
+ 'playcasino.co.za': true,
18
22
  },
19
23
  },
20
24
  keep_sections: {
21
- software_provider: { 'norskespilleautomater.com': ['header'] },
22
- payment_method: { 'norskespilleautomater.com': ['header'] },
25
+ software_provider: { 'norskespilleautomater.com': ['header'], 'playcasino.co.za': ['header'] },
26
+ payment_method: { 'norskespilleautomater.com': ['header'], 'playcasino.co.za': ['header'] },
23
27
  operator: { 'Irishluck.ie': ['main'] },
24
28
  article: { 'Irishluck.ie': ['main'] },
25
29
  },
@@ -1,4 +1,5 @@
1
1
  import React, { useState } from 'react';
2
+ // eslint-disable-next-line import/no-extraneous-dependencies
2
3
  import LazyLoad from 'react-lazyload';
3
4
  import PropTypes from 'prop-types';
4
5
 
@@ -16,6 +17,7 @@ export default function LazyImage({
16
17
  alt = '',
17
18
  sizes,
18
19
  defaultImg,
20
+ once = false,
19
21
  }) {
20
22
  const [errorImage, setErrorImage] = useState(false);
21
23
 
@@ -24,7 +26,7 @@ export default function LazyImage({
24
26
  }
25
27
 
26
28
  return (
27
- <LazyLoad height={`${height}px`} width={`${width}px`} offset={offset} debounce={0}>
29
+ <LazyLoad height={`${height}px`} width={`${width}px`} offset={offset} debounce={0} once={once}>
28
30
  <img
29
31
  src={src}
30
32
  className={className}
@@ -51,4 +53,5 @@ LazyImage.propTypes = {
51
53
  sizes: PropTypes.string,
52
54
  srcSet: PropTypes.string,
53
55
  defaultImg: PropTypes.element,
56
+ once: PropTypes.bool,
54
57
  };
@@ -7,6 +7,7 @@ import {
7
7
  Stories,
8
8
  PRIMARY_STORY,
9
9
  ArgsTable,
10
+ // eslint-disable-next-line import/no-extraneous-dependencies
10
11
  } from '@storybook/addon-docs/blocks';
11
12
  import { FaRegFrownOpen } from 'react-icons/fa';
12
13
 
@@ -122,6 +123,17 @@ export default {
122
123
  type: null,
123
124
  },
124
125
  },
126
+ once: {
127
+ name: 'once',
128
+ type: { name: 'boolean', required: false },
129
+ defaultValue: '',
130
+ description:
131
+ 'When set to True, once this component is loaded, LazyLoad will not care about it anymore',
132
+ table: {
133
+ type: { summary: 'boolean' },
134
+ defaultValue: { summary: false },
135
+ },
136
+ },
125
137
  },
126
138
  parameters: {
127
139
  docs: {
@@ -172,5 +184,6 @@ BrokenURL.story = {
172
184
  srcSet: '',
173
185
  alt: 'This image has a broken URL',
174
186
  defaultImg: <FaRegFrownOpen size={250} />,
187
+ once: false,
175
188
  },
176
189
  };