gatsby-core-theme 34.0.2 → 34.0.4

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,17 @@
1
+ ## [34.0.4](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/compare/v34.0.3...v34.0.4) (2024-07-10)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * ribbons ([59e78af](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/59e78afe78fca743c7ddf9d76f6394d99dcadc12))
7
+
8
+ ## [34.0.3](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/compare/v34.0.2...v34.0.3) (2024-07-10)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * added class to tnc ([2ffb855](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/2ffb8557772d358c689097ae34b10c431507da40))
14
+
1
15
  ## [34.0.2](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/compare/v34.0.1...v34.0.2) (2024-07-10)
2
16
 
3
17
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gatsby-core-theme",
3
- "version": "34.0.2",
3
+ "version": "34.0.4",
4
4
  "description": "Gatsby Theme NPM Package",
5
5
  "author": "",
6
6
  "license": "ISC",
@@ -10,7 +10,7 @@ const Tnc = ({ operator, isFixed = false }) => {
10
10
  termsConditions && (
11
11
  <div
12
12
  tabIndex={`${isFixed ? 0 : -1}`}
13
- className={`${styles.container} ${isFixed ? styles.isFixed : ''}`}
13
+ className={`${styles.container} ${styles.tnc || ''} ${isFixed ? styles.isFixed : ''}`}
14
14
  // eslint-disable-next-line react/no-danger
15
15
  dangerouslySetInnerHTML={{ __html: termsConditions }}
16
16
  />
@@ -6,73 +6,85 @@ const { cloneDeep } = loadash;
6
6
 
7
7
  // eslint-disable-next-line import/prefer-default-export
8
8
  export function sanitizeOperatorData(
9
- operator,
10
- operatorPage = [],
11
- transformedPages = [],
12
- translations = [],
13
- data = []
9
+ operator,
10
+ operatorPage = [],
11
+ transformedPages = [],
12
+ translations = [],
13
+ data = []
14
14
  ) {
15
- const operatorClone = cloneDeep(operator);
16
- const clone = {};
17
- const { ribbons, extra_fields, bonus, selling_point_short_names } = operator;
18
- // Set Fallbacks
19
- clone.url = operator?.bonus?.operator_url || operator.url;
20
- clone.email = operator?.bonus?.support_email || operator.email;
21
- clone.name = operator?.bonus?.operator_name || operator.name;
15
+ const operatorClone = cloneDeep(operator);
16
+ const clone = {};
17
+ const { ribbons, extra_fields, bonus, selling_point_short_names } = operator;
18
+ // Set Fallbacks
19
+ clone.url = operator?.bonus?.operator_url || operator.url;
20
+ clone.email = operator?.bonus?.support_email || operator.email;
21
+ clone.name = operator?.bonus?.operator_name || operator.name;
22
22
 
23
- // Set Ribbons
24
- if (ribbons && ribbons.length && data && data.ribbons) {
25
- ribbons.forEach((res, indexOfRibbon) => {
26
- ribbons[indexOfRibbon] = data.ribbons[res] ? data.ribbons[res]?.label : null;
27
- })
28
- // filter out null ribbons
29
- clone.ribbons = ribbons.filter(n => n);
30
- }
31
- if (ribbons && ribbons.length && extra_fields.ribbon_text) {
32
- clone.ribbons = extra_fields.ribbon_text.split(',');
33
- }
23
+ // Set Ribbons
24
+ if (ribbons && ribbons.length && data && data.ribbons) {
25
+ ribbons.forEach((res, indexOfRibbon) => {
26
+ if (typeof res === 'string') {
27
+ ribbons[indexOfRibbon] = res;
28
+ } else {
29
+ ribbons[indexOfRibbon] = data.ribbons[res] ? data.ribbons[res]?.label : null;
30
+ }
31
+ });
34
32
 
35
- // Set Bonus
36
- if(bonus && bonus.deposit_methods && transformedPages){
37
- bonus.deposit_methods.forEach((e) => {
38
- const el =
39
- transformedPages.payment_method &&
40
- transformedPages.payment_method.find((el) => e.id === el.relation_id);
41
- if (el) e.path = el.path;
42
- });
43
- }
33
+ // filter out null ribbons
34
+ clone.ribbons = ribbons.filter((n) => n);
35
+ }
36
+ if (ribbons && ribbons.length && extra_fields.ribbon_text) {
37
+ clone.ribbons = extra_fields.ribbon_text.split(',');
38
+ }
44
39
 
45
- // Set Selling Points
46
- // eslint-disable-next-line no-unused-expressions
47
- clone.selling_points = translations.length ? updateArrayTranslations(
48
- operator.selling_points,
49
- selling_point_short_names,
50
- translations
51
- ).selling_point_names : selling_point_short_names;
40
+ // Set Bonus
41
+ if (bonus && bonus.deposit_methods && transformedPages) {
42
+ bonus.deposit_methods.forEach((e) => {
43
+ const el =
44
+ transformedPages.payment_method &&
45
+ transformedPages.payment_method.find((el) => e.id === el.relation_id);
46
+ if (el) e.path = el.path;
47
+ });
48
+ }
52
49
 
53
- // Set Deposit Methods
54
- clone.bonus = {};
55
- clone.bonus.deposit_methods = bonus?.deposit_methods && Array.isArray(bonus.deposit_methods)
56
- ? bonus.deposit_methods.map(({ id, name, standardised_logo_filename }) => ({ id, name, standardised_logo_filename }))
57
- : [];
50
+ // Set Selling Points
51
+ // eslint-disable-next-line no-unused-expressions
52
+ clone.selling_points = translations.length
53
+ ? updateArrayTranslations(operator.selling_points, selling_point_short_names, translations)
54
+ .selling_point_names
55
+ : selling_point_short_names;
58
56
 
59
- if (operatorPage[0]?.extra_fields) {
60
- clone.reviewSummery = getExtraField(
61
- operatorPage[0]?.extra_fields,
62
- 'operator_review_summary',
63
- null
64
- );
65
- }
57
+ // Set Deposit Methods
58
+ clone.bonus = {};
59
+ clone.bonus.deposit_methods =
60
+ bonus?.deposit_methods && Array.isArray(bonus.deposit_methods)
61
+ ? bonus.deposit_methods.map(({ id, name, standardised_logo_filename }) => ({
62
+ id,
63
+ name,
64
+ standardised_logo_filename,
65
+ }))
66
+ : [];
66
67
 
67
- if (operatorPage.length >= 1 && operatorPage[0].author) {
68
- clone.authorName = operatorPage[0].author.name;
69
- clone.authorPath = operatorPage[0].author.profile_page_path;
70
- clone.authorImage = operatorPage[0].author.image;
71
- clone.authorImageObject = operatorPage[0].author.image_object;
72
- }
68
+ if (operatorPage[0]?.extra_fields) {
69
+ clone.reviewSummery = getExtraField(
70
+ operatorPage[0]?.extra_fields,
71
+ 'operator_review_summary',
72
+ null
73
+ );
74
+ }
73
75
 
74
- // Set Logo Url
75
- clone.logo = operatorClone.logo_url_object || operatorClone.standardised_logo_url_object || operatorClone.default_logo_url_object;
76
-
77
- return Object.assign(clone, operator);
78
- }
76
+ if (operatorPage.length >= 1 && operatorPage[0].author) {
77
+ clone.authorName = operatorPage[0].author.name;
78
+ clone.authorPath = operatorPage[0].author.profile_page_path;
79
+ clone.authorImage = operatorPage[0].author.image;
80
+ clone.authorImageObject = operatorPage[0].author.image_object;
81
+ }
82
+
83
+ // Set Logo Url
84
+ clone.logo =
85
+ operatorClone.logo_url_object ||
86
+ operatorClone.standardised_logo_url_object ||
87
+ operatorClone.default_logo_url_object;
88
+
89
+ return Object.assign(clone, operator);
90
+ }