gatsby-core-theme 29.0.3 → 29.0.5-beta.1
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 +20 -0
- package/gatsby-config.js +1 -9
- package/package.json +1 -7
- package/src/components/app.js +5 -3
- package/src/components/atoms/iframe/index.js +2 -2
- package/src/components/molecules/content/index.js +5 -3
- package/src/components/molecules/footer/index.js +3 -2
- package/src/components/molecules/header/index.js +3 -4
- package/src/components/molecules/main/index.js +9 -5
- package/src/components/molecules/module/index.js +17 -17
- package/src/components/molecules/search/index.js +5 -4
- package/src/components/molecules/slider/index.js +2 -2
- package/src/components/organisms/navigation/index.js +4 -4
- package/src/components/organisms/search/index.js +14 -6
- package/src/components/organisms/toplist/index.js +2 -2
- package/src/components/organisms/toplist/list/index.js +2 -2
- package/src/components/pages/body/index.js +4 -2
- package/src/components/pages/search/index.js +2 -2
- package/src/constants/pick-keys.mjs +1 -0
- package/src/hooks/loadable/index.js +10 -0
- package/src/hooks/tabs/index.js +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,23 @@
|
|
|
1
|
+
## [29.0.5-beta.1](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/compare/v29.0.4...v29.0.5-beta.1) (2023-09-07)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* lazy stuff ([06bb176](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/06bb176318c1ac37c494ef2789c8d741a32aa02b))
|
|
7
|
+
* lazy stuff ([d61e466](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/d61e466c049a322d9a285d35c71b588e65cc25b3))
|
|
8
|
+
* lazy stuff ([cb7267d](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/cb7267dccbb38481b3910680fbb90d699354ec5b))
|
|
9
|
+
* lazy stuff ([65ecb12](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/65ecb12c37d8d5d87cf9e1c999ca075d9d8f1982))
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
* Merge branch 'tm-3098-lazy' into 'beta' ([b1d9ef7](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/b1d9ef7e88fc23323a4ba00addcce6c76523b6cf))
|
|
13
|
+
|
|
14
|
+
## [29.0.4](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/compare/v29.0.3...v29.0.4) (2023-09-07)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
### Bug Fixes
|
|
18
|
+
|
|
19
|
+
* add name for slots ([a337862](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/a3378622c2143f527f1da734ad5563a91744776f))
|
|
20
|
+
|
|
1
21
|
## [29.0.3](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/compare/v29.0.2...v29.0.3) (2023-09-06)
|
|
2
22
|
|
|
3
23
|
|
package/gatsby-config.js
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
module.exports = {
|
|
2
2
|
flags: {
|
|
3
|
-
DEV_SSR:
|
|
3
|
+
DEV_SSR: true,
|
|
4
4
|
},
|
|
5
5
|
plugins: [
|
|
6
|
-
'gatsby-plugin-loadable-components-ssr',
|
|
7
6
|
{
|
|
8
7
|
resolve: 'gatsby-plugin-sass',
|
|
9
8
|
options: {
|
|
@@ -17,13 +16,6 @@ module.exports = {
|
|
|
17
16
|
additionalData: '@import "gatsby-core-theme/src/styles/globals.scss";',
|
|
18
17
|
},
|
|
19
18
|
},
|
|
20
|
-
{
|
|
21
|
-
resolve: 'gatsby-plugin-webpack-bundle-analyser-v2',
|
|
22
|
-
options: {
|
|
23
|
-
devMode: true,
|
|
24
|
-
disable: true,
|
|
25
|
-
},
|
|
26
|
-
},
|
|
27
19
|
{
|
|
28
20
|
resolve: `gatsby-plugin-manifest`,
|
|
29
21
|
options: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "gatsby-core-theme",
|
|
3
|
-
"version": "29.0.
|
|
3
|
+
"version": "29.0.5-beta.1",
|
|
4
4
|
"description": "Gatsby Theme NPM Package",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"directories": {
|
|
@@ -16,10 +16,6 @@
|
|
|
16
16
|
"build-storybook": "cross-env STORYBOOK_IMAGE_CDN_URL=https://cdn.irishluck.ie STORYBOOK_GATSBY_SITE_NAME=norskespilleautomater.com STORYBOOK_TRACKER_LINK_FORMAT_NON_MAIN=[no],[visit],short_name STORYBOOK_TRACKER_LINK_FORMAT_MAIN=[no],[visit],short_name build-storybook"
|
|
17
17
|
},
|
|
18
18
|
"dependencies": {
|
|
19
|
-
"@loadable/babel-plugin": "^5.15.3",
|
|
20
|
-
"@loadable/component": "^5.15.3",
|
|
21
|
-
"@loadable/server": "^5.15.3",
|
|
22
|
-
"@loadable/webpack-plugin": "^5.14.2",
|
|
23
19
|
"@reach/router": "^1.3.3",
|
|
24
20
|
"@react-icons/all-files": "^4.1.0",
|
|
25
21
|
"axios": "^0.21.1",
|
|
@@ -31,7 +27,6 @@
|
|
|
31
27
|
"gatsby": "^5.11.0",
|
|
32
28
|
"gatsby-image": "^3.11.0",
|
|
33
29
|
"gatsby-plugin-image": "^3.11.0",
|
|
34
|
-
"gatsby-plugin-loadable-components-ssr": "^4.2.0",
|
|
35
30
|
"gatsby-plugin-manifest": "^5.11.0",
|
|
36
31
|
"gatsby-plugin-postcss": "^6.11.0",
|
|
37
32
|
"gatsby-plugin-sass": "^6.11.0",
|
|
@@ -76,7 +71,6 @@
|
|
|
76
71
|
"babel-preset-gatsby": "^3.11.0",
|
|
77
72
|
"eslint-import-resolver-alias": "^1.1.2",
|
|
78
73
|
"eslint-plugin-react": "^7.22.0",
|
|
79
|
-
"gatsby-plugin-webpack-bundle-analyser-v2": "^1.1.26",
|
|
80
74
|
"identity-obj-proxy": "^3.0.0",
|
|
81
75
|
"jest": "^29.5.0",
|
|
82
76
|
"jest-environment-jsdom": "^29.5.0",
|
package/src/components/app.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
/* eslint-disable react/forbid-prop-types */
|
|
3
3
|
import React, { useEffect, useState } from 'react';
|
|
4
4
|
import PropTypes from 'prop-types';
|
|
5
|
-
import
|
|
5
|
+
import Loadable from '~hooks/loadable';
|
|
6
6
|
import MainProvider from '~context/MainProvider';
|
|
7
7
|
import Body from '~pages/body';
|
|
8
8
|
import HeadData from '~organisms/head';
|
|
@@ -49,8 +49,10 @@ const App = ({ pageContext }) => {
|
|
|
49
49
|
}
|
|
50
50
|
}
|
|
51
51
|
|
|
52
|
-
const TrackerContent = isTracker ?
|
|
53
|
-
const TrackerGeoContent = isTrackeGeo
|
|
52
|
+
const TrackerContent = isTracker ? Loadable(React.lazy(() => import(`~pages/tracker`))) : null;
|
|
53
|
+
const TrackerGeoContent = isTrackeGeo
|
|
54
|
+
? Loadable(React.lazy(() => import(`~pages/tracker-geo`)))
|
|
55
|
+
: null;
|
|
54
56
|
|
|
55
57
|
if (TrackerGeoContent) {
|
|
56
58
|
return (
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
|
-
import
|
|
3
|
+
import Loadable from '~hooks/loadable';
|
|
4
4
|
import { isNativeImageLazyLoadingSupported } from '~helpers/device-detect';
|
|
5
5
|
import styles from './iframe.module.scss';
|
|
6
6
|
|
|
@@ -12,7 +12,7 @@ const Iframe = ({
|
|
|
12
12
|
frameBorder = 1,
|
|
13
13
|
}) => {
|
|
14
14
|
if (!isNativeImageLazyLoadingSupported() && lazyLoad) {
|
|
15
|
-
const LazyLoad =
|
|
15
|
+
const LazyLoad = Loadable(React.lazy(() => import(`react-lazyload`)));
|
|
16
16
|
return (
|
|
17
17
|
<>
|
|
18
18
|
<LazyLoad>
|
|
@@ -5,8 +5,8 @@ import parse from 'html-react-parser';
|
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
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
|
-
import loadable from '@loadable/component';
|
|
9
8
|
import { parseContentImageUrl } from 'gatsby-core-theme/src/helpers/strings';
|
|
9
|
+
import Loadable from '~hooks/loadable';
|
|
10
10
|
import { generatePlaceholderString } from '../../../helpers/generators';
|
|
11
11
|
import { Context } from '~context/MainProvider';
|
|
12
12
|
import styles from './content.module.scss';
|
|
@@ -21,7 +21,9 @@ const Content = ({ module, isHomepageFirstModule = false, isModuleIntroduction =
|
|
|
21
21
|
|
|
22
22
|
const replaceMedia = (node) => {
|
|
23
23
|
if (node.name === 'iframe') {
|
|
24
|
-
const Iframe =
|
|
24
|
+
const Iframe = Loadable(
|
|
25
|
+
React.lazy(() => import('gatsby-core-theme/src/components/atoms/iframe'))
|
|
26
|
+
);
|
|
25
27
|
return <Iframe src={node.attribs.src} />;
|
|
26
28
|
}
|
|
27
29
|
|
|
@@ -42,7 +44,7 @@ const Content = ({ module, isHomepageFirstModule = false, isModuleIntroduction =
|
|
|
42
44
|
const lazyProps = {
|
|
43
45
|
src: parseContentImageUrl(node.attribs.src),
|
|
44
46
|
width: node.attribs.width && node.attribs.width.replace('px', ''),
|
|
45
|
-
height:
|
|
47
|
+
height: 300,
|
|
46
48
|
style: node.attribs.style ? parseCss(node.attribs.style) : null,
|
|
47
49
|
alt: node.attribs.alt ? node.attribs.alt : 'missing alt',
|
|
48
50
|
className: styles[stylesClass],
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
|
-
import
|
|
3
|
+
import Loadable from '~hooks/loadable';
|
|
4
4
|
import { getExtraField, copyrightText } from '~helpers/getters';
|
|
5
5
|
import Disclaimer from '~atoms/disclaimer';
|
|
6
6
|
import styles from './footer.module.scss';
|
|
@@ -22,7 +22,8 @@ const Footer = ({
|
|
|
22
22
|
const BottomSection = footerBottomCustom;
|
|
23
23
|
const showLinks = template !== 'ppc';
|
|
24
24
|
|
|
25
|
-
const LinkList =
|
|
25
|
+
const LinkList =
|
|
26
|
+
footerMenu && showLinks ? Loadable(React.lazy(() => import('~molecules/link-list'))) : null;
|
|
26
27
|
|
|
27
28
|
return (
|
|
28
29
|
<footer className={styles.footer || ''}>
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
|
-
|
|
4
|
-
import loadable from '@loadable/component';
|
|
3
|
+
import Loadable from '~hooks/loadable';
|
|
5
4
|
import styles from './header.module.scss';
|
|
6
5
|
import Breadcrumbs from '~atoms/breadcrumbs';
|
|
7
6
|
import { imagePrettyUrl, getSectionExtraField } from '~helpers/getters';
|
|
@@ -47,7 +46,7 @@ function Header({ section, content = null, backgroundImage = true, showAuthor =
|
|
|
47
46
|
section.page.path !== 'sitemap' &&
|
|
48
47
|
section.page.author &&
|
|
49
48
|
showAuthor
|
|
50
|
-
?
|
|
49
|
+
? Loadable(React.lazy(() => import('~atoms/author')))
|
|
51
50
|
: null;
|
|
52
51
|
|
|
53
52
|
return (
|
|
@@ -111,7 +110,7 @@ Header.propTypes = {
|
|
|
111
110
|
url: PropTypes.string,
|
|
112
111
|
email: PropTypes.string,
|
|
113
112
|
}),
|
|
114
|
-
authors: PropTypes.
|
|
113
|
+
authors: PropTypes.arrayOf(PropTypes.shape({})),
|
|
115
114
|
sections: PropTypes.shape({
|
|
116
115
|
header: PropTypes.shape({
|
|
117
116
|
extra_fields: PropTypes.shape({
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
|
-
import
|
|
3
|
+
import Loadable from '~hooks/loadable';
|
|
4
4
|
import Module from '~molecules/module';
|
|
5
5
|
import styles from './main.module.scss';
|
|
6
6
|
import keygen from '~helpers/keygen';
|
|
@@ -11,10 +11,14 @@ const Main = ({ section = {}, pageContext = {}, serverData = {}, exclOperator =
|
|
|
11
11
|
|
|
12
12
|
const pathPrefixes = isSearchPath(allMarkets, page.path);
|
|
13
13
|
|
|
14
|
-
const SearchPage = pathPrefixes ?
|
|
15
|
-
const HtmlSitemap = pageContext.sitemapData
|
|
16
|
-
|
|
17
|
-
|
|
14
|
+
const SearchPage = pathPrefixes ? Loadable(React.lazy(() => import(`~pages/search`))) : null;
|
|
15
|
+
const HtmlSitemap = pageContext.sitemapData
|
|
16
|
+
? Loadable(React.lazy(() => import(`~atoms/sitemap`)))
|
|
17
|
+
: null;
|
|
18
|
+
const AuthorBox = page.author_id ? Loadable(React.lazy(() => import(`~atoms/author-box`))) : null;
|
|
19
|
+
const NotFound = page?.path?.includes('404')
|
|
20
|
+
? Loadable(React.lazy(() => import(`~atoms/not-found`)))
|
|
21
|
+
: null;
|
|
18
22
|
|
|
19
23
|
return (
|
|
20
24
|
<main className={styles.modulePage || ''}>
|
|
@@ -2,8 +2,7 @@
|
|
|
2
2
|
/* eslint-disable react/prop-types */
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import PropTypes from 'prop-types';
|
|
5
|
-
import
|
|
6
|
-
|
|
5
|
+
import Loadable from '~hooks/loadable';
|
|
7
6
|
import styles from './module.module.scss';
|
|
8
7
|
import ModuleTitle from '~atoms/module-title';
|
|
9
8
|
import { anchorLink, removeSymbols } from '~helpers/strings';
|
|
@@ -14,31 +13,31 @@ const Modules = ({ module, page, pageContext }) => {
|
|
|
14
13
|
|
|
15
14
|
switch (name) {
|
|
16
15
|
case 'content':
|
|
17
|
-
return
|
|
16
|
+
return Loadable(React.lazy(() => import('~molecules/content')));
|
|
18
17
|
case 'top_list':
|
|
19
|
-
return
|
|
18
|
+
return Loadable(React.lazy(() => import('~organisms/toplist')));
|
|
20
19
|
case 'archive':
|
|
21
20
|
if (!items || items.length === 0) return null;
|
|
22
|
-
return
|
|
21
|
+
return Loadable(React.lazy(() => import('~organisms/archive')));
|
|
23
22
|
case 'counter':
|
|
24
|
-
return
|
|
23
|
+
return Loadable(React.lazy(() => import('~molecules/counter')));
|
|
25
24
|
case 'cards':
|
|
26
25
|
case 'cards_v2':
|
|
27
|
-
return
|
|
26
|
+
return Loadable(React.lazy(() => import('~organisms/cards')));
|
|
28
27
|
case 'contact_form':
|
|
29
|
-
return
|
|
28
|
+
return Loadable(React.lazy(() => import('~atoms/contact-form')));
|
|
30
29
|
case 'pros_and_cons':
|
|
31
|
-
return
|
|
30
|
+
return Loadable(React.lazy(() => import('~molecules/pros-cons')));
|
|
32
31
|
case 'faq':
|
|
33
32
|
if (moduleItem?.display_front_end === '1') {
|
|
34
|
-
return
|
|
33
|
+
return Loadable(React.lazy(() => import('~atoms/faq')));
|
|
35
34
|
}
|
|
36
35
|
return null;
|
|
37
36
|
case 'accordion':
|
|
38
|
-
return
|
|
37
|
+
return Loadable(React.lazy(() => import('~organisms/accordion')));
|
|
39
38
|
case 'anchor':
|
|
40
39
|
if (items && items.length > 0) {
|
|
41
|
-
return
|
|
40
|
+
return Loadable(React.lazy(() => import('~organisms/anchor')));
|
|
42
41
|
}
|
|
43
42
|
return null;
|
|
44
43
|
case 'carousel':
|
|
@@ -46,15 +45,15 @@ const Modules = ({ module, page, pageContext }) => {
|
|
|
46
45
|
items.length > 0 && // has items
|
|
47
46
|
items.filter((item) => item.image === null).length === 0 // not filled with null items
|
|
48
47
|
) {
|
|
49
|
-
return
|
|
48
|
+
return Loadable(React.lazy(() => import('~organisms/carousel')));
|
|
50
49
|
}
|
|
51
50
|
return null;
|
|
52
51
|
case 'bonus':
|
|
53
|
-
return
|
|
52
|
+
return Loadable(React.lazy(() => import('~molecules/bonus/template-one')));
|
|
54
53
|
case 'image':
|
|
55
|
-
return
|
|
54
|
+
return Loadable(React.lazy(() => import('~atoms/image')));
|
|
56
55
|
case 'spotlights':
|
|
57
|
-
return
|
|
56
|
+
return Loadable(React.lazy(() => import('~atoms/spotlights')));
|
|
58
57
|
default:
|
|
59
58
|
return null;
|
|
60
59
|
}
|
|
@@ -86,7 +85,8 @@ const Modules = ({ module, page, pageContext }) => {
|
|
|
86
85
|
'--module-background-color': module.background_color,
|
|
87
86
|
};
|
|
88
87
|
|
|
89
|
-
const ModuleIntro =
|
|
88
|
+
const ModuleIntro =
|
|
89
|
+
module.module_introduction && Loadable(React.lazy(() => import('~molecules/content')));
|
|
90
90
|
return (
|
|
91
91
|
ModuleComponent && (
|
|
92
92
|
<div
|
|
@@ -2,7 +2,7 @@ import React, { useState, useEffect, useRef, useCallback, useContext } from 'rea
|
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import { navigate } from 'gatsby';
|
|
4
4
|
import { FaSearch } from '@react-icons/all-files/fa/FaSearch';
|
|
5
|
-
import
|
|
5
|
+
import Loadable from '~hooks/loadable';
|
|
6
6
|
import LazyImage from '~hooks/lazy-image';
|
|
7
7
|
import ConditionalWrapper from '~atoms/conditional-wrapper';
|
|
8
8
|
import styles from './search.module.scss';
|
|
@@ -222,7 +222,7 @@ const Search = ({
|
|
|
222
222
|
}
|
|
223
223
|
}, [pageSearchOptionsCopy]);
|
|
224
224
|
if (pageSearchOptionsCopy !== null && pageSearchOptionsCopy.sort !== undefined) {
|
|
225
|
-
const CustomSelect =
|
|
225
|
+
const CustomSelect = Loadable(React.lazy(() => import('~atoms/custom-select')));
|
|
226
226
|
|
|
227
227
|
pageSearchOptionsCopy.tabsOptions.HeaderComp = (
|
|
228
228
|
<div className={styles.selectwrapper}>
|
|
@@ -259,7 +259,8 @@ const Search = ({
|
|
|
259
259
|
);
|
|
260
260
|
}
|
|
261
261
|
|
|
262
|
-
const Tabs =
|
|
262
|
+
const Tabs =
|
|
263
|
+
searchResultsRef.current.length !== 0 && Loadable(React.lazy(() => import('~hooks/tabs')));
|
|
263
264
|
|
|
264
265
|
return (
|
|
265
266
|
<>
|
|
@@ -369,7 +370,7 @@ const Search = ({
|
|
|
369
370
|
|
|
370
371
|
if (items.length === 0) return null;
|
|
371
372
|
|
|
372
|
-
const Archive =
|
|
373
|
+
const Archive = Loadable(React.lazy(() => import('~organisms/archive')));
|
|
373
374
|
|
|
374
375
|
return (
|
|
375
376
|
// eslint-disable-next-line react/no-unknown-property
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
/* eslint-disable react-hooks/exhaustive-deps */
|
|
3
3
|
import React, { useState, useRef, useEffect } from 'react';
|
|
4
4
|
import PropTypes, { element } from 'prop-types';
|
|
5
|
-
import
|
|
5
|
+
import Loadable from '~hooks/loadable';
|
|
6
6
|
|
|
7
7
|
import {
|
|
8
8
|
updateSlider,
|
|
@@ -186,7 +186,7 @@ function Slider({
|
|
|
186
186
|
});
|
|
187
187
|
|
|
188
188
|
const Pagination = usePagination
|
|
189
|
-
?
|
|
189
|
+
? Loadable(React.lazy(() => import('~atoms/carousel/pagination-item')))
|
|
190
190
|
: null;
|
|
191
191
|
|
|
192
192
|
return (
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/* eslint-disable import/no-named-as-default */
|
|
2
2
|
import React, { useRef } from 'react';
|
|
3
3
|
import PropTypes from 'prop-types';
|
|
4
|
-
import
|
|
4
|
+
import Loadable from '~hooks/loadable';
|
|
5
5
|
import Link from '~hooks/link';
|
|
6
6
|
import Menu from '~molecules/menu';
|
|
7
7
|
import { toggleScroll } from '~helpers/scroll';
|
|
@@ -35,9 +35,9 @@ const Navigation = ({
|
|
|
35
35
|
|
|
36
36
|
let searchURLPageName = 's';
|
|
37
37
|
|
|
38
|
-
const Search = hasSearch ?
|
|
38
|
+
const Search = hasSearch ? Loadable(React.lazy(() => import('~organisms/search'))) : null;
|
|
39
39
|
const CustomComponent = hasCustomComponent
|
|
40
|
-
?
|
|
40
|
+
? Loadable(React.lazy(() => import('~atoms/menu/variables')))
|
|
41
41
|
: null;
|
|
42
42
|
const logoImg = (
|
|
43
43
|
<img
|
|
@@ -136,7 +136,7 @@ Navigation.propTypes = {
|
|
|
136
136
|
pageContext: PropTypes.shape({
|
|
137
137
|
allMarkets: PropTypes.shape({}),
|
|
138
138
|
page: PropTypes.shape({
|
|
139
|
-
market: PropTypes.
|
|
139
|
+
market: PropTypes.string,
|
|
140
140
|
}),
|
|
141
141
|
}),
|
|
142
142
|
hasSearch: PropTypes.bool,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React, { useContext } from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
|
-
import loadable from '@loadable/component';
|
|
4
|
-
import { FaSearch } from '@react-icons/all-files/fa/FaSearch';
|
|
5
3
|
|
|
4
|
+
import { FaSearch } from '@react-icons/all-files/fa/FaSearch';
|
|
5
|
+
import Loadable from '~hooks/loadable';
|
|
6
6
|
import { toggleScroll } from '~helpers/scroll';
|
|
7
7
|
|
|
8
8
|
import { NavigationContext } from '../navigation/navigationContext';
|
|
@@ -18,14 +18,22 @@ const SearchForm = ({
|
|
|
18
18
|
searchURLPageName,
|
|
19
19
|
}) => {
|
|
20
20
|
const { showSearch, setShowSearch, setShowMenu, showMenu } = useContext(NavigationContext);
|
|
21
|
-
const Search = showSearch ?
|
|
21
|
+
const Search = showSearch ? Loadable(React.lazy(() => import('~molecules/search'))) : <></>;
|
|
22
22
|
const Operator = showSearch ? (
|
|
23
|
-
|
|
23
|
+
Loadable(React.lazy(() => import('~atoms/search/autocomplete/operator')))
|
|
24
|
+
) : (
|
|
25
|
+
<></>
|
|
26
|
+
);
|
|
27
|
+
const Game = showSearch ? (
|
|
28
|
+
Loadable(React.lazy(() => import('~atoms/search/autocomplete/game')))
|
|
29
|
+
) : (
|
|
30
|
+
<></>
|
|
31
|
+
);
|
|
32
|
+
const Article = showSearch ? (
|
|
33
|
+
Loadable(React.lazy(() => import('~atoms/search/autocomplete/article')))
|
|
24
34
|
) : (
|
|
25
35
|
<></>
|
|
26
36
|
);
|
|
27
|
-
const Game = showSearch ? loadable(() => import('~atoms/search/autocomplete/game')) : <></>;
|
|
28
|
-
const Article = showSearch ? loadable(() => import('~atoms/search/autocomplete/article')) : <></>;
|
|
29
37
|
|
|
30
38
|
const handleOnSearchIconClick = () => {
|
|
31
39
|
setShowSearch(!showSearch);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
|
-
import
|
|
3
|
+
import Loadable from '~hooks/loadable';
|
|
4
4
|
import keygen from '~helpers/keygen';
|
|
5
5
|
import List from './list';
|
|
6
6
|
import styles from './toplist.module.scss';
|
|
@@ -24,7 +24,7 @@ const TopList = ({ module, toplistHeading, CustomRow, page }) => {
|
|
|
24
24
|
/>
|
|
25
25
|
</div>
|
|
26
26
|
));
|
|
27
|
-
const Tabs = showTabs &&
|
|
27
|
+
const Tabs = showTabs && Loadable(React.lazy(() => import('~hooks/tabs')));
|
|
28
28
|
|
|
29
29
|
return showTabs ? (
|
|
30
30
|
// eslint-disable-next-line react/no-children-prop
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/* eslint-disable no-return-assign */
|
|
2
2
|
import React, { useRef } from 'react';
|
|
3
3
|
import PropTypes from 'prop-types';
|
|
4
|
-
import
|
|
4
|
+
import Loadable from '~hooks/loadable';
|
|
5
5
|
import keygen from '~helpers/keygen';
|
|
6
6
|
import Button from '~atoms/button';
|
|
7
7
|
import styles from './list.module.scss';
|
|
@@ -37,7 +37,7 @@ export default function List({
|
|
|
37
37
|
}
|
|
38
38
|
}
|
|
39
39
|
|
|
40
|
-
const Row = !CustomRow &&
|
|
40
|
+
const Row = !CustomRow && Loadable(React.lazy(() => import('~molecules/toplist/default-row')));
|
|
41
41
|
|
|
42
42
|
return (
|
|
43
43
|
<>
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
/* eslint-disable no-restricted-globals */
|
|
4
4
|
import React, { useEffect } from 'react';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
|
-
import
|
|
6
|
+
import Loadable from '~hooks/loadable';
|
|
7
7
|
import { getSection } from '~helpers/getters';
|
|
8
8
|
import Header from '~molecules/header';
|
|
9
9
|
import Main from '~molecules/main';
|
|
@@ -49,7 +49,9 @@ function Body({ pageContext, children, hideOperatorBanner, serverData }) {
|
|
|
49
49
|
const pageType = pageContext.page.relation_type;
|
|
50
50
|
const OperatorBanner =
|
|
51
51
|
pageType === 'operator' && !hideBanner && !hideOperatorBanner
|
|
52
|
-
?
|
|
52
|
+
? Loadable(
|
|
53
|
+
React.lazy(() => import(`gatsby-core-theme/src/components/molecules/bonus/template-two`))
|
|
54
|
+
)
|
|
53
55
|
: null;
|
|
54
56
|
|
|
55
57
|
return (
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/* eslint-disable arrow-body-style */
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import PropTypes from 'prop-types';
|
|
4
|
-
import
|
|
4
|
+
import Loadable from '~hooks/loadable';
|
|
5
5
|
import Card from '~atoms/cards/default-card';
|
|
6
6
|
import { translate } from '~helpers/getters';
|
|
7
7
|
|
|
8
8
|
const SearchContent = ({ page }) => {
|
|
9
|
-
const Search =
|
|
9
|
+
const Search = Loadable(React.lazy(() => import('~molecules/search')));
|
|
10
10
|
const searchURLPageName = page.path;
|
|
11
11
|
return (
|
|
12
12
|
<Search
|
package/src/hooks/tabs/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { useState } from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
|
-
import
|
|
3
|
+
import Loadable from '~hooks/loadable';
|
|
4
4
|
import styles from './tabs.module.scss';
|
|
5
5
|
|
|
6
6
|
const Tabs = ({
|
|
@@ -17,8 +17,8 @@ const Tabs = ({
|
|
|
17
17
|
showAll ? showAllTabId : `${children[0].props.label}_0`
|
|
18
18
|
);
|
|
19
19
|
const showTabs = children.length > 1;
|
|
20
|
-
const TabList = showTabs &&
|
|
21
|
-
const { forceCheck } = TabList &&
|
|
20
|
+
const TabList = showTabs && Loadable(React.lazy(() => import('./tab/tab-list')));
|
|
21
|
+
const { forceCheck } = TabList && Loadable(React.lazy(() => import('react-lazyload')));
|
|
22
22
|
const tabHeaderClass = `${styles.tabsHeader || ''} ${!HeaderComp ? styles.tabsOnly || '' : ''} ${
|
|
23
23
|
styles[headerClass] || ''
|
|
24
24
|
} ${tabsAlign === 'right' ? styles.invertOrder : ''}`;
|