gatsby-core-theme 33.1.6 → 33.1.7

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,12 @@
1
+ ## [33.1.7](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/compare/v33.1.6...v33.1.7) (2024-07-02)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * beta deploy pipeline ([2c94e41](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/2c94e4122a9115d505eec96b85f97afa924eaf58))
7
+ * search translations ([975d9f7](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/975d9f7e3b22c31cc0127ba3635c2716f7f74623))
8
+ * tests ([000670e](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/000670ebb0f06c29d82619a775a40c7aa533172f))
9
+
1
10
  ## [33.1.6](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/compare/v33.1.5...v33.1.6) (2024-06-28)
2
11
 
3
12
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gatsby-core-theme",
3
- "version": "33.1.6",
3
+ "version": "33.1.7",
4
4
  "description": "Gatsby Theme NPM Package",
5
5
  "author": "",
6
6
  "license": "ISC",
@@ -1,6 +1,8 @@
1
- import React, { useState } from 'react';
1
+ import React, { useState, useContext } from 'react';
2
2
  import PropTypes from 'prop-types';
3
3
  import { FaSearch } from '@react-icons/all-files/fa/FaSearch';
4
+ import { Context } from 'gatsby-core-theme/src/context/MainProvider';
5
+ import { translate } from '~helpers/getters';
4
6
  import styles from './search.module.scss';
5
7
  import ModuleTitle from '~atoms/module-title';
6
8
  import Archive from '~organisms/archive';
@@ -16,6 +18,7 @@ const Search = ({
16
18
  showNumberOfResults = true,
17
19
  allMarkets,
18
20
  }) => {
21
+ const { translations } = useContext(Context) || {};
19
22
  const { data, searchParam } = serverData;
20
23
  const [sortQuery] = useState(pageSearchOptions.sort[0]);
21
24
  const [searchData, setSearchData] = useState(data);
@@ -49,13 +52,18 @@ const Search = ({
49
52
  const items = {
50
53
  items: searchData[item],
51
54
  model_type: item,
52
- title: titleObj ? titleObj.title : '',
55
+ title: titleObj ? translate(translations, titleObj.title, titleObj.title) : '',
53
56
  pagination_type: 'load_more',
54
57
  ...pageSearchOptions.archiveOptions.includeOptions,
55
58
  };
56
59
 
57
60
  return (
58
- <div results={items.items.length} label={item} tabId={item} key={keygen()}>
61
+ <div
62
+ results={items.items.length}
63
+ label={translate(translations, item, item)}
64
+ tabId={item}
65
+ key={keygen()}
66
+ >
59
67
  <ModuleTitle
60
68
  module={{
61
69
  module_title: item,
@@ -74,7 +82,9 @@ const Search = ({
74
82
 
75
83
  return (
76
84
  <div className={styles.container}>
77
- <h1>Search for: {searchParam}</h1>
85
+ <h1>
86
+ {translate(translations, 'search_for', 'Search For:')} {searchParam}
87
+ </h1>
78
88
  <form>
79
89
  <input
80
90
  type="text"
@@ -129,7 +139,13 @@ const Search = ({
129
139
  </Tabs>
130
140
  </div>
131
141
  ) : (
132
- <div className={styles.noData}>No data, please type keyword in textbox above</div>
142
+ <div className={styles.noData}>
143
+ {translate(
144
+ translations,
145
+ 'no_search_data',
146
+ 'No data, please type keyword in textbox above'
147
+ )}
148
+ </div>
133
149
  )}
134
150
  </div>
135
151
  );
@@ -65,7 +65,7 @@ describe('Search Component', () => {
65
65
  />
66
66
  );
67
67
 
68
- expect(getByText('Search for: casino')).toBeTruthy();
68
+ expect(getByText('Search For: casino')).toBeTruthy();
69
69
  const input = container.querySelectorAll('input');
70
70
  expect(input).toHaveLength(1);
71
71
  expect(input[0].getAttribute('placeholder')).toEqual('casino');