gatsby-core-theme 44.0.9 → 44.0.11

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,23 @@
1
+ ## [44.0.11](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/compare/v44.0.10...v44.0.11) (2025-04-03)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * create a ribbon component ([7d53c66](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/7d53c66d5a2b69fcba6fc55bbc1a79bbc2810fe6))
7
+ * [secure] by default ([515ec1b](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/515ec1b6b406ea1fac161e9dbef890bf24ffd33b))
8
+ * fix tests ([06e561d](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/06e561d77f5e364feafd99dd07e1de08864419f7))
9
+ * replace ribbons ([1288549](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/12885491aff16481c85c1daeb20d78527e685fde))
10
+
11
+
12
+ * Merge branch 'ribbons' into 'master' ([d581d6a](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/d581d6a628916f7ca0200e84c1e083e1955b43bf))
13
+
14
+ ## [44.0.10](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/compare/v44.0.9...v44.0.10) (2025-04-03)
15
+
16
+
17
+ ### Bug Fixes
18
+
19
+ * added new key in card items ([62acaee](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/62acaee9660d24f9a868dceda0a27d6b6ccad271))
20
+
1
21
  ## [44.0.9](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/compare/v44.0.8...v44.0.9) (2025-04-01)
2
22
 
3
23
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gatsby-core-theme",
3
- "version": "44.0.9",
3
+ "version": "44.0.11",
4
4
  "description": "Gatsby Theme NPM Package",
5
5
  "author": "",
6
6
  "license": "ISC",
@@ -0,0 +1,21 @@
1
+ import React from "react";
2
+ import PropTypes from "prop-types";
3
+ import keygen from "~helpers/keygen";
4
+ import styles from "./ribbon.module.scss";
5
+
6
+ export default function Ribbons({ item, customStyle="" }) {
7
+ if (!item) {
8
+ return null;
9
+ }
10
+ return (
11
+ <div className={`${styles.ribbons || ""} ${customStyle}`}>
12
+ {item &&
13
+ item.map((ribbon) => <span key={keygen}>{ribbon}</span>)}
14
+ </div>
15
+ );
16
+ }
17
+
18
+ Ribbons.propTypes = {
19
+ item: PropTypes.arrayOf(PropTypes.string).isRequired,
20
+ customStyle: PropTypes.string,
21
+ };
@@ -0,0 +1,28 @@
1
+ .ribbons {
2
+ position: absolute;
3
+ top: -1rem;
4
+
5
+ @include flex-direction(row);
6
+
7
+ gap: 1rem;
8
+
9
+ > span {
10
+ color: var(--robbons-text, #fff);
11
+ padding: 0.2rem 1rem;
12
+ background-color: var(--background-color, #000);
13
+ border-radius: 1rem;
14
+ }
15
+ }
16
+
17
+ .templateTwoRibbon {
18
+ position: static;
19
+ width: fit-content;
20
+ margin-top: 1.2rem;
21
+
22
+ @include min(tablet) {
23
+ position: absolute;
24
+ top: 2.4rem;
25
+ right: 2.4rem;
26
+ margin-top: 0;
27
+ }
28
+ }
@@ -0,0 +1,24 @@
1
+ import React from 'react';
2
+ import { render } from '@testing-library/react';
3
+ import '@testing-library/jest-dom/extend-expect';
4
+ import Ribbon from './index';
5
+
6
+ describe('Ribbon component', () => {
7
+ it('renders without crashing', () => {
8
+ const { container } = render(<Ribbon item={['Test Ribbon']} />);
9
+ expect(container).toBeInTheDocument();
10
+ });
11
+
12
+ it('renders ribbons correctly', () => {
13
+ const ribbons = ['Ribbon 1', 'Ribbon 2'];
14
+ const { getByText } = render(<Ribbon item={ribbons} />);
15
+ ribbons.forEach(ribbon => {
16
+ expect(getByText(ribbon)).toBeInTheDocument();
17
+ });
18
+ });
19
+
20
+ it('returns null if item is not provided', () => {
21
+ const { container } = render(<Ribbon item={null} />);
22
+ expect(container.firstChild).toBeNull();
23
+ });
24
+ });
@@ -2,6 +2,7 @@
2
2
  @include flex-direction(column);
3
3
  @include flex-align(center, center);
4
4
 
5
+ position: relative;
5
6
  flex-flow: wrap;
6
7
  border-radius: 1.6rem;
7
8
  background: var(--operator-banner-backgorund, #f4f4f4);
@@ -10,6 +10,7 @@ import Tnc from "~molecules/tnc";
10
10
  import PrettyLink from "~atoms/pretty-link";
11
11
  import { TrackingKeys } from '~constants/tracking-api'
12
12
  import styles from "./bonus.module.scss";
13
+ import Ribbons from "../../../atoms/ribbons";
13
14
 
14
15
  export default function Bonus({
15
16
  operator,
@@ -23,12 +24,15 @@ export default function Bonus({
23
24
  showRatingLabel = false,
24
25
  showLabelMiddle = false,
25
26
  ctaIcon = <FaArrowRight fontSize={20} title="Right-pointing Arrow Icon" />,
26
- modulePosition
27
+ modulePosition,
28
+ showRibbon = false,
27
29
  }) {
30
+
28
31
  const { logo, bonus, name } = operator || {};
29
32
  return (
30
33
  <div className={`${styles.operatorBanner || ""}`}>
31
34
  <div className={styles.container}>
35
+ {showRibbon && <Ribbons item={operator.ribbons} />}
32
36
  <div>
33
37
  <PrettyLink
34
38
  operator={operator}
@@ -98,6 +102,7 @@ Bonus.propTypes = {
98
102
  terms_and_conditions_text_enabled: PropTypes.string,
99
103
  }),
100
104
  status: PropTypes.string,
105
+ ribbons: PropTypes.arrayOf(PropTypes.string),
101
106
  }),
102
107
  tncFixed: PropTypes.bool,
103
108
  pageTemplate: PropTypes.string,
@@ -114,4 +119,5 @@ Bonus.propTypes = {
114
119
  showLabelMiddle: PropTypes.bool,
115
120
  ctaIcon: PropTypes.elementType,
116
121
  modulePosition: PropTypes.number,
122
+ showRibbon: PropTypes.bool,
117
123
  };
@@ -13,6 +13,7 @@ import VariableComponent from '../variables';
13
13
  import styles from './template-one-two.module.scss';
14
14
  import { TrackingKeys } from '~constants/tracking-api'
15
15
  import PrettyLink from '~atoms/pretty-link';
16
+ import Ribbons from '../../../../../atoms/ribbons';
16
17
 
17
18
  const TemplateOneTwo = ({
18
19
  relation,
@@ -70,14 +71,7 @@ const TemplateOneTwo = ({
70
71
  <h1>{name}</h1>
71
72
  {icon || <Verify />}
72
73
  </div>
73
- {ribbon && (
74
- <p
75
- className={`${styles.ribbon} ${template === 'template_two' && styles.templateTwoRibbon
76
- }`}
77
- >
78
- {ribbon}
79
- </p>
80
- )}
74
+ {ribbon && <Ribbons customStyle={template === 'template_two' ? styles.templateTwoRibbon : ''} item={[relation.ribbons[0]]} /> }
81
75
  {!['coming_soon', 'inactive'].includes(relation?.status) ? (
82
76
  <StarRating
83
77
  numOfStars={numOfStars}
@@ -1,5 +1,5 @@
1
1
  .container {
2
- background: #FFFFFF;
2
+ background: #FFF;
3
3
  border: 1.5px solid #E9E9E9;
4
4
  border-radius: 16px;
5
5
  position: relative;
@@ -13,7 +13,7 @@
13
13
  }
14
14
 
15
15
  >ul {
16
- margin: 0rem 1.6rem 1.6rem 1.6rem;
16
+ margin: 0 1.6rem 1.6rem;
17
17
 
18
18
  >li {
19
19
  margin: 0;
@@ -25,24 +25,17 @@
25
25
  }
26
26
 
27
27
  @include min(tablet) {
28
- margin: 0rem 2.4rem 2.4rem 2.4rem;
28
+ margin: 0 2.4rem 2.4rem;
29
29
  }
30
30
  }
31
31
 
32
32
  >div:last-child {
33
- margin: 0rem 1.6rem 1.6rem 1.6rem;
33
+ margin: 0 1.6rem 1.6rem;
34
34
  margin-bottom: 2.4rem;
35
35
 
36
- >a>svg {
37
- display: none;
38
- }
39
-
40
36
  @include min(tablet) {
41
- margin: 0 2.4rem 2.4rem 2.4rem;
37
+ margin: 0 2.4rem 2.4rem;
42
38
 
43
- >a>svg {
44
- display: inline;
45
- }
46
39
  }
47
40
  }
48
41
 
@@ -61,7 +54,7 @@
61
54
  width: 88px;
62
55
  min-width: 88px;
63
56
  height: 88px;
64
- background-color: white;
57
+ background-color: #fff;
65
58
  border: 1.5px solid #E9E9E9;
66
59
  border-radius: 16px;
67
60
 
@@ -124,7 +117,7 @@
124
117
  @include min(tablet) {
125
118
  justify-content: center;
126
119
  margin-left: 22.5rem;
127
- margin-top: 0rem;
120
+ margin-top: 0;
128
121
  min-height: 15.8rem;
129
122
  }
130
123
  }
@@ -153,30 +146,6 @@
153
146
  }
154
147
  }
155
148
 
156
- .ribbon {
157
- position: absolute;
158
- top: 1.6rem;
159
- right: 1.6rem;
160
- background-color: #FF8F2F;
161
- padding: 6px 12px;
162
- border-radius: 100px;
163
- font-weight: 700;
164
- font-size: 10px;
165
- line-height: 13px;
166
- color: #1C1A28;
167
- text-align: center;
168
- letter-spacing: 0.5px;
169
- text-transform: uppercase;
170
-
171
- @include min(tablet) {
172
- top: 2.4rem;
173
- right: 2.4rem;
174
- padding: 7px 16px;
175
- font-size: 12px;
176
- line-height: 15px;
177
- }
178
- }
179
-
180
149
  .templateTwoContainer {
181
150
  margin: var(--operator-template-two-margin-mobile, 1.6rem);
182
151
  display: flex;
@@ -202,14 +171,14 @@
202
171
  }
203
172
 
204
173
  >div:last-child {
205
- margin: 0 1.6rem 1.6rem 1.6rem;
174
+ margin: 0 1.6rem 1.6rem;
206
175
  order: 2;
207
176
 
208
177
  @include min(tablet) {
209
178
  order: 3;
210
- margin: 0rem;
211
- border-top-left-radius: 0px;
212
- border-top-right-radius: 0px;
179
+ margin: 0;
180
+ border-top-left-radius: 0;
181
+ border-top-right-radius: 0;
213
182
  }
214
183
  }
215
184
  }
@@ -252,21 +221,7 @@
252
221
  }
253
222
  }
254
223
 
255
- .templateTwoRibbon {
256
- position: static;
257
- width: fit-content;
258
- margin-top: 1.2rem;
259
-
260
- @include min(tablet) {
261
- position: absolute;
262
- top: 2.4rem;
263
- right: 2.4rem;
264
- margin-top: 0rem;
265
- }
266
- }
267
-
268
224
  .ratingInactive {
269
-
270
225
  background-color: #FBFBFB !important;
271
226
  color: #6B6A72 !important;
272
227
  font-weight: 700;
@@ -46,20 +46,6 @@
46
46
  }
47
47
  }
48
48
 
49
- .ribbons {
50
- position: absolute;
51
- top: -1rem;
52
- @include flex-direction(row);
53
- gap: 1rem;
54
-
55
- > span {
56
- color: white;
57
- padding: .2rem 1rem;
58
- background-color: red;
59
- border-radius: 1rem;
60
- }
61
- }
62
-
63
49
  .logo {
64
50
  @include flex-direction(column);
65
51
  }
@@ -12,6 +12,7 @@ import LazyImage from '~hooks/lazy-image'
12
12
  import { TrackingKeys } from '~constants/tracking-api'
13
13
 
14
14
  import styles from './default-row.module.scss'
15
+ import Ribbons from '../../../atoms/ribbons'
15
16
 
16
17
  const Row = ({
17
18
  item,
@@ -45,9 +46,7 @@ const Row = ({
45
46
  }`}
46
47
  ref={(el) => addToRefs(el, index)}
47
48
  >
48
- <div className={styles.ribbons || ''}>
49
- {item.ribbons && item.ribbons.map((ribbon) => <span>{ribbon}</span>)}
50
- </div>
49
+ {item?.ribbons && <Ribbons item={item?.ribbons} />}
51
50
  <PrettyLink
52
51
  operator={item}
53
52
  pageTemplate={pageTemplate}
@@ -13,6 +13,7 @@ export const pickPageKeys = [
13
13
  "market",
14
14
  "sections",
15
15
  "description",
16
+ "template",
16
17
  "true_votes",
17
18
  "false_votes",
18
19
  "reading_time",