gatsby-core-theme 1.6.21 → 2.0.2

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.
Files changed (36) hide show
  1. package/CHANGELOG.md +85 -0
  2. package/gatsby-node.esm.js +14 -3
  3. package/package.json +2 -2
  4. package/src/components/app.js +4 -0
  5. package/src/components/atoms/iframe/index.js +15 -9
  6. package/src/components/atoms/selling-points/index.js +1 -2
  7. package/src/components/atoms/selling-points/selling-points.module.scss +12 -5
  8. package/src/components/atoms/selling-points/selling-points.test.js +1 -1
  9. package/src/components/molecules/content/index.js +10 -1
  10. package/src/components/molecules/footer/footer.test.js +22 -22
  11. package/src/components/molecules/footer/index.js +3 -1
  12. package/src/components/molecules/header/index.js +7 -2
  13. package/src/components/molecules/link-list/index.js +9 -12
  14. package/src/components/molecules/operator-banner/operator-banner.test.js +0 -1
  15. package/src/components/molecules/search/index.js +5 -3
  16. package/src/components/molecules/slider/index.js +6 -2
  17. package/src/components/molecules/slider/slider.test.js +30 -23
  18. package/src/components/molecules/star-rating/index.js +10 -22
  19. package/src/components/molecules/star-rating/star-rating.module.scss +13 -1
  20. package/src/components/molecules/star-rating/star-rating.test.js +5 -4
  21. package/src/components/molecules/tnc/index.js +2 -3
  22. package/src/components/molecules/tnc/tnc.test.js +0 -1
  23. package/src/components/molecules/toplist/default-row/index.js +22 -20
  24. package/src/components/pages/search/index.js +3 -2
  25. package/src/helpers/device-detect.js +5 -6
  26. package/src/helpers/events.js +91 -0
  27. package/src/helpers/generators.js +11 -3
  28. package/src/helpers/generators.test.js +34 -12
  29. package/src/helpers/processor/sports.js +0 -2
  30. package/src/helpers/rating.js +2 -0
  31. package/src/helpers/schedule.js +0 -36
  32. package/src/hooks/lazy-image/index.js +30 -44
  33. package/src/hooks/tabs/index.js +4 -2
  34. package/src/hooks/tabs/tabs.test.js +32 -15
  35. package/src/styles/utils/_mixins.scss +42 -0
  36. package/src/styles/utils/variables/_main.scss +8 -0
@@ -1,11 +1,11 @@
1
1
  import React from 'react';
2
- import { render, cleanup, fireEvent } from '@testing-library/react';
2
+ import { render, cleanup, fireEvent, waitFor } from '@testing-library/react';
3
3
  import '@testing-library/jest-dom/extend-expect';
4
4
 
5
5
  import Tabs from '.';
6
6
 
7
7
  describe('Tabs Component', () => {
8
- test('render tabs', () => {
8
+ test('render tabs', async () => {
9
9
  const { container, getByText } = render(
10
10
  <Tabs tabsAlign="right" HeaderComp={<div className="header">my header</div>}>
11
11
  <div label="one" key={1}>
@@ -19,15 +19,18 @@ describe('Tabs Component', () => {
19
19
  </div>
20
20
  </Tabs>
21
21
  );
22
- expect(container.querySelectorAll('.tabListItem')).toHaveLength(2);
23
- // tabsAlign="right"
24
- expect(container.querySelectorAll('div.tabsHeader.invertOrder')).toHaveLength(1);
25
- // // HeaderComp
26
- expect(getByText('my header')).toBeTruthy();
27
- expect(getByText('1111111111111')).toBeTruthy();
22
+
23
+ await waitFor(() => {
24
+ expect(container.querySelectorAll('.tabListItem')).toHaveLength(2);
25
+ // tabsAlign="right"
26
+ expect(container.querySelectorAll('div.tabsHeader.invertOrder')).toHaveLength(1);
27
+ // // HeaderComp
28
+ expect(getByText('my header')).toBeTruthy();
29
+ expect(getByText('1111111111111')).toBeTruthy();
30
+ });
28
31
  });
29
32
 
30
- test('show all', () => {
33
+ test('show all', async () => {
31
34
  const { container, getByText } = render(
32
35
  <Tabs
33
36
  tabsAlign="left"
@@ -45,12 +48,14 @@ describe('Tabs Component', () => {
45
48
  </div>
46
49
  </Tabs>
47
50
  );
48
- expect(container.querySelectorAll('.tabListItem')).toHaveLength(3);
49
- expect(container.querySelectorAll('div.tabsHeader')).toHaveLength(1);
50
- expect(getByText('1111111111111222222233333333')).toBeInTheDocument();
51
+ await waitFor(() => {
52
+ expect(container.querySelectorAll('.tabListItem')).toHaveLength(3);
53
+ expect(container.querySelectorAll('div.tabsHeader')).toHaveLength(1);
54
+ expect(getByText('1111111111111222222233333333')).toBeInTheDocument();
55
+ });
51
56
  });
52
57
 
53
- test('switch tabs', () => {
58
+ test('switch tabs', async () => {
54
59
  const { getByText } = render(
55
60
  <Tabs tabsAlign="right" HeaderComp={<div className="header">my header</div>}>
56
61
  <div label="one" key={1}>
@@ -64,11 +69,23 @@ describe('Tabs Component', () => {
64
69
  </div>
65
70
  </Tabs>
66
71
  );
72
+
73
+ await waitFor(() => {
74
+ expect(getByText('two')).toBeTruthy();
75
+ });
76
+
67
77
  fireEvent.click(getByText('two'));
68
78
  expect(getByText('2222222')).toBeTruthy();
69
- fireEvent.click(getByText('three'));
79
+
80
+ await waitFor(() => {
81
+ fireEvent.click(getByText('three'));
82
+ });
83
+
70
84
  expect(getByText('33333333')).toBeTruthy();
71
- fireEvent.click(getByText('one'));
85
+
86
+ await waitFor(() => {
87
+ fireEvent.click(getByText('one'));
88
+ });
72
89
  expect(getByText('1111111111111')).toBeTruthy();
73
90
  });
74
91
  });
@@ -84,3 +84,45 @@
84
84
  background: linear-gradient(to bottom, $color2 0, $color1 100%);
85
85
  }
86
86
  }
87
+
88
+ @mixin star($border-color: #fba62f, $fill-color: #fba62f) {
89
+ line-height: 2rem;
90
+ width: 16px;
91
+ font-weight: normal;
92
+ display: inline-block;
93
+ color: $fill-color;
94
+ font-size: 15px;
95
+ position: relative;
96
+ text-shadow: -1px 0 $border-color, 0 1px $border-color, 1px 0 $border-color, 0 -1px $border-color;
97
+
98
+ &:last-child {
99
+ margin-right: 0;
100
+ }
101
+ &:before {
102
+ content: '\2605';
103
+ }
104
+ }
105
+
106
+
107
+ @mixin half-star($border-color: #fba62f, $half-empty-color: #fba62f , $half-full-color: white) {
108
+ line-height: 2rem;
109
+ width: 16px;
110
+ font-weight: normal;
111
+ display: inline-block;
112
+ color: $half-full-color;
113
+ font-size: 15px;
114
+ position: relative;
115
+ &:before {
116
+ content: '\2605';
117
+ }
118
+ text-shadow: -1px 0 $border-color, 0 1px $border-color, 1px 0 $border-color, 0 -1px $border-color;
119
+ &:after {
120
+ content: '\2605';
121
+ color: $half-empty-color;
122
+ position: absolute;
123
+ width: 7px;
124
+ overflow: hidden;
125
+ bottom: 0;
126
+ left: 0;
127
+ }
128
+ }
@@ -9,6 +9,13 @@
9
9
  --secondary-text-color: var(--color-4);
10
10
  --heading-base-color: var(--color-12);
11
11
  --text-link-color: var(--color-13);
12
+ --full-star-fill-color: #fba62f;
13
+ --full-star-border-color: #fba62f;
14
+ --halfFull-star-fill-color: #fba62f;
15
+ --halfEmpty-star-fill-color: white;
16
+ --half-star-border-color: #fba62f;
17
+ --empty-star-fill-color: white;
18
+ --empty-star-border-color: grey;
12
19
 
13
20
  // Font
14
21
  --main-font: Nunito;
@@ -51,6 +58,7 @@
51
58
  --modal-background-color: white;
52
59
 
53
60
  --star-rating-color: orange;
61
+ --selling-point-icon-color: #00889e;
54
62
 
55
63
  --scroll-to-top-background-color: var(--color-1);
56
64