gatsby-core-theme 2.0.19 → 2.1.0
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 +26 -0
- package/package.json +1 -1
- package/src/components/atoms/bonus/bonus.test.js +1 -2
- package/src/components/atoms/disclaimer/disclaimer.test.js +24 -0
- package/src/components/atoms/disclaimer/index.js +24 -0
- package/src/components/molecules/counter/counter-item/counter-item.module.scss +10 -15
- package/src/components/molecules/counter/counter-item/index.js +12 -14
- package/src/components/molecules/counter/counter.module.scss +2 -0
- package/src/components/molecules/counter/index.js +16 -14
- package/src/components/organisms/head/index.js +4 -0
- package/src/helpers/css-parser.js +7 -5
- package/src/helpers/css-parser.test.js +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,29 @@
|
|
|
1
|
+
# [2.1.0](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/compare/v2.0.19...v2.1.0) (2022-01-13)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* added dmca as component ([2aae7bc](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/2aae7bc3cf0d8ba1210154ad0f7aecd24221c92d))
|
|
7
|
+
* added lazyload and image added as prop ([71b7ad7](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/71b7ad70f0499a09eeada813fce007c273c99422))
|
|
8
|
+
* test ([d103191](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/d103191b379926afd7ae9effcd29f0cbe61d9c28))
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Code Refactoring
|
|
12
|
+
|
|
13
|
+
* update counter and counterItem for w3 validator ([9ebbcdc](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/9ebbcdcbe14f0a5adf8ca6acedfbe1c7c7b19ec3))
|
|
14
|
+
* update css parser for w3 validator ([db7dd7d](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/db7dd7d76f3d0404a19471bdf45e883bff635512))
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
* Merge branch 'tm-2654-open-graph' into 'master' ([0e2a375](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/0e2a37579483adde033aa19e58b677fa80e75f3a))
|
|
18
|
+
* Merge branch 'tm-2567-update-theme-for-w3-validator' into 'master' ([cb0ab99](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/cb0ab990a56d26a7591bb089d2ed38f001b0cc74))
|
|
19
|
+
* Merge branch 'tm-2625-dmca-implementation' into 'master' ([8cb7230](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/8cb7230734fb97c2222ebb8207c646206ab9d92c))
|
|
20
|
+
* Merge branch 'tm-2567-update-theme-for-w3-validator' into tm-2567-update-theme-for-w3-validator ([2a0701e](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/2a0701e35a71d0d00e86d303d82843b0897531fb))
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
### Features
|
|
24
|
+
|
|
25
|
+
* added new og properties ([2aba269](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/2aba2697f9f80b1326e0118a8bf80f50f52e721f))
|
|
26
|
+
|
|
1
27
|
## [2.0.19](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/compare/v2.0.18...v2.0.19) (2022-01-11)
|
|
2
28
|
|
|
3
29
|
|
package/package.json
CHANGED
|
@@ -8,10 +8,9 @@ import Bonus from '.';
|
|
|
8
8
|
describe('Bonus Component', () => {
|
|
9
9
|
test('render with props', () => {
|
|
10
10
|
const item = getToplistItem();
|
|
11
|
-
const {
|
|
11
|
+
const { getByText } = render(<Bonus item={item} tracker="main" />);
|
|
12
12
|
expect(getByText('€100 welcome bonus')).toBeTruthy();
|
|
13
13
|
expect(getByText('€100 welcome bonus').getAttribute('class')).toEqual('title');
|
|
14
|
-
expect(container.querySelector('div.bonus')).toBeTruthy();
|
|
15
14
|
});
|
|
16
15
|
test('without oneLiner', () => {
|
|
17
16
|
const { container } = render(
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { render, cleanup } from '@testing-library/react';
|
|
3
|
+
|
|
4
|
+
import '@testing-library/jest-dom/extend-expect';
|
|
5
|
+
|
|
6
|
+
import Disclaimer from '.';
|
|
7
|
+
|
|
8
|
+
const dmcaImg = (
|
|
9
|
+
<img
|
|
10
|
+
src="https://images.dmca.com/Badges/_dmca_premi_badge_1.png?ID=9e466e76-827d-4247-ac51-4eb75b227301"
|
|
11
|
+
alt="DMCA.com Protection Status"
|
|
12
|
+
/>
|
|
13
|
+
);
|
|
14
|
+
|
|
15
|
+
describe('Disclaimer Component', () => {
|
|
16
|
+
test('render disclaimer badge', () => {
|
|
17
|
+
const { container } = render(<Disclaimer image={dmcaImg} />);
|
|
18
|
+
expect(container.querySelectorAll('.lazyload-placeholder')).toHaveLength(1);
|
|
19
|
+
expect(container.querySelector('div')).toBeTruthy();
|
|
20
|
+
});
|
|
21
|
+
});
|
|
22
|
+
afterEach(() => {
|
|
23
|
+
cleanup();
|
|
24
|
+
});
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import LazyLoad from 'react-lazyload';
|
|
4
|
+
|
|
5
|
+
const Disclaimer = ({ image }) => (
|
|
6
|
+
<LazyLoad>
|
|
7
|
+
<a
|
|
8
|
+
href="//www.dmca.com/Protection/Status.aspx?ID=9e466e76-827d-4247-ac51-4eb75b227301"
|
|
9
|
+
title="DMCA.com Protection Status"
|
|
10
|
+
className="dmca-badge"
|
|
11
|
+
target="_blank"
|
|
12
|
+
rel="noreferrer"
|
|
13
|
+
>
|
|
14
|
+
{image}
|
|
15
|
+
</a>
|
|
16
|
+
<script src="https://images.dmca.com/Badges/DMCABadgeHelper.min.js"> </script>
|
|
17
|
+
</LazyLoad>
|
|
18
|
+
);
|
|
19
|
+
|
|
20
|
+
export default Disclaimer;
|
|
21
|
+
|
|
22
|
+
Disclaimer.propTypes = {
|
|
23
|
+
image: PropTypes.node,
|
|
24
|
+
};
|
|
@@ -1,19 +1,14 @@
|
|
|
1
|
-
.
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
color: black;
|
|
7
|
-
font: {
|
|
8
|
-
size: var(--h2-size);
|
|
9
|
-
weight: bold;
|
|
10
|
-
}
|
|
1
|
+
.title {
|
|
2
|
+
color: black;
|
|
3
|
+
font: {
|
|
4
|
+
size: var(--h2-size);
|
|
5
|
+
weight: bold;
|
|
11
6
|
}
|
|
7
|
+
}
|
|
12
8
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
}
|
|
9
|
+
.value {
|
|
10
|
+
font: {
|
|
11
|
+
weight: bold;
|
|
12
|
+
size: 10rem;
|
|
18
13
|
}
|
|
19
14
|
}
|
|
@@ -5,20 +5,18 @@ import LazyLoad from 'react-lazyload';
|
|
|
5
5
|
import CountNumber from './count-number';
|
|
6
6
|
import styles from './counter-item.module.scss';
|
|
7
7
|
|
|
8
|
-
const CounterItem = ({ data, icon }) =>
|
|
9
|
-
|
|
10
|
-
<
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
<
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
);
|
|
21
|
-
};
|
|
8
|
+
const CounterItem = ({ data, icon }) => (
|
|
9
|
+
<>
|
|
10
|
+
<div className={styles.title}>{data.title}</div>
|
|
11
|
+
<div className={styles.value}>
|
|
12
|
+
{icon && icon}
|
|
13
|
+
{/* run count up if the item is visible and has not counted up yet */}
|
|
14
|
+
<LazyLoad>
|
|
15
|
+
<CountNumber end={parseInt(data.value)} />
|
|
16
|
+
</LazyLoad>
|
|
17
|
+
</div>
|
|
18
|
+
</>
|
|
19
|
+
);
|
|
22
20
|
|
|
23
21
|
CounterItem.propTypes = {
|
|
24
22
|
data: PropTypes.shape({
|
|
@@ -7,20 +7,22 @@ import CounterItem from './counter-item';
|
|
|
7
7
|
import styles from './counter.module.scss';
|
|
8
8
|
import keygen from '~helpers/keygen';
|
|
9
9
|
|
|
10
|
-
const Counter = ({ module }) =>
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
{module.content
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
10
|
+
const Counter = ({ module }) => (
|
|
11
|
+
<>
|
|
12
|
+
{module.content && (
|
|
13
|
+
<p className={styles.counterContent} dangerouslySetInnerHTML={{ __html: module.content }} />
|
|
14
|
+
)}
|
|
15
|
+
<ul className={styles.counter}>
|
|
16
|
+
{module.items.map((item) => {
|
|
17
|
+
return (
|
|
18
|
+
<li>
|
|
19
|
+
<CounterItem data={item} key={keygen()} />;
|
|
20
|
+
</li>
|
|
21
|
+
);
|
|
22
|
+
})}
|
|
23
|
+
</ul>
|
|
24
|
+
</>
|
|
25
|
+
);
|
|
24
26
|
|
|
25
27
|
Counter.propTypes = {
|
|
26
28
|
module: PropTypes.shape({
|
|
@@ -66,6 +66,10 @@ const Head = ({ page = {}, siteInfo }) => {
|
|
|
66
66
|
<meta name="og:type" content={page.path === '/' ? 'website' : 'article'} />
|
|
67
67
|
<meta name="og:image" content={pageImage} />
|
|
68
68
|
<meta name="og:url" content={getUrl(page.path)} />
|
|
69
|
+
<meta
|
|
70
|
+
property="og:locale"
|
|
71
|
+
content={getLanguage(page.language) === 'en' ? 'en_GB' : getLanguage(page.language)}
|
|
72
|
+
/>
|
|
69
73
|
|
|
70
74
|
{schemaGenerator(page, pageImage).map(
|
|
71
75
|
(schema) =>
|
|
@@ -6,11 +6,13 @@ export function parseCss(css) {
|
|
|
6
6
|
let token;
|
|
7
7
|
|
|
8
8
|
while ((token = tokenizer.exec(cssFormat))) {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
9
|
+
if (token[2] && token[2] !== 'null') {
|
|
10
|
+
obj[
|
|
11
|
+
token[1].replace(/-([a-z])/g, function (g) {
|
|
12
|
+
return g[1].toUpperCase();
|
|
13
|
+
})
|
|
14
|
+
] = token[2];
|
|
15
|
+
}
|
|
14
16
|
}
|
|
15
17
|
|
|
16
18
|
return obj;
|
|
@@ -5,7 +5,7 @@ describe('parseCss Helper', () => {
|
|
|
5
5
|
expect(typeof parseCss('margin-left: 20px;')).toEqual('object');
|
|
6
6
|
});
|
|
7
7
|
test('output', () => {
|
|
8
|
-
expect(parseCss('margin-left: 20px; margin-bottom:40px')).toEqual({
|
|
8
|
+
expect(parseCss('margin-left: 20px; margin-bottom:40px; height: null')).toEqual({
|
|
9
9
|
marginBottom: '40px',
|
|
10
10
|
marginLeft: '20px',
|
|
11
11
|
});
|