gatsby-core-theme 9.0.0 → 9.0.3

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,31 @@
1
+ ## [9.0.3](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/compare/v9.0.2...v9.0.3) (2022-08-04)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * add height of anchor like props ([98dfdae](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/98dfdaef2e1e10a6fb8165c9a2cd943fe7eaacec))
7
+
8
+ ## [9.0.2](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/compare/v9.0.1...v9.0.2) (2022-08-02)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * add author name and link to the toplist module ([9baa500](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/9baa500eec68512f76aacfb33554902a7dfa2a7a))
14
+ * modules test ([967fb13](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/967fb13555326b691303685b575e265ef6a8c661))
15
+
16
+
17
+ * Merge branch 'tm-2971-adding-expert-rating-to-toplist' into 'master' ([bffd32c](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/bffd32cac4fa8837c08052d9b5b2efa319d03099))
18
+
19
+ ## [9.0.1](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/compare/v9.0.0...v9.0.1) (2022-08-01)
20
+
21
+
22
+ ### Bug Fixes
23
+
24
+ * update spotlights module ([c646f9c](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/c646f9c878cd17456e1b271cd23908ea8eb59462))
25
+
26
+
27
+ * Merge branch 'tm-2979-spotlight-module-images' into 'master' ([0db5a40](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/0db5a40df3a0897157d312590cc2e7325669adfc))
28
+
1
29
  # [9.0.0](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/compare/v8.0.13...v9.0.0) (2022-07-29)
2
30
 
3
31
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gatsby-core-theme",
3
- "version": "9.0.0",
3
+ "version": "9.0.3",
4
4
  "description": "Gatsby Theme NPM Package",
5
5
  "main": "index.js",
6
6
  "GATSBY_RECAPTCHA_SITEKEY": "6LfoyvMUAAAAAO4nl_MQnqHb4XdHxEiu5cXgIqeB",
@@ -17,7 +17,7 @@ const Spotlights = ({ module, themeStyles = {} }) => {
17
17
  const content = (item) => {
18
18
  const img = mode === 'icon' ? item.icon : item.image;
19
19
 
20
- const imageSize = module.style ? imgSize[module.style] : imgSize.default;
20
+ const imageSize = imgSize[module.style] ? imgSize[module.style] : imgSize.default;
21
21
  const imageSrc = imagePrettyUrl(img, imageSize?.width, imageSize?.height);
22
22
 
23
23
  const fileName = getImageFilename(imageSrc);
@@ -17,6 +17,8 @@ function Anchor({
17
17
  isFixed = true,
18
18
  icon = null,
19
19
  showTitle = true,
20
+ heightOfAnchor = 60,
21
+ offset = 10,
20
22
  }) {
21
23
  const [offsetTop, setOffsetTop] = useState(null);
22
24
  const itemsRef = useRef([]);
@@ -38,7 +40,7 @@ function Anchor({
38
40
  if (targetEl) {
39
41
  const offsetPosition = targetEl.offsetTop - headerOffset;
40
42
  window.scrollTo({
41
- top: isFixed ? offsetPosition - 59 : offsetPosition,
43
+ top: isFixed ? offsetPosition - heightOfAnchor : offsetPosition,
42
44
  });
43
45
  }
44
46
  };
@@ -47,7 +49,7 @@ function Anchor({
47
49
  // get element in viewport
48
50
  const currentAnchor = anchorList?.map((el) => {
49
51
  const element = document.getElementById(el.id);
50
- if (element?.offsetTop - headerOffset - 60 <= window.scrollY) {
52
+ if (element?.offsetTop - headerOffset - heightOfAnchor - offset <= window.scrollY) {
51
53
  return element;
52
54
  }
53
55
  return null;
@@ -139,6 +141,8 @@ Anchor.propTypes = {
139
141
  isFixed: PropTypes.bool,
140
142
  icon: PropTypes.element,
141
143
  showTitle: PropTypes.string,
144
+ heightOfAnchor: PropTypes.number,
145
+ offset: PropTypes.number,
142
146
  };
143
147
 
144
148
  export default Anchor;
@@ -1,5 +1,5 @@
1
1
  const imgSize = {
2
- template_1: {
2
+ testimonials: {
3
3
  width: 100,
4
4
  height: 50,
5
5
  },
@@ -238,10 +238,18 @@ export function processArchiveModule(module, pages) {
238
238
  module.numOfPages = 1;
239
239
  }
240
240
 
241
- export function processTopListModule(module, relations) {
241
+ export function processTopListModule(module, relations, pages) {
242
242
  module.items = module.items.map((listItem) => {
243
243
  listItem.items = listItem.items.map((item) => {
244
244
  const clone = pick(cloneDeep(relations.operator[item.operator_id]), topListPickKeys);
245
+ const operatorPage = pages
246
+ ? pages.operator.filter((page) => page.relation_id === item.operator_id)
247
+ : [];
248
+
249
+ if (operatorPage.length >= 1) {
250
+ clone.authorName = operatorPage[0].author.name;
251
+ clone.authorPath = operatorPage[0].author.profile_page_path;
252
+ }
245
253
  delete clone.software;
246
254
  delete clone.bonus.deposit_methods;
247
255
  return Object.assign(clone, item);
@@ -283,7 +291,7 @@ export function processModule(
283
291
  } else if (module.name === 'archive' && previewMode) {
284
292
  processArchiveModule(module, pages);
285
293
  } else if (module.name === 'top_list') {
286
- processTopListModule(module, relations);
294
+ processTopListModule(module, relations, pages);
287
295
  } else if (module.name === 'menu' && menus && menus[module.menu_id]) {
288
296
  module = Object.assign(module, menus[module.menu_id]);
289
297
  }