gatsby-matrix-theme 2.3.4 → 2.3.8

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 (64) hide show
  1. package/CHANGELOG.md +55 -0
  2. package/package.json +2 -2
  3. package/src/components/atoms/author-card/author-card.module.scss +44 -0
  4. package/src/components/atoms/author-card/author-card.stories.js +47 -0
  5. package/src/components/atoms/author-card/author-card.test.js +29 -0
  6. package/src/components/atoms/author-card/index.js +41 -0
  7. package/src/components/atoms/cards/operator-card/index.js +1 -1
  8. package/src/components/atoms/search/autocomplete/article.js +9 -2
  9. package/src/components/atoms/search/autocomplete/game.js +9 -2
  10. package/src/components/atoms/search/autocomplete/operator.js +9 -2
  11. package/src/components/atoms/search/autocomplete/payment_methods.js +9 -2
  12. package/src/components/atoms/search/autocomplete/software_provider.js +9 -2
  13. package/src/components/atoms/sitemap/index.js +9 -2
  14. package/src/components/atoms/social-icons/index.js +50 -0
  15. package/src/components/atoms/social-icons/social-icons.module.scss +33 -0
  16. package/src/components/atoms/social-icons/social-icons.stories.js +55 -0
  17. package/src/components/atoms/social-icons/social-icons.test.js +31 -0
  18. package/src/components/pages/contact-us/contact-us.module.scss +86 -0
  19. package/src/components/pages/contact-us/contact-us.stories.js +92 -0
  20. package/src/components/pages/contact-us/contact-us.test.js +26 -0
  21. package/src/components/pages/contact-us/index.js +85 -3
  22. package/src/gatsby-core-theme/components/molecules/search/index.js +1 -1
  23. package/src/gatsby-core-theme/components/organisms/cards/index.js +7 -1
  24. package/src/gatsby-core-theme/components/organisms/head/index.js +4 -6
  25. package/src/gatsby-core-theme/components/organisms/navigation/index.js +7 -3
  26. package/src/gatsby-core-theme/components/organisms/search/index.js +6 -6
  27. package/src/gatsby-core-theme/components/pages/body/index.js +1 -1
  28. package/src/gatsby-core-theme/pages/sitemap/index.js +12 -8
  29. package/src/helpers/splitSearchQuery.js +3 -0
  30. package/src/hooks/tabs/index.js +3 -0
  31. package/storybook/.ci.yml +1 -1
  32. package/storybook/public/0.df565bea.iframe.bundle.js +1 -0
  33. package/storybook/public/{1.b16d9cbb.iframe.bundle.js → 1.d51717ce.iframe.bundle.js} +1 -1
  34. package/storybook/public/10.f7f3ccb8.iframe.bundle.js +1 -0
  35. package/storybook/public/11.13224d48.iframe.bundle.js +1 -0
  36. package/storybook/public/12.977cb5d6.iframe.bundle.js +1 -0
  37. package/storybook/public/13.183d3f1c.iframe.bundle.js +1 -0
  38. package/storybook/public/{10.f8a18169.iframe.bundle.js → 14.708f714b.iframe.bundle.js} +1 -1
  39. package/storybook/public/{11.7ed16ae2.iframe.bundle.js → 15.f1ca69f8.iframe.bundle.js} +1 -1
  40. package/storybook/public/5.f16ccaac.iframe.bundle.js +3 -0
  41. package/storybook/public/{5.0f8f7a5e.iframe.bundle.js.LICENSE.txt → 5.f16ccaac.iframe.bundle.js.LICENSE.txt} +0 -0
  42. package/storybook/public/5.f16ccaac.iframe.bundle.js.map +1 -0
  43. package/storybook/public/6.25868236.iframe.bundle.js +1 -0
  44. package/storybook/public/7.11db31fe.iframe.bundle.js +1 -0
  45. package/storybook/public/{8.1df784e4.iframe.bundle.js → 8.d69edd98.iframe.bundle.js} +3 -3
  46. package/storybook/public/{8.1df784e4.iframe.bundle.js.LICENSE.txt → 8.d69edd98.iframe.bundle.js.LICENSE.txt} +0 -0
  47. package/storybook/public/8.d69edd98.iframe.bundle.js.map +1 -0
  48. package/storybook/public/{9.d2817f50.iframe.bundle.js → 9.e97b6f53.iframe.bundle.js} +1 -1
  49. package/storybook/public/iframe.html +1 -1
  50. package/storybook/public/main.6d313455.iframe.bundle.js +1 -0
  51. package/storybook/public/runtime~main.9c675b2b.iframe.bundle.js +1 -0
  52. package/storybook/public/vendors~main.2fa2d82b.iframe.bundle.js +7 -0
  53. package/storybook/public/{vendors~main.5bd18864.iframe.bundle.js.LICENSE.txt → vendors~main.2fa2d82b.iframe.bundle.js.LICENSE.txt} +0 -0
  54. package/storybook/public/vendors~main.2fa2d82b.iframe.bundle.js.map +1 -0
  55. package/storybook/public/0.990fdfd8.iframe.bundle.js +0 -1
  56. package/storybook/public/5.0f8f7a5e.iframe.bundle.js +0 -3
  57. package/storybook/public/5.0f8f7a5e.iframe.bundle.js.map +0 -1
  58. package/storybook/public/6.b9f58061.iframe.bundle.js +0 -1
  59. package/storybook/public/7.9640e9e5.iframe.bundle.js +0 -1
  60. package/storybook/public/8.1df784e4.iframe.bundle.js.map +0 -1
  61. package/storybook/public/main.dbf98c57.iframe.bundle.js +0 -1
  62. package/storybook/public/runtime~main.758b565b.iframe.bundle.js +0 -1
  63. package/storybook/public/vendors~main.5bd18864.iframe.bundle.js +0 -7
  64. package/storybook/public/vendors~main.5bd18864.iframe.bundle.js.map +0 -1
package/CHANGELOG.md CHANGED
@@ -1,3 +1,58 @@
1
+ ## [2.3.8](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/compare/v2.3.7...v2.3.8) (2021-11-23)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * contact us page template ([4960ca9](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/4960ca912a5eb8f0b2f9ce6aaf27a27d84cbe7be))
7
+ * contact us template ([d85be6f](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/d85be6fee147dd9f7b998865df12d9f41358a01c))
8
+ * follow us ([02699fc](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/02699fc26abf94f85c844e2716728d85f0853e68))
9
+ * merged master branch ([cb5ce66](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/cb5ce66f2882e9da0e3bd8c25daf85eab8aec941))
10
+ * style issue ([8694bf7](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/8694bf7e92c802166d85b1da3202f6713767ac7c))
11
+
12
+
13
+ ### Config
14
+
15
+ * updated core theme version ([6bf96c3](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/6bf96c35a1d720c19bf748e9b5ab82220f057b40))
16
+
17
+
18
+ * Merge branch 'tm-2565-matrix-contact-us' into 'master' ([917bfc1](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/917bfc1747da5a96e5b8e67db8eb43641b568ad8))
19
+ * Merge branch 'master' into tm-2565-matrix-contact-us ([a4a682f](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/a4a682fc9355a9f97c68196d8feaf235f6935fca))
20
+
21
+ ## [2.3.7](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/compare/v2.3.6...v2.3.7) (2021-11-22)
22
+
23
+
24
+ ### Bug Fixes
25
+
26
+ * correction to typo ([b50be3c](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/b50be3c5e42f2560f5850f6b9b8e624d56790fe0))
27
+ * force load lazy images on tab change ([fa06336](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/fa06336730891bed815cbf1867d4ca870d257fbb))
28
+ * general fixes ([5aef217](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/5aef217afd001c09c8baa51ce75dc087a28f8294))
29
+ * highlight search query on auto complete ([2aee5da](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/2aee5da1c4e5b4d790ee1a1c5a687f5f790d244b))
30
+
31
+
32
+ * Merge branch 'tm-2478-search' into 'master' ([a86ac37](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/a86ac379825d5599b066d9f13b081c8ff7b8f4b2))
33
+
34
+ ## [2.3.6](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/compare/v2.3.5...v2.3.6) (2021-11-18)
35
+
36
+
37
+ ### Bug Fixes
38
+
39
+ * storybook pipeline ([29e7f34](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/29e7f34ca9b04a011c2784d9a7e8c930fd900cfa))
40
+
41
+
42
+ ### Config
43
+
44
+ * updated core theme version ([0552c2a](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/0552c2a93a4cf6716d2bd7be05e7b9f9ce58c5f5))
45
+
46
+ ## [2.3.5](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/compare/v2.3.4...v2.3.5) (2021-11-16)
47
+
48
+
49
+ ### Bug Fixes
50
+
51
+ * menu and sitemap fixes ([1ab7026](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/1ab70262191e5129630e2cdd9d802a837f5b9f7c))
52
+
53
+
54
+ * Merge branch 'tm-2593-2587-menu-sitemap-fixes' into 'master' ([e79806b](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/e79806b8abaaadc9f3caa2ca9bc0ff755cd75ce7))
55
+
1
56
  ## [2.3.4](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/compare/v2.3.3...v2.3.4) (2021-11-15)
2
57
 
3
58
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gatsby-matrix-theme",
3
- "version": "2.3.4",
3
+ "version": "2.3.8",
4
4
  "main": "index.js",
5
5
  "description": "Matrix Theme NPM Package",
6
6
  "author": "",
@@ -31,7 +31,7 @@
31
31
  "cross-env": "^7.0.2",
32
32
  "dotenv": "8.2.0",
33
33
  "gatsby": "^3.3.1",
34
- "gatsby-core-theme": "^1.6.0",
34
+ "gatsby-core-theme": "^1.6.6",
35
35
  "gatsby-image": "^3.3.0",
36
36
  "gatsby-plugin-image": "^1.3.1",
37
37
  "gatsby-plugin-postcss": "^4.3.0",
@@ -0,0 +1,44 @@
1
+ .authorCard {
2
+ width: 100%;
3
+ background: var(--color-2);
4
+ border-radius: var(--border-radius);
5
+ @include flex-direction(row);
6
+ padding: 1.6rem;
7
+ .img {
8
+ width: 6rem;
9
+ height: 6rem;
10
+ img {
11
+ width: 100%;
12
+ height: 100%;
13
+ border-radius: 50%;
14
+ }
15
+ }
16
+ .txt {
17
+ padding-left: 1.2rem;
18
+ height: 6rem;
19
+ @include flex-direction(column);
20
+ align-content: center;
21
+ justify-content: center;
22
+ div {
23
+ line-height: 1.8rem;
24
+ }
25
+ }
26
+ .name {
27
+ font-weight: 600;
28
+ font-size: 1.6rem;
29
+ color: var(--color-33);
30
+ line-height: 2.4rem;
31
+ }
32
+ .position {
33
+ font-weight: normal;
34
+ font-size: 1.2rem;
35
+ color: var(--color-32);
36
+ margin: 0.4rem 0 0 0;
37
+ }
38
+ .email {
39
+ font-weight: 600;
40
+ font-size: 1.2rem;
41
+ line-height: 1.8rem;
42
+ color:var(--color-51);
43
+ }
44
+ }
@@ -0,0 +1,47 @@
1
+ import React from 'react';
2
+ // eslint-disable-next-line import/no-extraneous-dependencies
3
+ import {
4
+ Title,
5
+ Description,
6
+ Primary,
7
+ PRIMARY_STORY,
8
+ ArgsTable,
9
+ } from '@storybook/addon-docs/blocks';
10
+ import { authors } from 'gatsby-core-theme/tests/factories/modules/contact-us-authors.factory';
11
+ import AuthorCard from '.';
12
+
13
+ const authorsKeys = Object.keys(authors);
14
+
15
+ export default {
16
+ title: 'Matrix-Theme/Atoms/Author Card',
17
+ component: AuthorCard,
18
+ argTypes: {
19
+ author: {
20
+ name: 'author',
21
+ type: { name: 'object', required: true },
22
+ defaultValue: '',
23
+ description: 'author object data',
24
+ },
25
+ },
26
+ parameters: {
27
+ docs: {
28
+ description: {
29
+ component: 'A component that displays authors cards',
30
+ },
31
+ page: () => (
32
+ <>
33
+ <Title />
34
+ <Description />
35
+ <Primary />
36
+ <ArgsTable story={PRIMARY_STORY} />
37
+ </>
38
+ ),
39
+ },
40
+ },
41
+ };
42
+
43
+ const Template = (args) => <AuthorCard {...args} />;
44
+ export const Default = Template.bind({});
45
+ Default.args = {
46
+ author: authors[authorsKeys[0]],
47
+ };
@@ -0,0 +1,29 @@
1
+ /* eslint-disable camelcase */
2
+ import React from 'react';
3
+ import { render, cleanup } from '@testing-library/react';
4
+ import { authors } from 'gatsby-core-theme/tests/factories/modules/contact-us-authors.factory';
5
+ import '@testing-library/jest-dom/extend-expect';
6
+ import AuthorCard from '.';
7
+
8
+ const authorsKeys = Object.keys(authors);
9
+
10
+ describe('AuthorCard Component', () => {
11
+ test('render one author', () => {
12
+ const { container } = render(<AuthorCard author={authors[authorsKeys[0]]} />);
13
+ const { name } = authors[authorsKeys[0]];
14
+ expect(container).toBeTruthy();
15
+ expect(container.querySelector('.name').innerHTML).toEqual(name);
16
+ });
17
+
18
+ test('render each author', () => {
19
+ Object.keys(authors).forEach((author) => {
20
+ const { name, email_address } = authors[author];
21
+ const { container } = render(<AuthorCard author={authors[author]} />);
22
+ expect(container.querySelector('.name').innerHTML).toEqual(name);
23
+ expect(container.querySelector('a').innerHTML).toEqual(email_address);
24
+ });
25
+ });
26
+ });
27
+ afterEach(() => {
28
+ cleanup();
29
+ });
@@ -0,0 +1,41 @@
1
+ /* eslint-disable camelcase */
2
+ import React from 'react';
3
+ import PropTypes from 'prop-types';
4
+ import LazyImage from 'gatsby-core-theme/src/hooks/lazy-image';
5
+ import { imagePrettyUrl } from 'gatsby-core-theme/src/helpers/getters';
6
+ import styles from './author-card.module.scss';
7
+
8
+ const AuthorCard = ({ author }) => {
9
+ const { name, author_title, email_address, image } = author || {};
10
+
11
+ return (
12
+ <div className={styles.authorCard}>
13
+ <div className={styles.img}>
14
+ <LazyImage src={imagePrettyUrl(image)} alt={name} />
15
+ </div>
16
+ <div className={styles.txt}>
17
+ <div className={styles.name}>{name}</div>
18
+ <div className={styles.position}>{author_title}</div>
19
+ <a
20
+ className={styles.email}
21
+ href={`mailto:${email_address}`}
22
+ target="_blank"
23
+ rel="noreferrer"
24
+ >
25
+ {email_address}
26
+ </a>
27
+ </div>
28
+ </div>
29
+ );
30
+ };
31
+
32
+ AuthorCard.propTypes = {
33
+ author: PropTypes.shape({
34
+ name: PropTypes.string,
35
+ author_title: PropTypes.string,
36
+ email_address: PropTypes.string,
37
+ image: PropTypes.string,
38
+ }).isRequired,
39
+ };
40
+
41
+ export default AuthorCard;
@@ -74,7 +74,7 @@ const OperatorCard = ({ item, featured = false, number }) => {
74
74
  {isActive && (
75
75
  <Button
76
76
  to={prettyLink}
77
- btnText={translate(translations, 'play_now', 'Sign Up')}
77
+ btnText={translate(translations, 'play_now', 'Play Now')}
78
78
  isInternalLink={false}
79
79
  disabled={!isActive}
80
80
  gtmClass="operator-card-gtm btn-cta"
@@ -1,11 +1,17 @@
1
+ /* eslint-disable react/no-danger */
1
2
  import React from 'react';
2
3
  import PropTypes from 'prop-types';
3
4
  import { GrFormNext } from 'react-icons/gr';
4
5
  import Link from 'gatsby-core-theme/src/hooks/link';
6
+ import { splitSearchQuery } from '../../../../helpers/splitSearchQuery';
5
7
 
6
- const Article = ({ item = {}, Button = <GrFormNext /> }) => (
8
+ const Article = ({ item = {}, Button = <GrFormNext />, searchQuery }) => (
7
9
  <Link to={item.path} className="article-gtm">
8
- <h1>{item.title}</h1>
10
+ <h1
11
+ dangerouslySetInnerHTML={{
12
+ __html: splitSearchQuery(item.title, searchQuery),
13
+ }}
14
+ />
9
15
  {Button}
10
16
  </Link>
11
17
  );
@@ -15,6 +21,7 @@ Article.propTypes = {
15
21
  title: PropTypes.string,
16
22
  }).isRequired,
17
23
  Button: PropTypes.func,
24
+ searchQuery: PropTypes.string,
18
25
  };
19
26
 
20
27
  export default Article;
@@ -1,11 +1,17 @@
1
+ /* eslint-disable react/no-danger */
1
2
  import React from 'react';
2
3
  import PropTypes from 'prop-types';
3
4
  import { GrFormNext } from 'react-icons/gr';
4
5
  import Link from 'gatsby-core-theme/src/hooks/link';
6
+ import { splitSearchQuery } from '../../../../helpers/splitSearchQuery';
5
7
 
6
- const Game = ({ item = {}, Button = <GrFormNext /> }) => (
8
+ const Game = ({ item = {}, Button = <GrFormNext />, searchQuery }) => (
7
9
  <Link to={item.path} className="game-gtm">
8
- <h1>{item.title}</h1>
10
+ <h1
11
+ dangerouslySetInnerHTML={{
12
+ __html: splitSearchQuery(item.title, searchQuery),
13
+ }}
14
+ />
9
15
  {Button}
10
16
  </Link>
11
17
  );
@@ -15,6 +21,7 @@ Game.propTypes = {
15
21
  title: PropTypes.string,
16
22
  }).isRequired,
17
23
  Button: PropTypes.func,
24
+ searchQuery: PropTypes.string,
18
25
  };
19
26
 
20
27
  export default Game;
@@ -1,11 +1,17 @@
1
+ /* eslint-disable react/no-danger */
1
2
  import React from 'react';
2
3
  import PropTypes from 'prop-types';
3
4
  import { GrFormNext } from 'react-icons/gr';
4
5
  import Link from 'gatsby-core-theme/src/hooks/link';
6
+ import { splitSearchQuery } from '../../../../helpers/splitSearchQuery';
5
7
 
6
- const Operator = ({ item = {}, Button = <GrFormNext /> }) => (
8
+ const Operator = ({ item = {}, Button = <GrFormNext />, searchQuery }) => (
7
9
  <Link to={`/${item.path}`} className="operator-gtm">
8
- <h1>{item.title}</h1>
10
+ <h1
11
+ dangerouslySetInnerHTML={{
12
+ __html: splitSearchQuery(item.title, searchQuery),
13
+ }}
14
+ />
9
15
  {Button}
10
16
  </Link>
11
17
  );
@@ -16,6 +22,7 @@ Operator.propTypes = {
16
22
  path: PropTypes.string,
17
23
  }).isRequired,
18
24
  Button: PropTypes.func,
25
+ searchQuery: PropTypes.string,
19
26
  };
20
27
 
21
28
  export default Operator;
@@ -1,11 +1,17 @@
1
+ /* eslint-disable react/no-danger */
1
2
  import React from 'react';
2
3
  import PropTypes from 'prop-types';
3
4
  import { GrFormNext } from 'react-icons/gr';
4
5
  import Link from 'gatsby-core-theme/src/hooks/link';
6
+ import { splitSearchQuery } from '../../../../helpers/splitSearchQuery';
5
7
 
6
- const PaymentMethods = ({ item = {}, Button = <GrFormNext /> }) => (
8
+ const PaymentMethods = ({ item = {}, Button = <GrFormNext />, searchQuery }) => (
7
9
  <Link to={item.path} className="payment-method-gtm">
8
- <h1>{item.title}</h1>
10
+ <h1
11
+ dangerouslySetInnerHTML={{
12
+ __html: splitSearchQuery(item.title, searchQuery),
13
+ }}
14
+ />
9
15
  {Button}
10
16
  </Link>
11
17
  );
@@ -15,6 +21,7 @@ PaymentMethods.propTypes = {
15
21
  title: PropTypes.string,
16
22
  }).isRequired,
17
23
  Button: PropTypes.func,
24
+ searchQuery: PropTypes.string,
18
25
  };
19
26
 
20
27
  export default PaymentMethods;
@@ -1,11 +1,17 @@
1
+ /* eslint-disable react/no-danger */
1
2
  import React from 'react';
2
3
  import PropTypes from 'prop-types';
3
4
  import { GrFormNext } from 'react-icons/gr';
4
5
  import Link from 'gatsby-core-theme/src/hooks/link';
6
+ import { splitSearchQuery } from '../../../../helpers/splitSearchQuery';
5
7
 
6
- const SoftwareProvider = ({ item = {}, Button = <GrFormNext /> }) => (
8
+ const SoftwareProvider = ({ item = {}, Button = <GrFormNext />, searchQuery }) => (
7
9
  <Link to={item.path} className="software-provider-gtm">
8
- <h1>{item.title}</h1>
10
+ <h1
11
+ dangerouslySetInnerHTML={{
12
+ __html: splitSearchQuery(item.title, searchQuery),
13
+ }}
14
+ />
9
15
  {Button}
10
16
  </Link>
11
17
  );
@@ -15,6 +21,7 @@ SoftwareProvider.propTypes = {
15
21
  title: PropTypes.string,
16
22
  }).isRequired,
17
23
  Button: PropTypes.func,
24
+ searchQuery: PropTypes.string,
18
25
  };
19
26
 
20
27
  export default SoftwareProvider;
@@ -1,11 +1,13 @@
1
1
  /* eslint-disable array-callback-return */
2
2
  /* eslint-disable react/forbid-prop-types */
3
- import React from 'react';
3
+ import React, { useContext } from 'react';
4
4
  import PropTypes from 'prop-types';
5
5
  import { BiSitemap } from 'react-icons/bi';
6
6
  import { IoMdLink } from 'react-icons/io';
7
7
  // eslint-disable-next-line import/no-extraneous-dependencies
8
8
  import Masonry from 'react-masonry-css';
9
+ import { Context } from 'gatsby-core-theme/src/context/TranslationsProvider';
10
+ import { translate } from 'gatsby-core-theme/src/helpers/getters';
9
11
  import styles from './sitemap.module.scss';
10
12
  import Link from '~hooks/link';
11
13
 
@@ -15,10 +17,15 @@ const Sitemap = ({
15
17
  templateIcon = <BiSitemap />,
16
18
  linkIcon = <IoMdLink />,
17
19
  }) => {
20
+ const { translations } = useContext(Context) || {};
18
21
  const market = Object.keys(sitemapData)[0];
19
22
 
20
23
  const getTemplateName = (template) => {
21
- const templateName = templates[template].short_name.replace('_', ' ');
24
+ const templateName = translate(
25
+ translations,
26
+ templates[template].short_name,
27
+ templates[template].short_name.replace('_', ' ')
28
+ );
22
29
  const templatePages = sitemapData[market][template];
23
30
  const templatePagesCount = templatePages && templatePages.length;
24
31
 
@@ -0,0 +1,50 @@
1
+ import React, { useContext } from 'react';
2
+ import { FaInstagram, FaFacebookSquare, FaTwitter, FaLinkedin, FaYoutube } from 'react-icons/fa';
3
+ import PropTypes from 'prop-types';
4
+ import keygen from 'gatsby-core-theme/src/helpers/keygen';
5
+ import { Context } from 'gatsby-core-theme/src/context/TranslationsProvider';
6
+ import { translate } from '~helpers/getters';
7
+ import styles from './social-icons.module.scss';
8
+
9
+ const SocialIcons = ({ socialIcons }) => {
10
+ const { translations } = useContext(Context) || {};
11
+ const keys = Object.keys(socialIcons);
12
+ const switchIcons = (icons) => {
13
+ switch (icons) {
14
+ case 'instagram':
15
+ return <FaInstagram />;
16
+ case 'facebook':
17
+ return <FaFacebookSquare />;
18
+ case 'twitter':
19
+ return <FaTwitter />;
20
+ case 'linkedin':
21
+ return <FaLinkedin />;
22
+ case 'youtube':
23
+ return <FaYoutube />;
24
+ default:
25
+ return null;
26
+ }
27
+ };
28
+
29
+ return (
30
+ <div className={styles.container}>
31
+ <div className={styles.title}>{translate(translations, 'follow_us', 'Follow Us')}</div>
32
+ <div className={styles.socialIcons}>
33
+ {keys.map(
34
+ (key) =>
35
+ socialIcons[key] && (
36
+ <a key={keygen()} href={socialIcons[key]} target="_blank" rel="noreferrer">
37
+ {switchIcons(key)}
38
+ </a>
39
+ )
40
+ )}
41
+ </div>
42
+ </div>
43
+ );
44
+ };
45
+
46
+ export default SocialIcons;
47
+
48
+ SocialIcons.propTypes = {
49
+ socialIcons: PropTypes.shape({}),
50
+ };
@@ -0,0 +1,33 @@
1
+ .container {
2
+ width: 100%;
3
+ @include flex-direction(column);
4
+ .title{
5
+ padding-bottom: 1.6rem;
6
+ font-weight: 600;
7
+ font-size: 1.6rem;
8
+ line-height: 2.4rem;
9
+ color: var(--color-33);
10
+ @include min(tablet){
11
+ font-weight: bold;
12
+ font-size: 3.6rem;
13
+ line-height: 4.6rem;
14
+ }
15
+ }
16
+ .socialIcons{
17
+ display: inline-flex;
18
+ a {
19
+ display: inline-block;
20
+ width: 4rem;
21
+ height: 4rem;
22
+ line-height: 4.7rem;
23
+ border-radius: 50%;
24
+ background: var(--color-52);
25
+ margin: 0 1.6rem 0 0;
26
+ text-align: center;
27
+ font-size: 2rem;
28
+ svg{
29
+ color: var(--color-16);
30
+ }
31
+ }
32
+ }
33
+ }
@@ -0,0 +1,55 @@
1
+ import React from 'react';
2
+ // eslint-disable-next-line import/no-extraneous-dependencies
3
+ import {
4
+ Title,
5
+ Description,
6
+ Primary,
7
+ PRIMARY_STORY,
8
+ ArgsTable,
9
+ } from '@storybook/addon-docs/blocks';
10
+ import { siteSchema } from 'gatsby-core-theme/tests/factories/modules/site-schema.factory';
11
+ import SocialIcons from '.';
12
+
13
+ const socialIcons =
14
+ siteSchema &&
15
+ (({ instagram, facebook, twitter, linkedin, youtube }) => ({
16
+ instagram,
17
+ facebook,
18
+ twitter,
19
+ linkedin,
20
+ youtube,
21
+ }))(siteSchema);
22
+
23
+ export default {
24
+ title: 'Matrix-Theme/Atoms/Social Icons',
25
+ component: SocialIcons,
26
+ argTypes: {
27
+ socialIcons: {
28
+ name: 'social icons',
29
+ type: { name: 'object', required: true },
30
+ defaultValue: '',
31
+ description: 'social icons object data',
32
+ },
33
+ },
34
+ parameters: {
35
+ docs: {
36
+ description: {
37
+ component: 'A component that displays social icons',
38
+ },
39
+ page: () => (
40
+ <>
41
+ <Title />
42
+ <Description />
43
+ <Primary />
44
+ <ArgsTable story={PRIMARY_STORY} />
45
+ </>
46
+ ),
47
+ },
48
+ },
49
+ };
50
+
51
+ const Template = (args) => <SocialIcons {...args} />;
52
+ export const Default = Template.bind({});
53
+ Default.args = {
54
+ socialIcons,
55
+ };
@@ -0,0 +1,31 @@
1
+ import React from 'react';
2
+ import { render, cleanup } from '@testing-library/react';
3
+ import '@testing-library/jest-dom';
4
+ import { siteSchema } from 'gatsby-core-theme/tests/factories/modules/site-schema.factory';
5
+ import SocialIcons from '.';
6
+
7
+ const socialIcons =
8
+ siteSchema &&
9
+ (({ instagram, facebook, twitter, linkedin, youtube }) => ({
10
+ instagram,
11
+ facebook,
12
+ twitter,
13
+ linkedin,
14
+ youtube,
15
+ }))(siteSchema);
16
+
17
+ const socialIconsLength = Object.keys(socialIcons);
18
+
19
+ describe('SocialIcons Component', () => {
20
+ test('render with props and social icons list', () => {
21
+ const { container } = render(<SocialIcons socialIcons={socialIcons} />);
22
+ expect(container).toBeTruthy();
23
+ const socialLinksWrapper = container.querySelector('.socialIcons');
24
+ expect(socialLinksWrapper.querySelectorAll('a')).toHaveLength(socialIconsLength.length);
25
+ expect(socialLinksWrapper.querySelectorAll('a')[2].innerText).toEqual(siteSchema[2]);
26
+ expect(socialLinksWrapper.querySelectorAll('a')[4].innerText).toEqual(siteSchema[4]);
27
+ });
28
+ });
29
+ afterEach(() => {
30
+ cleanup();
31
+ });
@@ -0,0 +1,86 @@
1
+ .pageContainer {
2
+ background-color: white;
3
+ padding: 6rem 0 0;
4
+ @include min(laptop) {
5
+ padding: 8rem 0 0;
6
+ }
7
+ .contactUsContainer {
8
+ max-width: var(--main-container-max);
9
+ margin: 0 auto;
10
+ @include flex-direction(column);
11
+ padding: 1.6rem 2.4rem;
12
+ background-color: transparent;
13
+
14
+ header{
15
+ padding-top: 0;
16
+ > div{
17
+ padding: 0;
18
+ a, li{
19
+ font-weight: normal;
20
+ font-size: 1.4rem;
21
+ line-height: 2.4rem;
22
+ color:var(--color-41);
23
+ }
24
+ div:last-of-type{
25
+ display: none;
26
+ }
27
+ }
28
+ }
29
+
30
+ .contactBox {
31
+ width: 100%;
32
+ padding-top: 1.2rem;
33
+ padding-bottom: 4.6rem;
34
+ border-radius: var(--border-radius);
35
+ @include min(tablet) {
36
+ @include flex-direction(row);
37
+ padding-bottom: 3.3rem;
38
+ }
39
+ }
40
+ .formWrapper {
41
+ flex-basis: 100%;
42
+ padding: 0;
43
+ p {
44
+ font-weight: normal;
45
+ font-size: 1.6rem;
46
+ line-height: 2.4rem;
47
+ color: var(--color-38);
48
+ padding-top: 0.8rem;
49
+ }
50
+ h1 {
51
+ margin: 0;
52
+ font-weight: bold;
53
+ font-size: 3.6rem;
54
+ line-height: 4.6rem;
55
+ color: var(--color-33);
56
+ }
57
+ @include min(tablet) {
58
+ flex-basis: 61rem;
59
+ padding-right: 3.3rem;
60
+ }
61
+ }
62
+ .authors {
63
+ width: 100%;
64
+ @include min(desktop) {
65
+ }
66
+ ul {
67
+ width: 100%;
68
+ @include flex-direction(column);
69
+ @include min(tablet) {
70
+ display: grid;
71
+ grid-template-columns: 1fr 1fr;
72
+ grid-gap: 1.6rem;
73
+ }
74
+ @include min(desktop) {
75
+ grid-template-columns: 1fr 1fr 1fr;
76
+ }
77
+ li {
78
+ margin-bottom: 1.6rem;
79
+ @include min(tablet) {
80
+ margin-bottom: 0;
81
+ }
82
+ }
83
+ }
84
+ }
85
+ }
86
+ }