gatsby-core-theme 2.0.15 → 2.0.19

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,48 @@
1
+ ## [2.0.19](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/compare/v2.0.18...v2.0.19) (2022-01-11)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * bonus and selleing points extra divs ([892d6a4](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/892d6a4542efeb16717136472b0422ca5e089ca8))
7
+ * make key dynamic cta ([a7b883c](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/a7b883cfa2010d5e95d54137e1cb7f86a92115ac))
8
+
9
+
10
+ * Merge branch 'tm-2473-lottery-fixes' into 'master' ([fbc331c](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/fbc331c1d3f8ff3276b56e518e6de3e359393fc2))
11
+ * Merge branch 'master' of git.ilcd.rocks:team-floyd/themes/gatsby-themes ([86b2be9](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/86b2be99241420c6fb77fb3bea3e22f69a1ddb98))
12
+
13
+ ## [2.0.18](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/compare/v2.0.17...v2.0.18) (2022-01-10)
14
+
15
+
16
+ ### Config
17
+
18
+ * reverted gatsby upgrade ([4155578](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/415557860165a0e9fa5a327470cea2570d0d57ed))
19
+
20
+ ## [2.0.17](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/compare/v2.0.16...v2.0.17) (2022-01-10)
21
+
22
+
23
+ ### Bug Fixes
24
+
25
+ * removing cards extra divs ([7096d88](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/7096d88b480a43d4d8bd5245cf403b07f194fae0))
26
+ * updated html parser package ([332b237](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/332b237bc728bfe57766fab1bced598ad18ceeb6))
27
+
28
+
29
+ ### Config
30
+
31
+ * updated gatsby packages ([cdfc9c3](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/cdfc9c3681db2603061b0fcc1f4ef634ce12e7a1))
32
+
33
+
34
+ * Merge branch 'upgrade' into 'master' ([e38a936](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/e38a936bc76221072c5d0e89c66fccd3df3cbad7))
35
+
36
+ ## [2.0.16](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/compare/v2.0.15...v2.0.16) (2022-01-05)
37
+
38
+
39
+ ### Bug Fixes
40
+
41
+ * update-placeholder-generation-with-title ([92e3cf2](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/92e3cf2663345ddaffb040504f4830d445d2f73c))
42
+
43
+
44
+ * Merge branch 'hotfix-update-placeholder-generation-with-title' into 'master' ([44d05d6](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/44d05d648d49bdb2d5776d7133e3b569ac1f6353))
45
+
1
46
  ## [2.0.15](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/compare/v2.0.14...v2.0.15) (2022-01-05)
2
47
 
3
48
 
@@ -5,7 +5,7 @@
5
5
  import { cloneDeep, chunk, pick } from 'lodash';
6
6
  import chalk from 'chalk';
7
7
  import { getData, getLocalData } from './src/helpers/api';
8
- import { generateMetaString, generateTrackerLink } from './src/helpers/generators';
8
+ import { generatePlaceholderString, generateTrackerLink } from './src/helpers/generators';
9
9
  import processor, { processSitemapPages } from './src/helpers/processor';
10
10
  import { pickAuthorsPageKeys } from './src/constants/pick-keys';
11
11
 
@@ -204,16 +204,22 @@ exports.createPages = async ({ actions: { createPage } }, themeOptions) => {
204
204
  pick(authors[key], pickAuthorsPageKeys)
205
205
  );
206
206
 
207
- // replacing meta placehoders with year, month, date, etc.
207
+ // replacing string placehoders with year, month, date, etc.
208
+ page.title =
209
+ page.title &&
210
+ generatePlaceholderString(page.title, translations, {
211
+ siteName: response.general.site_name,
212
+ siteTitle: page.title,
213
+ });
208
214
  page.meta_title =
209
215
  page.meta_title &&
210
- generateMetaString(page.meta_title, translations, {
216
+ generatePlaceholderString(page.meta_title, translations, {
211
217
  siteName: response.general.site_name,
212
218
  siteTitle: page.title,
213
219
  });
214
220
  page.meta_description =
215
221
  page.meta_description &&
216
- generateMetaString(page.meta_description, translations, {
222
+ generatePlaceholderString(page.meta_description, translations, {
217
223
  siteName: response.general.site_name,
218
224
  siteTitle: page.title,
219
225
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gatsby-core-theme",
3
- "version": "2.0.15",
3
+ "version": "2.0.19",
4
4
  "description": "Gatsby Theme NPM Package",
5
5
  "main": "index.js",
6
6
  "GATSBY_RECAPTCHA_SITEKEY": "6LfoyvMUAAAAAO4nl_MQnqHb4XdHxEiu5cXgIqeB",
@@ -45,7 +45,7 @@
45
45
  "gatsby-plugin-webfonts": "^2.1.0",
46
46
  "gatsby-source-filesystem": "^3.3.0",
47
47
  "gatsby-transformer-sharp": "^3.3.0",
48
- "html-react-parser": "^1.2.5",
48
+ "html-react-parser": "^1.3.0",
49
49
  "js-search": "^2.0.0",
50
50
  "lodash": "^4.17.15",
51
51
  "node-sass": "5.0.0",
@@ -1,15 +1,12 @@
1
- .bonus {
2
- @include flex-direction(column);
3
- div:first-child {
4
- font-size: 2rem;
5
- font-weight: 700;
6
- color: var(--primary-color);
7
- padding-right: 1rem;
8
- }
9
- div:nth-child(2) {
10
- font-size: 1.6rem;
11
- color: var(--color-22);
12
- font-weight: 700;
13
- padding: 0.5rem 0;
14
- }
1
+ .title {
2
+ font-size: 2rem;
3
+ font-weight: 700;
4
+ color: var(--primary-color);
5
+ padding-right: 1rem;
6
+ }
7
+ .desc {
8
+ font-size: 1.6rem;
9
+ color: var(--color-22);
10
+ font-weight: 700;
11
+ padding: 0.5rem 0;
15
12
  }
@@ -14,12 +14,10 @@ const Bonus = ({ item, tracker = 'main' }) => {
14
14
  const onelinerSplitted = oneLiner.one_liner.split('+');
15
15
 
16
16
  return (
17
- <div className={styles.bonus}>
18
- <div className={styles.title}>{onelinerSplitted[0]}</div>
19
- {onelinerSplitted.length === 2 && (
20
- <div className={styles.desc}>{`+${onelinerSplitted[1]}`}</div>
21
- )}
22
- </div>
17
+ <>
18
+ <p className={styles.title}>{onelinerSplitted[0]}</p>
19
+ {onelinerSplitted.length === 2 && <p className={styles.desc}>{`+${onelinerSplitted[1]}`}</p>}
20
+ </>
23
21
  );
24
22
  };
25
23
 
@@ -12,6 +12,7 @@ export default function OperatorCta({
12
12
  placeholderText = 'Coming Soon',
13
13
  closedCasinoText = 'This Casino has closed',
14
14
  playText = 'Visit',
15
+ translationKey = 'play_now',
15
16
  tracker = 'main',
16
17
  gtmClass = '',
17
18
  }) {
@@ -46,7 +47,7 @@ export default function OperatorCta({
46
47
 
47
48
  const trackerType = tracker.toLowerCase().replace(' ', '_');
48
49
  const prettyLink = prettyTracker(operator, trackerType);
49
- const translateBtn = translate(translations, 'play_now', playText);
50
+ const translateBtn = translate(translations, translationKey, playText);
50
51
  return (
51
52
  <Button
52
53
  to={prettyLink}
@@ -11,9 +11,8 @@ const SellingPoints = ({ sellingPoints, icon, limit = 3 }) => {
11
11
  return (
12
12
  <ul className={styles.sellingPoint}>
13
13
  {sellingPoints.slice(0, limit).map((item) => (
14
- <li key={keygen()}>
15
- <span className={`${icon && styles.tick}`}>{` `}</span>
16
- <span>{item}</span>
14
+ <li className={`${icon && styles.tick}`} key={keygen()}>
15
+ {item}
17
16
  </li>
18
17
  ))}
19
18
  </ul>
@@ -7,7 +7,7 @@
7
7
  font-size: 1.4rem;
8
8
  width: 100%;
9
9
 
10
- .tick {
10
+ &.tick {
11
11
  position: relative;
12
12
  margin-left: 2rem;
13
13
  &::before {
@@ -16,7 +16,6 @@
16
16
  padding: 0px 0px .8rem .32rem;
17
17
  border-right-width: .18rem;
18
18
  border-bottom-width: .18rem;
19
- bottom: -.3rem;
20
19
  left: -1.8rem;
21
20
  }
22
21
  }
@@ -43,7 +43,14 @@ const Row = ({ item, oneliner = 'main', layout = 'list', tracker = 'main' }) =>
43
43
  height={40}
44
44
  />
45
45
  </a>
46
- <Bonus item={item} tracker={oneliner} />
46
+ <a
47
+ href={prettyLink}
48
+ target="_blank"
49
+ rel="noreferrer"
50
+ className="toplist-variant-one-gtm bonus-cta"
51
+ >
52
+ <Bonus item={item} tracker={oneliner} />
53
+ </a>
47
54
  <StarRating numOfStars={5} rating={itemRating} />
48
55
  <SellingPoints icon={<MdCheck />} sellingPoints={item.selling_points} />
49
56
  <div>
@@ -12,6 +12,7 @@ const CardsGridStyles = ({
12
12
  mobileColumns = 2,
13
13
  tabletColumns = 3,
14
14
  desktopColumns = 4,
15
+ className = '',
15
16
  }) => {
16
17
  const divStyle = {
17
18
  '--cards-mob-column': `${
@@ -24,10 +25,15 @@ const CardsGridStyles = ({
24
25
  module.desktop_num_of_columns ? module.desktop_num_of_columns : desktopColumns
25
26
  }`,
26
27
  };
27
- return <div style={divStyle}>{children}</div>;
28
+ return (
29
+ <div className={className} style={divStyle}>
30
+ {children}
31
+ </div>
32
+ );
28
33
  };
29
34
 
30
35
  CardsGridStyles.propTypes = {
36
+ className: PropTypes.string,
31
37
  module: PropTypes.shape({
32
38
  mobile_num_of_columns: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
33
39
  tablet_num_of_columns: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
@@ -53,25 +59,23 @@ const Cards = ({
53
59
  desktopColumns={desktopColumns}
54
60
  tabletColumns={tabletColumns}
55
61
  mobileColumns={mobileColumns}
62
+ className={styles.cardsContainer}
56
63
  >
57
- <div className={styles.cardsContainer}>
58
- {module.items &&
59
- module.items.map((item, index) => (
60
- <div key={keygen()}>
61
- {CustomCardComponent ? (
62
- <CustomCardComponent
63
- featured={module.style === 'featured'}
64
- item={item}
65
- type={item.type}
66
- number={index + 1}
67
- page={page}
68
- />
69
- ) : (
70
- <Card item={item} />
71
- )}
72
- </div>
73
- ))}
74
- </div>
64
+ {module.items &&
65
+ module.items.map((item, index) =>
66
+ CustomCardComponent ? (
67
+ <CustomCardComponent
68
+ key={keygen()}
69
+ featured={module.style === 'featured'}
70
+ item={item}
71
+ type={item.type}
72
+ number={index + 1}
73
+ page={page}
74
+ />
75
+ ) : (
76
+ <Card key={keygen()} item={item} />
77
+ )
78
+ )}
75
79
  </CardsGridStyles>
76
80
  );
77
81
 
@@ -21,7 +21,7 @@ export function generateTrackerLink(operator, trackerType) {
21
21
  }
22
22
  }
23
23
 
24
- export function generateMetaString(metaString, translations, props) {
24
+ export function generatePlaceholderString(string, translations, props) {
25
25
  const date = new Date();
26
26
  const day = date.getDate();
27
27
  const month = months[date.getMonth()];
@@ -29,7 +29,7 @@ export function generateMetaString(metaString, translations, props) {
29
29
  const regex =
30
30
  /\[MONTH\]|\[YEAR\]|\[currentyear\]|\[sitename\]|\[currentmonth\]|\[title\]|\[currentdate\]/gi;
31
31
 
32
- return metaString.replace(
32
+ return string.replace(
33
33
  regex,
34
34
  (match) =>
35
35
  ({
@@ -1,4 +1,4 @@
1
- import { generateTrackerLink, generateMetaString } from './generators';
1
+ import { generateTrackerLink, generatePlaceholderString } from './generators';
2
2
  import { months } from '~constants/common';
3
3
 
4
4
  describe('Generate Tracker Link Helper', () => {
@@ -16,19 +16,19 @@ describe('Generate Tracker Link Helper', () => {
16
16
  });
17
17
  });
18
18
 
19
- describe('Generate Meta Title Helper', () => {
20
- test('generateMetaString uppercase', () => {
21
- const metaString = generateMetaString('meta title [MONTH] [YEAR]');
19
+ describe('Generate Placeholders String', () => {
20
+ test('generatePlaceholderString uppercase', () => {
21
+ const string = generatePlaceholderString('Some title [MONTH] [YEAR]');
22
22
  const date = new Date();
23
23
 
24
- expect(metaString).not.toContain('[MONTH]');
25
- expect(metaString).not.toContain('[YEAR]');
26
- expect(metaString).toContain(date.getFullYear());
27
- expect(metaString).toContain(months[date.getMonth()]);
24
+ expect(string).not.toContain('[MONTH]');
25
+ expect(string).not.toContain('[YEAR]');
26
+ expect(string).toContain(date.getFullYear());
27
+ expect(string).toContain(months[date.getMonth()]);
28
28
  });
29
- test('generateMetaString lowercase', () => {
30
- const metaString = generateMetaString(
31
- 'meta title [currentdate] [currentmonth] [currentyear] [sitename] [title]',
29
+ test('generatePlaceholderString lowercase', () => {
30
+ const string = generatePlaceholderString(
31
+ 'Some title [currentdate] [currentmonth] [currentyear] [sitename] [title]',
32
32
  null,
33
33
  {
34
34
  siteName: 'Site Name',
@@ -37,26 +37,26 @@ describe('Generate Meta Title Helper', () => {
37
37
  );
38
38
  const date = new Date();
39
39
 
40
- expect(metaString).not.toContain('[currentdate]');
41
- expect(metaString).not.toContain('[currentmonth]');
42
- expect(metaString).not.toContain('[currentyear]');
43
- expect(metaString).not.toContain('[sitename]');
44
- expect(metaString).not.toContain('[title]');
45
- expect(metaString).toContain(date.getDate());
46
- expect(metaString).toContain(months[date.getMonth()]);
47
- expect(metaString).toContain(date.getFullYear());
48
- expect(metaString).toContain('Site Name');
49
- expect(metaString).toContain('Site Title');
40
+ expect(string).not.toContain('[currentdate]');
41
+ expect(string).not.toContain('[currentmonth]');
42
+ expect(string).not.toContain('[currentyear]');
43
+ expect(string).not.toContain('[sitename]');
44
+ expect(string).not.toContain('[title]');
45
+ expect(string).toContain(date.getDate());
46
+ expect(string).toContain(months[date.getMonth()]);
47
+ expect(string).toContain(date.getFullYear());
48
+ expect(string).toContain('Site Name');
49
+ expect(string).toContain('Site Title');
50
50
  });
51
- test('generateMetaString translated', () => {
51
+ test('generatePlaceholderString translated', () => {
52
52
  const translateMonths = months.reduce(
53
53
  (translated, month) => ({ ...translated, [month]: `translate${month.substring(0, 1)}` }),
54
54
  {}
55
55
  );
56
- const metaString = generateMetaString('meta title [MONTH]', translateMonths);
56
+ const string = generatePlaceholderString('Some title [MONTH]', translateMonths);
57
57
  const date = new Date();
58
58
 
59
- expect(metaString).not.toContain('[MONTH]');
60
- expect(metaString).toContain(translateMonths[months[date.getMonth()]]);
59
+ expect(string).not.toContain('[MONTH]');
60
+ expect(string).toContain(translateMonths[months[date.getMonth()]]);
61
61
  });
62
62
  });