├── public
├── _redirects
├── robots.txt
├── favicon.ico
├── logo192.png
├── logo512.png
├── manifest.json
├── index.html
└── assets
│ └── images
│ ├── logo.svg
│ └── javascript.svg
├── src
├── templates
│ ├── Home
│ │ ├── styles.js
│ │ └── index.jsx
│ ├── Loading
│ │ ├── index.jsx
│ │ └── styles.js
│ ├── Base
│ │ ├── styles.js
│ │ ├── stories.jsx
│ │ ├── mock.jsx
│ │ └── index.jsx
│ └── PageNotFound
│ │ └── index.jsx
├── config
│ └── index.js
├── components
│ ├── TextComponent
│ │ ├── styles.js
│ │ ├── index.jsx
│ │ ├── stories.jsx
│ │ └── TextComponent.test.jsx
│ ├── SectionContainer
│ │ ├── styles.js
│ │ ├── index.jsx
│ │ ├── __snapshots__
│ │ │ └── SectionContainer.test.jsx.snap
│ │ ├── SectionContainer.test.jsx
│ │ └── stories.jsx
│ ├── LogoLink
│ │ ├── styles.js
│ │ ├── stories.jsx
│ │ ├── index.jsx
│ │ ├── __snapshots__
│ │ │ └── LogoLink.test.jsx.snap
│ │ └── LogoLink.test.jsx
│ ├── GridText
│ │ ├── stories.jsx
│ │ ├── GridText.test.jsx
│ │ ├── mock.js
│ │ ├── styles.js
│ │ ├── index.jsx
│ │ └── __snapshots__
│ │ │ └── GridText.test.jsx.snap
│ ├── GridTwoColumns
│ │ ├── mock.js
│ │ ├── stories.jsx
│ │ ├── GridTwoColumns.test.jsx
│ │ ├── styles.js
│ │ ├── index.jsx
│ │ └── __snapshots__
│ │ │ └── GridTwoColumns.test.jsx.snap
│ ├── NavLinks
│ │ ├── styles.js
│ │ ├── stories.jsx
│ │ ├── index.jsx
│ │ ├── mock.js
│ │ ├── NavLinks.test.jsx
│ │ └── __snapshots__
│ │ │ └── NavLinks.test.jsx.snap
│ ├── GridImage
│ │ ├── stories.jsx
│ │ ├── GridImage.test.jsx
│ │ ├── mock.js
│ │ ├── styles.js
│ │ ├── index.jsx
│ │ └── __snapshots__
│ │ │ └── GridImage.test.jsx.snap
│ ├── GridContent
│ │ ├── stories.jsx
│ │ ├── styles.js
│ │ ├── GridContent.test.jsx
│ │ ├── index.jsx
│ │ ├── mock.js
│ │ └── __snapshots__
│ │ │ └── GridContent.test.jsx.snap
│ ├── GoTop
│ │ ├── index.jsx
│ │ ├── styles.js
│ │ ├── GoTop.test.jsx
│ │ └── stories.jsx
│ ├── Footer
│ │ ├── stories.jsx
│ │ ├── index.jsx
│ │ ├── styles.js
│ │ └── Footer.test.jsx
│ ├── MenuLink
│ │ ├── stories.jsx
│ │ ├── index.jsx
│ │ ├── styles.js
│ │ └── MenuLink.test.jsx
│ ├── Menu
│ │ ├── stories.jsx
│ │ ├── index.jsx
│ │ ├── Menu.test.jsx
│ │ ├── styles.js
│ │ └── __snapshots__
│ │ │ └── Menu.test.jsx.snap
│ ├── SectionBackground
│ │ ├── styles.js
│ │ ├── index.jsx
│ │ ├── stories.jsx
│ │ ├── SectionBackground.test.jsx
│ │ └── __snapshots__
│ │ │ └── SectionBackground.test.jsx.snap
│ └── Heading
│ │ ├── stories.jsx
│ │ ├── index.jsx
│ │ ├── styles.js
│ │ └── Heading.test.jsx
├── styles
│ ├── render-theme.js
│ ├── theme.js
│ └── global-styles.js
├── setupTests.js
├── api
│ ├── map-data.js
│ ├── map-data.test.js
│ ├── map-menu.js
│ ├── map-menu.test.js
│ ├── map-sections.js
│ ├── map-sections.test.js
│ └── dados.json
└── index.jsx
├── .prettierrc.js
├── .editorconfig
├── .storybook
├── main.js
└── preview.js
├── .gitignore
├── .eslintrc.js
├── package.json
└── README.md
/public/_redirects:
--------------------------------------------------------------------------------
1 | /* /index.html 200
2 |
--------------------------------------------------------------------------------
/public/robots.txt:
--------------------------------------------------------------------------------
1 | # https://www.robotstxt.org/robotstxt.html
2 | User-agent: *
3 | Disallow:
4 |
--------------------------------------------------------------------------------
/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luizomf/curso-reactjs-nextjs-project-3/HEAD/public/favicon.ico
--------------------------------------------------------------------------------
/public/logo192.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luizomf/curso-reactjs-nextjs-project-3/HEAD/public/logo192.png
--------------------------------------------------------------------------------
/public/logo512.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luizomf/curso-reactjs-nextjs-project-3/HEAD/public/logo512.png
--------------------------------------------------------------------------------
/src/templates/Home/styles.js:
--------------------------------------------------------------------------------
1 | import styled, { css } from 'styled-components';
2 |
3 | export const Wrapper = styled.div``;
4 |
--------------------------------------------------------------------------------
/.prettierrc.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | semi: true,
3 | trailingComma: 'all',
4 | singleQuote: true,
5 | printWidth: 80,
6 | tabWidth: 2
7 | }
--------------------------------------------------------------------------------
/src/templates/Loading/index.jsx:
--------------------------------------------------------------------------------
1 | import P from 'prop-types';
2 | import * as Styled from './styles';
3 |
4 | export const Loading = () => {
5 | return ;
6 | };
7 |
--------------------------------------------------------------------------------
/src/config/index.js:
--------------------------------------------------------------------------------
1 | export default {
2 | url: 'https://strapi-landing-pages-project-2.herokuapp.com/pages/?slug=',
3 | siteName: 'Otávio Miranda',
4 | defaultSlug: 'landing-page',
5 | };
6 |
--------------------------------------------------------------------------------
/src/components/TextComponent/styles.js:
--------------------------------------------------------------------------------
1 | import styled, { css } from 'styled-components';
2 |
3 | export const Container = styled.div`
4 | ${({ theme }) => css`
5 | font-size: ${theme.font.sizes.medium};
6 | `}
7 | `;
8 |
--------------------------------------------------------------------------------
/.editorconfig:
--------------------------------------------------------------------------------
1 | # EditorConfig is awesome: https://EditorConfig.org
2 |
3 | # top-most EditorConfig file
4 | root = true
5 |
6 | [*]
7 | indent_style = space
8 | indent_size = 2
9 | end_of_line = lf
10 | charset = utf-8
11 | trim_trailing_whitespace = true
12 | insert_final_newline = true
--------------------------------------------------------------------------------
/src/templates/Base/styles.js:
--------------------------------------------------------------------------------
1 | import styled, { css } from 'styled-components';
2 |
3 | export const Container = styled.div`
4 | ${({ theme }) => css`
5 | padding-top: 5.4rem;
6 |
7 | @media ${theme.media.lteMedium} {
8 | padding-top: 0;
9 | }
10 | `}
11 | `;
12 |
--------------------------------------------------------------------------------
/src/styles/render-theme.js:
--------------------------------------------------------------------------------
1 | import { render } from '@testing-library/react';
2 | import { ThemeProvider } from 'styled-components';
3 | import { theme } from './theme';
4 |
5 | export const renderTheme = (children) => {
6 | return render({children} );
7 | };
8 |
--------------------------------------------------------------------------------
/src/components/SectionContainer/styles.js:
--------------------------------------------------------------------------------
1 | import styled, { css } from 'styled-components';
2 |
3 | export const Container = styled.div`
4 | ${({ theme }) => css`
5 | max-width: 120rem;
6 | margin: 0 auto;
7 | padding: ${theme.spacings.large};
8 | width: 100%;
9 | `}
10 | `;
11 |
--------------------------------------------------------------------------------
/src/setupTests.js:
--------------------------------------------------------------------------------
1 | // jest-dom adds custom jest matchers for asserting on DOM nodes.
2 | // allows you to do things like:
3 | // expect(element).toHaveTextContent(/react/i)
4 | // learn more: https://github.com/testing-library/jest-dom
5 | import '@testing-library/jest-dom';
6 | import 'jest-styled-components';
7 |
--------------------------------------------------------------------------------
/src/components/SectionContainer/index.jsx:
--------------------------------------------------------------------------------
1 | import P from 'prop-types';
2 | import * as Styled from './styles';
3 |
4 | export const SectionContainer = ({ children }) => {
5 | return {children} ;
6 | };
7 |
8 | SectionContainer.propTypes = {
9 | children: P.node.isRequired,
10 | };
11 |
--------------------------------------------------------------------------------
/src/components/TextComponent/index.jsx:
--------------------------------------------------------------------------------
1 | import P from 'prop-types';
2 | import * as Styled from './styles';
3 |
4 | export const TextComponent = ({ children }) => {
5 | return ;
6 | };
7 |
8 | TextComponent.propTypes = {
9 | children: P.node.isRequired,
10 | };
11 |
--------------------------------------------------------------------------------
/src/components/LogoLink/styles.js:
--------------------------------------------------------------------------------
1 | import styled, { css } from 'styled-components';
2 |
3 | export const Container = styled.a`
4 | ${({ theme }) => css`
5 | display: flex;
6 | align-items: center;
7 | text-decoration: none;
8 | color: inherit;
9 |
10 | > img {
11 | height: 3rem;
12 | }
13 | `}
14 | `;
15 |
--------------------------------------------------------------------------------
/.storybook/main.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | "stories": [
3 | "../src/**/*.stories.mdx",
4 | "../src/**/*.stories.@(js|jsx|ts|tsx)",
5 | "../src/**/stories.@(js|jsx|ts|tsx)",
6 | ],
7 | "addons": [
8 | "@storybook/addon-links",
9 | "@storybook/addon-essentials",
10 | "@storybook/preset-create-react-app"
11 | ]
12 | }
13 |
--------------------------------------------------------------------------------
/src/components/GridText/stories.jsx:
--------------------------------------------------------------------------------
1 | import { GridText } from '.';
2 |
3 | import mock from './mock';
4 |
5 | export default {
6 | title: 'GridText',
7 | component: GridText,
8 | args: mock,
9 | };
10 |
11 | export const Template = (args) => {
12 | return (
13 |
14 |
15 |
16 | );
17 | };
18 |
--------------------------------------------------------------------------------
/src/components/GridTwoColumns/mock.js:
--------------------------------------------------------------------------------
1 | export default {
2 | title: 'Grid two columns',
3 | text: `Lorem ipsum dolor sit amet consectetur adipisicing elit. Distinctio magnam culpa eveniet doloribus harum? Ipsam, a necessitatibus? Sequi sunt accusantium quod, animi iure a, aliquid dolor ea vel magni dolore?`,
4 | srcImg: 'assets/images/javascript.svg',
5 | };
6 |
--------------------------------------------------------------------------------
/src/components/NavLinks/styles.js:
--------------------------------------------------------------------------------
1 | import styled, { css } from 'styled-components';
2 |
3 | export const Container = styled.nav`
4 | ${({ theme }) => css`
5 | display: flex;
6 | flex-flow: row wrap;
7 |
8 | @media ${theme.media.lteMedium} {
9 | flex-flow: column wrap;
10 | align-content: center;
11 | }
12 | `}
13 | `;
14 |
--------------------------------------------------------------------------------
/src/components/GridImage/stories.jsx:
--------------------------------------------------------------------------------
1 | import { GridImage } from '.';
2 |
3 | import mock from './mock';
4 |
5 | export default {
6 | title: 'GridImage',
7 | component: GridImage,
8 | args: mock,
9 | };
10 |
11 | export const Template = (args) => {
12 | return (
13 |
14 |
15 |
16 | );
17 | };
18 |
--------------------------------------------------------------------------------
/src/components/GridContent/stories.jsx:
--------------------------------------------------------------------------------
1 | import { GridContent } from '.';
2 |
3 | import mock from './mock';
4 |
5 | export default {
6 | title: 'GridContent',
7 | component: GridContent,
8 | args: mock,
9 | };
10 |
11 | export const Template = (args) => {
12 | return (
13 |
14 |
15 |
16 | );
17 | };
18 |
--------------------------------------------------------------------------------
/src/templates/PageNotFound/index.jsx:
--------------------------------------------------------------------------------
1 | import P from 'prop-types';
2 | import { GridContent } from '../../components/GridContent';
3 |
4 | export const PageNotFound = () => {
5 | return (
6 |
10 | );
11 | };
12 |
--------------------------------------------------------------------------------
/src/components/GridContent/styles.js:
--------------------------------------------------------------------------------
1 | import styled, { css } from 'styled-components';
2 |
3 | export const Container = styled.div`
4 | ${({ theme }) => css`
5 | text-align: center;
6 | max-width: 58rem;
7 | margin: 0 auto;
8 | `}
9 | `;
10 |
11 | export const Html = styled.div`
12 | ${({ theme }) => css`
13 | margin: ${theme.spacings.xhuge} 0;
14 | `}
15 | `;
16 |
--------------------------------------------------------------------------------
/src/components/GoTop/index.jsx:
--------------------------------------------------------------------------------
1 | import P from 'prop-types';
2 | import * as Styled from './styles';
3 | import { KeyboardArrowUp } from '@styled-icons/material-outlined/KeyboardArrowUp';
4 |
5 | export const GoTop = () => {
6 | return (
7 |
8 |
9 |
10 | );
11 | };
12 |
--------------------------------------------------------------------------------
/src/components/Footer/stories.jsx:
--------------------------------------------------------------------------------
1 | import { Footer } from '.';
2 |
3 | export default {
4 | title: 'Footer',
5 | component: Footer,
6 | args: {
7 | footerHtml: `Feito com ❤ por Otávio Miranda
`,
8 | },
9 | };
10 |
11 | export const Template = (args) => {
12 | return (
13 |
14 |
15 |
16 | );
17 | };
18 |
--------------------------------------------------------------------------------
/src/templates/Base/stories.jsx:
--------------------------------------------------------------------------------
1 | import { Base } from '.';
2 |
3 | import mock, { mockBase } from './mock';
4 | import { GridText } from '../../components/GridText';
5 |
6 | export default {
7 | title: 'Templates/Base',
8 | component: Base,
9 | args: mockBase,
10 | };
11 |
12 | export const Template = (args) => {
13 | return (
14 |
15 |
16 |
17 | );
18 | };
19 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2 |
3 | # dependencies
4 | /node_modules
5 | /.pnp
6 | .pnp.js
7 |
8 | # testing
9 | /coverage
10 |
11 | # production
12 | /build
13 |
14 | # misc
15 | .DS_Store
16 | .env.local
17 | .env.development.local
18 | .env.test.local
19 | .env.production.local
20 |
21 | npm-debug.log*
22 | yarn-debug.log*
23 | yarn-error.log*
24 |
--------------------------------------------------------------------------------
/src/components/NavLinks/stories.jsx:
--------------------------------------------------------------------------------
1 | import { NavLinks } from '.';
2 | import links from './mock';
3 |
4 | export default {
5 | title: 'NavLinks',
6 | component: NavLinks,
7 | args: {
8 | links: links,
9 | },
10 | argTypes: {
11 | links: { type: '' },
12 | },
13 | };
14 |
15 | export const Template = (args) => {
16 | return (
17 |
18 |
19 |
20 | );
21 | };
22 |
--------------------------------------------------------------------------------
/src/components/SectionContainer/__snapshots__/SectionContainer.test.jsx.snap:
--------------------------------------------------------------------------------
1 | // Jest Snapshot v1, https://goo.gl/fbAQLP
2 |
3 | exports[` should render content 1`] = `
4 | .c0 {
5 | max-width: 120rem;
6 | margin: 0 auto;
7 | padding: 3.2rem;
8 | width: 100%;
9 | }
10 |
11 |
12 |
15 |
16 | Children
17 |
18 |
19 |
20 | `;
21 |
--------------------------------------------------------------------------------
/src/components/GridTwoColumns/stories.jsx:
--------------------------------------------------------------------------------
1 | import { GridTwoColumns } from '.';
2 |
3 | import mock from './mock';
4 |
5 | export default {
6 | title: 'GridTwoColumns',
7 | component: GridTwoColumns,
8 | args: mock,
9 | argTypes: {
10 | children: { type: 'string' },
11 | },
12 | };
13 |
14 | export const Template = (args) => {
15 | return (
16 |
17 |
18 |
19 | );
20 | };
21 |
--------------------------------------------------------------------------------
/src/components/GoTop/styles.js:
--------------------------------------------------------------------------------
1 | import styled, { css } from 'styled-components';
2 |
3 | export const Container = styled.a`
4 | ${({ theme }) => css`
5 | position: fixed;
6 | background: ${theme.colors.primaryColor};
7 | color: ${theme.colors.white};
8 | display: flex;
9 | align-items: center;
10 | justify-content: center;
11 | width: 4rem;
12 | height: 4rem;
13 | bottom: 2rem;
14 | right: 2rem;
15 | z-index: 6;
16 | `}
17 | `;
18 |
--------------------------------------------------------------------------------
/src/components/GridTwoColumns/GridTwoColumns.test.jsx:
--------------------------------------------------------------------------------
1 | import { screen } from '@testing-library/react';
2 | import { renderTheme } from '../../styles/render-theme';
3 | import { GridTwoColumns } from '.';
4 |
5 | import mock from './mock';
6 |
7 | describe(' ', () => {
8 | it('should render two column grid', () => {
9 | const { container } = renderTheme( );
10 | expect(container).toMatchSnapshot();
11 | });
12 | });
13 |
--------------------------------------------------------------------------------
/src/components/MenuLink/stories.jsx:
--------------------------------------------------------------------------------
1 | import { MenuLink } from '.';
2 |
3 | export default {
4 | title: 'MenuLink',
5 | component: MenuLink,
6 | args: {
7 | children: 'MenuLink',
8 | link: 'https://www.google.com.br/',
9 | },
10 | argTypes: {
11 | children: { type: 'string' },
12 | },
13 | };
14 |
15 | export const Template = (args) => {
16 | return (
17 |
18 |
19 |
20 | );
21 | };
22 |
--------------------------------------------------------------------------------
/src/components/Menu/stories.jsx:
--------------------------------------------------------------------------------
1 | import { Menu } from '.';
2 |
3 | import linksMock from '../NavLinks/mock';
4 |
5 | export default {
6 | title: 'Menu',
7 | component: Menu,
8 | args: {
9 | links: linksMock,
10 | logoData: {
11 | text: 'Logo',
12 | link: '#target',
13 | srcImg: '',
14 | },
15 | },
16 | };
17 |
18 | export const Template = (args) => {
19 | return (
20 |
21 |
22 |
23 | );
24 | };
25 |
--------------------------------------------------------------------------------
/src/components/Footer/index.jsx:
--------------------------------------------------------------------------------
1 | import P from 'prop-types';
2 | import * as Styled from './styles';
3 | import { TextComponent } from '../TextComponent';
4 | import { SectionContainer } from '../SectionContainer';
5 |
6 | export const Footer = ({ footerHtml }) => {
7 | return (
8 |
9 |
10 | {footerHtml}
11 |
12 |
13 | );
14 | };
15 |
16 | Footer.propTypes = {
17 | footerHtml: P.string.isRequired,
18 | };
19 |
--------------------------------------------------------------------------------
/src/components/MenuLink/index.jsx:
--------------------------------------------------------------------------------
1 | import P from 'prop-types';
2 | import { Link } from 'react-router-dom';
3 | import * as Styled from './styles';
4 |
5 | export const MenuLink = ({ children, link, newTab = false }) => {
6 | const target = newTab ? '_blank' : '_self';
7 |
8 | return (
9 |
10 | {children}
11 |
12 | );
13 | };
14 |
15 | MenuLink.propTypes = {
16 | children: P.node.isRequired,
17 | link: P.string.isRequired,
18 | newTab: P.bool,
19 | };
20 |
--------------------------------------------------------------------------------
/src/api/map-data.js:
--------------------------------------------------------------------------------
1 | import { mapMenu } from './map-menu';
2 | import { mapSections } from './map-sections';
3 |
4 | export const mapData = (pagesData = [{}]) => {
5 | return pagesData.map((data) => {
6 | const {
7 | footer_text: footerHtml = '',
8 | slug = '',
9 | title = '',
10 | sections = [],
11 | menu = {},
12 | } = data;
13 |
14 | return {
15 | footerHtml,
16 | slug,
17 | title,
18 | sections: mapSections(sections),
19 | menu: mapMenu(menu),
20 | };
21 | });
22 | };
23 |
--------------------------------------------------------------------------------
/src/components/SectionContainer/SectionContainer.test.jsx:
--------------------------------------------------------------------------------
1 | import { screen } from '@testing-library/react';
2 | import { renderTheme } from '../../styles/render-theme';
3 | import { SectionContainer } from '.';
4 |
5 | describe(' ', () => {
6 | it('should render content', () => {
7 | const { container } = renderTheme(
8 |
9 | Children
10 | ,
11 | );
12 | expect(screen.getByRole('heading')).toBeInTheDocument();
13 | expect(container).toMatchSnapshot();
14 | });
15 | });
16 |
--------------------------------------------------------------------------------
/src/components/SectionBackground/styles.js:
--------------------------------------------------------------------------------
1 | import styled, { css } from 'styled-components';
2 |
3 | const containerBackgroundActivate = (theme) => css`
4 | background: ${theme.colors.primaryColor};
5 | color: ${theme.colors.white};
6 | `;
7 |
8 | export const Container = styled.div`
9 | ${({ theme, background }) => css`
10 | background: ${theme.colors.white};
11 | color: ${theme.colors.primaryColor};
12 | ${background && containerBackgroundActivate(theme)};
13 | min-height: 100vh;
14 | display: flex;
15 | align-items: center;
16 | `}
17 | `;
18 |
--------------------------------------------------------------------------------
/public/manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "short_name": "React App",
3 | "name": "Create React App Sample",
4 | "icons": [
5 | {
6 | "src": "favicon.ico",
7 | "sizes": "64x64 32x32 24x24 16x16",
8 | "type": "image/x-icon"
9 | },
10 | {
11 | "src": "logo192.png",
12 | "type": "image/png",
13 | "sizes": "192x192"
14 | },
15 | {
16 | "src": "logo512.png",
17 | "type": "image/png",
18 | "sizes": "512x512"
19 | }
20 | ],
21 | "start_url": ".",
22 | "display": "standalone",
23 | "theme_color": "#000000",
24 | "background_color": "#ffffff"
25 | }
26 |
--------------------------------------------------------------------------------
/src/components/SectionBackground/index.jsx:
--------------------------------------------------------------------------------
1 | import P from 'prop-types';
2 | import { SectionContainer } from '../SectionContainer';
3 | import * as Styled from './styles';
4 |
5 | export const SectionBackground = ({
6 | children,
7 | background = false,
8 | sectionId = '',
9 | }) => {
10 | return (
11 |
12 | {children}
13 |
14 | );
15 | };
16 |
17 | SectionBackground.propTypes = {
18 | children: P.node.isRequired,
19 | background: P.bool,
20 | sectionId: P.string,
21 | };
22 |
--------------------------------------------------------------------------------
/src/components/LogoLink/stories.jsx:
--------------------------------------------------------------------------------
1 | import { LogoLink } from '.';
2 |
3 | export default {
4 | title: 'LogoLink',
5 | component: LogoLink,
6 | args: {
7 | text: 'LogoLink',
8 | srcImg: 'assets/images/logo.svg',
9 | link: 'http://localhost',
10 | },
11 | };
12 |
13 | export const ImageOnly = (args) => {
14 | return (
15 |
16 |
17 |
18 | );
19 | };
20 |
21 | export const TextOnly = (args) => {
22 | return (
23 |
24 |
25 |
26 | );
27 | };
28 |
29 | TextOnly.args = {
30 | srcImg: '',
31 | };
32 |
--------------------------------------------------------------------------------
/src/components/NavLinks/index.jsx:
--------------------------------------------------------------------------------
1 | import P from 'prop-types';
2 | import * as Styled from './styles';
3 | import { MenuLink } from '../MenuLink';
4 |
5 | export const NavLinks = ({ links = [] }) => {
6 | return (
7 |
8 | {links.map((link) => (
9 |
10 | ))}
11 |
12 | );
13 | };
14 |
15 | NavLinks.propTypes = {
16 | links: P.arrayOf(
17 | P.shape({
18 | children: P.string.isRequired,
19 | link: P.string.isRequired,
20 | newTab: P.bool,
21 | }),
22 | ),
23 | };
24 |
--------------------------------------------------------------------------------
/src/components/LogoLink/index.jsx:
--------------------------------------------------------------------------------
1 | import P from 'prop-types';
2 | import * as Styled from './styles';
3 | import { Heading } from '../Heading';
4 | import { Link } from 'react-router-dom';
5 |
6 | export const LogoLink = ({ text, srcImg = '', link }) => {
7 | return (
8 |
9 |
10 | {!!srcImg && }
11 | {!srcImg && text}
12 |
13 |
14 | );
15 | };
16 |
17 | LogoLink.propTypes = {
18 | text: P.string.isRequired,
19 | srcImg: P.string,
20 | link: P.string.isRequired,
21 | };
22 |
--------------------------------------------------------------------------------
/.eslintrc.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | env: {
3 | browser: true,
4 | es2021: true,
5 | jest: true,
6 | },
7 | extends: [
8 | 'eslint:recommended',
9 | 'plugin:react/recommended',
10 | 'plugin:react-hooks/recommended',
11 | 'plugin:prettier/recommended',
12 | ],
13 | parserOptions: {
14 | ecmaFeatures: {
15 | jsx: true,
16 | },
17 | ecmaVersion: 12,
18 | sourceType: 'module',
19 | },
20 | plugins: ['react'],
21 | settings: {
22 | react: {
23 | version: 'detect',
24 | },
25 | },
26 | rules: {
27 | 'react/react-in-jsx-scope': 'off',
28 | 'no-unused-vars': 'off',
29 | },
30 | };
31 |
--------------------------------------------------------------------------------
/src/components/GridText/GridText.test.jsx:
--------------------------------------------------------------------------------
1 | import { screen } from '@testing-library/react';
2 | import { renderTheme } from '../../styles/render-theme';
3 | import { GridText } from '.';
4 |
5 | import mock from './mock';
6 |
7 | describe(' ', () => {
8 | it('should render with background', () => {
9 | const { container } = renderTheme( );
10 | expect(container).toMatchSnapshot();
11 | });
12 |
13 | it('should render without background', () => {
14 | const { container } = renderTheme(
15 | ,
16 | );
17 | expect(container).toMatchSnapshot();
18 | });
19 | });
20 |
--------------------------------------------------------------------------------
/src/components/GridImage/GridImage.test.jsx:
--------------------------------------------------------------------------------
1 | import { screen } from '@testing-library/react';
2 | import { renderTheme } from '../../styles/render-theme';
3 | import { GridImage } from '.';
4 |
5 | import mock from './mock';
6 |
7 | describe(' ', () => {
8 | it('should render with background', () => {
9 | const { container } = renderTheme( );
10 | expect(container).toMatchSnapshot();
11 | });
12 |
13 | it('should render without background', () => {
14 | const { container } = renderTheme(
15 | ,
16 | );
17 | expect(container).toMatchSnapshot();
18 | });
19 | });
20 |
--------------------------------------------------------------------------------
/src/components/GridContent/GridContent.test.jsx:
--------------------------------------------------------------------------------
1 | import { screen } from '@testing-library/react';
2 | import { renderTheme } from '../../styles/render-theme';
3 | import { GridContent } from '.';
4 |
5 | import mock from './mock';
6 |
7 | describe(' ', () => {
8 | it('should render grid content', () => {
9 | const { container } = renderTheme( );
10 | expect(container).toMatchSnapshot();
11 | });
12 |
13 | it('should render grid content', () => {
14 | const { container } = renderTheme(
15 | ,
16 | );
17 | expect(container).toMatchSnapshot();
18 | });
19 | });
20 |
--------------------------------------------------------------------------------
/src/components/Heading/stories.jsx:
--------------------------------------------------------------------------------
1 | import { Heading } from '.';
2 |
3 | export default {
4 | title: 'Heading',
5 | component: Heading,
6 | args: {
7 | children: 'O texto está escuro',
8 | },
9 | argTypes: {
10 | children: { type: 'string' },
11 | },
12 | parameters: {
13 | backgrounds: {
14 | default: 'dark',
15 | },
16 | },
17 | };
18 |
19 | export const Light = (args) => ;
20 | export const Dark = (args) => ;
21 |
22 | Light.parameters = {
23 | backgrounds: {
24 | default: 'light',
25 | },
26 | };
27 |
28 | Dark.args = {
29 | children: 'O texto está claro',
30 | colorDark: false,
31 | };
32 |
--------------------------------------------------------------------------------
/src/components/TextComponent/stories.jsx:
--------------------------------------------------------------------------------
1 | import { TextComponent } from '.';
2 |
3 | export default {
4 | title: 'TextComponent',
5 | component: TextComponent,
6 | args: {
7 | children: `
8 | Lorem ipsum dolor sit amet consectetur adipisicing elit.
9 | Ullam placeat unde harum. Facilis, quasi delectus
10 | obcaecati perferendis nobis alias ad aspernatur quod neque,
11 | corporis, aperiam numquam. Sint consequatur omnis voluptate.`,
12 | },
13 | argTypes: {
14 | children: { type: 'string' },
15 | },
16 | };
17 |
18 | export const Template = (args) => {
19 | return (
20 |
21 |
22 |
23 | );
24 | };
25 |
--------------------------------------------------------------------------------
/src/templates/Base/mock.jsx:
--------------------------------------------------------------------------------
1 | import linksMock from '../../components/NavLinks/mock';
2 |
3 | import gridMock from '../../components/GridText/mock';
4 | import { GridText } from '../../components/GridText';
5 |
6 | export const mockBase = {
7 | children: (
8 | <>
9 |
10 |
11 |
12 |
13 |
14 |
15 | >
16 | ),
17 | links: linksMock,
18 | logoData: {
19 | text: 'Logo',
20 | link: '#',
21 | },
22 | footerHtml: 'Teste de footer
',
23 | };
24 |
--------------------------------------------------------------------------------
/src/components/Footer/styles.js:
--------------------------------------------------------------------------------
1 | import styled, { css } from 'styled-components';
2 | import { Container as TextComponent } from '../TextComponent/styles';
3 | import { Container as SectionContainer } from '../SectionContainer/styles';
4 |
5 | export const Container = styled.footer`
6 | ${({ theme }) => css`
7 | text-align: center;
8 | border-top: 0.1rem solid ${theme.colors.mediumGray};
9 |
10 | a {
11 | color: inherit;
12 | text-decoration: none;
13 | }
14 |
15 | & ${TextComponent} {
16 | font-size: ${theme.font.sizes.small};
17 | }
18 |
19 | & ${SectionContainer} {
20 | padding-top: 0;
21 | padding-bottom: 0;
22 | }
23 | `}
24 | `;
25 |
--------------------------------------------------------------------------------
/src/components/Heading/index.jsx:
--------------------------------------------------------------------------------
1 | import P from 'prop-types';
2 | import * as Styled from './styles';
3 |
4 | export const Heading = ({
5 | children,
6 | colorDark = true,
7 | as = 'h1',
8 | size = 'huge',
9 | uppercase = false,
10 | }) => {
11 | return (
12 |
18 | {children}
19 |
20 | );
21 | };
22 |
23 | Heading.propTypes = {
24 | children: P.node.isRequired,
25 | colorDark: P.bool,
26 | as: P.oneOf(['h1', 'h2', 'h3', 'h4', 'h5', 'h6']),
27 | size: P.oneOf(['small', 'medium', 'big', 'huge']),
28 | uppercase: P.bool,
29 | };
30 |
--------------------------------------------------------------------------------
/src/index.jsx:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import ReactDOM from 'react-dom';
3 | import { BrowserRouter, Route, Switch } from 'react-router-dom';
4 | import { ThemeProvider } from 'styled-components';
5 |
6 | import { GlobalStyles } from './styles/global-styles';
7 | import { theme } from './styles/theme';
8 | import Home from './templates/Home';
9 |
10 | ReactDOM.render(
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 | ,
21 | document.getElementById('root'),
22 | );
23 |
--------------------------------------------------------------------------------
/src/templates/Base/index.jsx:
--------------------------------------------------------------------------------
1 | import P from 'prop-types';
2 | import * as Styled from './styles';
3 | import { Menu } from '../../components/Menu';
4 | import { Footer } from '../../components/Footer';
5 | import { GoTop } from '../../components/GoTop';
6 |
7 | export const Base = ({ links, logoData, footerHtml, children }) => {
8 | return (
9 | <>
10 |
11 |
12 | {children}
13 |
14 |
15 |
16 | >
17 | );
18 | };
19 |
20 | Base.propTypes = {
21 | children: P.node.isRequired,
22 | ...Menu.propTypes,
23 | footerHtml: P.string.isRequired,
24 | };
25 |
--------------------------------------------------------------------------------
/.storybook/preview.js:
--------------------------------------------------------------------------------
1 | import { ThemeProvider } from 'styled-components';
2 | import { GlobalStyles } from '../src/styles/global-styles'
3 | import { theme } from '../src/styles/theme'
4 |
5 | export const parameters = {
6 | actions: { argTypesRegex: "^on[A-Z].*" },
7 | backgrounds: {
8 | default: 'light',
9 | values: [
10 | {
11 | name: 'light',
12 | value: theme.colors.white,
13 | },
14 | {
15 | name: 'dark',
16 | value: theme.colors.primaryColor,
17 | },
18 | ]
19 | }
20 | }
21 |
22 | export const decorators = [
23 | (Story) => (
24 |
25 |
26 |
27 |
28 | )
29 | ];
30 |
--------------------------------------------------------------------------------
/src/api/map-data.test.js:
--------------------------------------------------------------------------------
1 | import { mapData } from './map-data';
2 |
3 | describe('map-data', () => {
4 | it('should map data even if there is no data', () => {
5 | const pagesData = mapData()[0];
6 | expect(pagesData.footerHtml).toBe('');
7 | expect(pagesData.slug).toBe('');
8 | expect(pagesData.title).toBe('');
9 | });
10 |
11 | it('should map data if there are data', () => {
12 | const pagesData = mapData([
13 | {
14 | footer_text: 'Hey
',
15 | slug: 'slug',
16 | title: 'title',
17 | },
18 | ])[0];
19 | expect(pagesData.footerHtml).toBe('Hey
');
20 | expect(pagesData.slug).toBe('slug');
21 | expect(pagesData.title).toBe('title');
22 | });
23 | });
24 |
--------------------------------------------------------------------------------
/src/components/MenuLink/styles.js:
--------------------------------------------------------------------------------
1 | import styled, { css } from 'styled-components';
2 |
3 | export const Container = styled.a`
4 | ${({ theme }) => css`
5 | display: block;
6 | text-decoration: none;
7 | font-size: ${theme.font.sizes.small};
8 | padding: ${theme.spacings.small};
9 | color: ${theme.colors.primaryColor};
10 | position: relative;
11 |
12 | &::after {
13 | content: '';
14 | position: absolute;
15 | bottom: 0.76rem;
16 | left: 50%;
17 | width: 0;
18 | height: 0.2rem;
19 | background: ${theme.colors.secondaryColor};
20 | transition: all 300ms ease-in-out;
21 | }
22 |
23 | &:hover::after {
24 | left: 25%;
25 | width: 50%;
26 | }
27 | `}
28 | `;
29 |
--------------------------------------------------------------------------------
/src/api/map-menu.js:
--------------------------------------------------------------------------------
1 | export const mapMenu = (menu = {}) => {
2 | const {
3 | open_in_new_tab: newTab = false,
4 | logo_text: text = '',
5 | logo_link: link = '',
6 | menu: links = [],
7 | } = menu;
8 |
9 | const srcImg = menu.logo && menu.logo.url ? menu.logo.url : '';
10 |
11 | return {
12 | newTab,
13 | text,
14 | link,
15 | srcImg,
16 | links: mapMenuLinks(links),
17 | };
18 | };
19 |
20 | export const mapMenuLinks = (links = []) => {
21 | return links.map((item) => {
22 | const {
23 | open_in_new_tab: newTab = false,
24 | link_text: children = '',
25 | url: link = '',
26 | } = item;
27 |
28 | return {
29 | newTab,
30 | children,
31 | link,
32 | };
33 | });
34 | };
35 |
--------------------------------------------------------------------------------
/src/components/TextComponent/TextComponent.test.jsx:
--------------------------------------------------------------------------------
1 | import { screen } from '@testing-library/react';
2 | import { renderTheme } from '../../styles/render-theme';
3 | import { TextComponent } from '.';
4 |
5 | describe(' ', () => {
6 | it('should render a text', () => {
7 | renderTheme(Children );
8 | expect(screen.getByText('Children')).toBeInTheDocument();
9 | });
10 |
11 | it('should match snapshot', () => {
12 | const { container } = renderTheme(Children );
13 | expect(container.firstChild).toMatchInlineSnapshot(`
14 | .c0 {
15 | font-size: 2.4rem;
16 | }
17 |
18 |
21 | Children
22 |
23 | `);
24 | });
25 | });
26 |
--------------------------------------------------------------------------------
/src/components/SectionContainer/stories.jsx:
--------------------------------------------------------------------------------
1 | import { SectionContainer } from '.';
2 |
3 | export default {
4 | title: 'SectionContainer',
5 | component: SectionContainer,
6 | args: {
7 | children: (
8 |
9 |
SectionContainer
10 |
11 | Lorem ipsum dolor sit, amet consectetur adipisicing elit. Atque
12 | doloribus debitis minima nam beatae alias eius, mollitia asperiores
13 | animi dolorem esse, aperiam nesciunt praesentium. Labore vel optio
14 | quaerat aspernatur expedita!
15 |
16 |
17 | ),
18 | },
19 | argTypes: {
20 | children: { type: '' },
21 | },
22 | };
23 |
24 | export const Template = (args) => {
25 | return (
26 |
27 |
28 |
29 | );
30 | };
31 |
--------------------------------------------------------------------------------
/src/components/LogoLink/__snapshots__/LogoLink.test.jsx.snap:
--------------------------------------------------------------------------------
1 | // Jest Snapshot v1, https://goo.gl/fbAQLP
2 |
3 | exports[` should match snapshot 1`] = `
4 | .c1 {
5 | display: -webkit-box;
6 | display: -webkit-flex;
7 | display: -ms-flexbox;
8 | display: flex;
9 | -webkit-align-items: center;
10 | -webkit-box-align: center;
11 | -ms-flex-align: center;
12 | align-items: center;
13 | -webkit-text-decoration: none;
14 | text-decoration: none;
15 | color: inherit;
16 | }
17 |
18 | .c1 > img {
19 | height: 3rem;
20 | }
21 |
22 | .c0 {
23 | color: #0A1128;
24 | font-size: 2.4rem;
25 | text-transform: uppercase;
26 | }
27 |
28 |
41 | `;
42 |
--------------------------------------------------------------------------------
/src/styles/theme.js:
--------------------------------------------------------------------------------
1 | export const theme = {
2 | colors: {
3 | primaryColor: '#0A1128',
4 | secondaryColor: '#dc143c',
5 | white: '#FFFFFF',
6 | mediumGray: '#DDDDDD',
7 | },
8 | font: {
9 | family: {
10 | default: "'Open Sans', sans-serif",
11 | secondary: "'Montserrat', sans-serif",
12 | },
13 | sizes: {
14 | xsmall: '8rem',
15 | small: '1.6rem',
16 | medium: '2.4rem',
17 | large: '3.2rem',
18 | xlarge: '4.0rem',
19 | xxlarge: '4.8rem',
20 | huge: '5.6rem',
21 | xhuge: '6.4rem',
22 | },
23 | },
24 | media: {
25 | lteMedium: '(max-width: 768px)',
26 | },
27 | spacings: {
28 | xsmall: '8rem',
29 | small: '1.6rem',
30 | medium: '2.4rem',
31 | large: '3.2rem',
32 | xlarge: '4.0rem',
33 | xxlarge: '4.8rem',
34 | huge: '5.6rem',
35 | xhuge: '6.4rem',
36 | },
37 | };
38 |
--------------------------------------------------------------------------------
/src/components/SectionBackground/stories.jsx:
--------------------------------------------------------------------------------
1 | import { SectionBackground } from '.';
2 | import { SectionContainer } from '../SectionContainer';
3 |
4 | export default {
5 | title: 'SectionBackground',
6 | component: SectionBackground,
7 | args: {
8 | children: (
9 |
10 |
SectionBackground
11 |
12 | Lorem ipsum dolor sit, amet consectetur adipisicing elit. Atque
13 | doloribus debitis minima nam beatae alias eius, mollitia asperiores
14 | animi dolorem esse, aperiam nesciunt praesentium. Labore vel optio
15 | quaerat aspernatur expedita!
16 |
17 |
18 | ),
19 | },
20 | argTypes: {
21 | children: { type: '' },
22 | },
23 | };
24 |
25 | export const Template = (args) => {
26 | return (
27 |
28 |
29 |
30 | );
31 | };
32 |
--------------------------------------------------------------------------------
/src/components/SectionBackground/SectionBackground.test.jsx:
--------------------------------------------------------------------------------
1 | import { screen } from '@testing-library/react';
2 | import { renderTheme } from '../../styles/render-theme';
3 | import { SectionBackground } from '.';
4 |
5 | describe(' ', () => {
6 | it('should render with background dark', () => {
7 | const { container } = renderTheme(
8 |
9 | Children
10 | ,
11 | );
12 | expect(screen.getByRole('heading')).toBeInTheDocument();
13 | expect(container).toMatchSnapshot();
14 | });
15 |
16 | it('should render with background light', () => {
17 | const { container } = renderTheme(
18 |
19 | Children
20 | ,
21 | );
22 | expect(screen.getByRole('heading')).toBeInTheDocument();
23 | expect(container).toMatchSnapshot();
24 | });
25 | });
26 |
--------------------------------------------------------------------------------
/src/components/GridContent/index.jsx:
--------------------------------------------------------------------------------
1 | import P from 'prop-types';
2 | import { Heading } from '../Heading';
3 | import { SectionBackground } from '../SectionBackground';
4 | import { TextComponent } from '../TextComponent';
5 | import * as Styled from './styles';
6 |
7 | export const GridContent = ({
8 | title,
9 | html,
10 | background = false,
11 | sectionId = '',
12 | }) => {
13 | return (
14 |
15 |
16 |
17 | {title}
18 |
19 |
20 | {html}
21 |
22 |
23 |
24 | );
25 | };
26 |
27 | GridContent.propTypes = {
28 | title: P.string.isRequired,
29 | html: P.string.isRequired,
30 | background: P.bool,
31 | sectionId: P.string,
32 | };
33 |
--------------------------------------------------------------------------------
/src/components/GridImage/mock.js:
--------------------------------------------------------------------------------
1 | export default {
2 | background: false,
3 | title: 'My grid',
4 | description:
5 | 'Atque doloribus nobis laudantium esse ut, non commodi maxime distinctio veritatis unde',
6 | grid: [
7 | {
8 | altText: 'Teste 1',
9 | srcImg: 'https://source.unsplash.com/random/800x800?r=1',
10 | },
11 | {
12 | altText: 'Teste 2',
13 | srcImg: 'https://source.unsplash.com/random/800x800?r=2',
14 | },
15 | {
16 | altText: 'Teste 3',
17 | srcImg: 'https://source.unsplash.com/random/800x800?r=3',
18 | },
19 | {
20 | altText: 'Teste 4',
21 | srcImg: 'https://source.unsplash.com/random/800x800?r=4',
22 | },
23 | {
24 | altText: 'Teste 5',
25 | srcImg: 'https://source.unsplash.com/random/800x800?r=5',
26 | },
27 | {
28 | altText: 'Teste 6',
29 | srcImg: 'https://source.unsplash.com/random/800x800?r=6',
30 | },
31 | ],
32 | };
33 |
--------------------------------------------------------------------------------
/src/components/GridTwoColumns/styles.js:
--------------------------------------------------------------------------------
1 | import styled, { css } from 'styled-components';
2 | import { Title } from '../Heading/styles';
3 |
4 | export const Container = styled.div`
5 | ${({ theme }) => css`
6 | display: grid;
7 | grid-template-columns: 1fr 2fr;
8 | align-items: center;
9 | gap: ${theme.spacings.large};
10 |
11 | @media ${theme.media.lteMedium} {
12 | grid-template-columns: 1fr;
13 | text-align: center;
14 | }
15 |
16 | ${Title} {
17 | margin-bottom: ${theme.spacings.xlarge};
18 | }
19 | `}
20 | `;
21 |
22 | export const TextContainer = styled.div`
23 | ${({ theme }) => css`
24 | @media ${theme.media.lteMedium} {
25 | margin-bottom: ${theme.spacings.large};
26 | }
27 | `}
28 | `;
29 |
30 | export const ImageContainer = styled.div`
31 | ${({ theme }) => css``}
32 | `;
33 |
34 | export const Image = styled.img`
35 | ${({ theme }) => css`
36 | width: 100%;
37 | `}
38 | `;
39 |
--------------------------------------------------------------------------------
/src/components/Heading/styles.js:
--------------------------------------------------------------------------------
1 | import styled, { css } from 'styled-components';
2 |
3 | const titleSize = {
4 | small: (theme) => css`
5 | font-size: ${theme.font.sizes.medium};
6 | `,
7 | medium: (theme) => css`
8 | font-size: ${theme.font.sizes.large};
9 | `,
10 | big: (theme) => css`
11 | font-size: ${theme.font.sizes.xlarge};
12 | `,
13 | huge: (theme) => css`
14 | font-size: ${theme.font.sizes.xhuge};
15 | ${mediaFont(theme)};
16 | `,
17 | };
18 |
19 | const mediaFont = (theme) => css`
20 | @media ${theme.media.lteMedium} {
21 | font-size: ${theme.font.sizes.xlarge};
22 | }
23 | `;
24 |
25 | const titleCase = (uppercase) => css`
26 | text-transform: ${uppercase ? 'uppercase' : 'none'};
27 | `;
28 |
29 | export const Title = styled.h1`
30 | ${({ theme, colorDark, size, uppercase }) => css`
31 | color: ${colorDark ? theme.colors.primaryColor : theme.colors.white};
32 | ${titleSize[size](theme)};
33 | ${titleCase(uppercase)};
34 | `}
35 | `;
36 |
--------------------------------------------------------------------------------
/src/styles/global-styles.js:
--------------------------------------------------------------------------------
1 | import { createGlobalStyle, css } from 'styled-components';
2 |
3 | export const GlobalStyles = createGlobalStyle`
4 | * {
5 | margin: 0;
6 | padding: 0;
7 | box-sizing: border-box;
8 | }
9 |
10 | html {
11 | font-size: 62.5%;
12 | scroll-behavior: smooth;
13 | }
14 |
15 | body {
16 | font-size: 1.6rem;
17 | font-family: ${({ theme }) => theme.font.family.default};
18 | }
19 |
20 | h1, h2, h3, h4, h5, h6 {
21 | font-family: ${({ theme }) => theme.font.family.secondary};
22 | margin: ${({ theme }) => theme.spacings.large} 0;
23 | }
24 |
25 | p {
26 | margin: ${({ theme }) => theme.spacings.medium} 0;
27 | }
28 |
29 | ul, ol {
30 | margin: ${({ theme }) => theme.spacings.medium};
31 | padding: ${({ theme }) => theme.spacings.medium};
32 | }
33 |
34 | a {
35 | color: ${({ theme }) => theme.colors.secondaryColor};
36 | }
37 |
38 | .table {
39 | width: 100%;
40 | overflow-y: auto;
41 | }
42 | `;
43 |
--------------------------------------------------------------------------------
/src/components/NavLinks/mock.js:
--------------------------------------------------------------------------------
1 | export default [
2 | {
3 | children: 'Link 1',
4 | link: '#target1',
5 | newTab: false,
6 | },
7 | {
8 | children: 'Link 2',
9 | link: '#target2',
10 | newTab: false,
11 | },
12 | {
13 | children: 'Link 3',
14 | link: '#target3',
15 | newTab: false,
16 | },
17 | {
18 | children: 'Link 4',
19 | link: '#target4',
20 | newTab: false,
21 | },
22 | {
23 | children: 'Link 5',
24 | link: '#target5',
25 | newTab: false,
26 | },
27 | {
28 | children: 'Link 6',
29 | link: '#target6',
30 | newTab: false,
31 | },
32 | {
33 | children: 'Link 7',
34 | link: '#target7',
35 | newTab: false,
36 | },
37 | {
38 | children: 'Link 8',
39 | link: '#target8',
40 | newTab: false,
41 | },
42 | {
43 | children: 'Link 9',
44 | link: '#target9',
45 | newTab: false,
46 | },
47 | {
48 | children: 'Link 10',
49 | link: '#target10',
50 | newTab: false,
51 | },
52 | ];
53 |
--------------------------------------------------------------------------------
/src/components/GridImage/styles.js:
--------------------------------------------------------------------------------
1 | import styled, { css } from 'styled-components';
2 | import { Title as HeadingContainer } from '../Heading/styles';
3 | import { Container as TextComponent } from '../TextComponent/styles';
4 |
5 | export const Container = styled.div`
6 | ${({ theme }) => css`
7 | > ${TextComponent} {
8 | margin-bottom: ${theme.spacings.xhuge};
9 | }
10 | `}
11 | `;
12 |
13 | export const Grid = styled.div`
14 | ${({ theme }) => css`
15 | display: grid;
16 | grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
17 | gap: ${theme.spacings.large};
18 |
19 | @media ${theme.media.lteMedium} {
20 | grid-template-columns: 1fr;
21 | }
22 | `}
23 | `;
24 |
25 | export const GridElement = styled.div`
26 | ${({ theme }) => css`
27 | overflow: hidden;
28 | `}
29 | `;
30 |
31 | export const Image = styled.img`
32 | ${({ theme }) => css`
33 | width: 100%;
34 | transition: all 300ms ease-in-out;
35 |
36 | &:hover {
37 | transform: scale(1.2) rotate(10deg);
38 | }
39 | `}
40 | `;
41 |
--------------------------------------------------------------------------------
/src/components/LogoLink/LogoLink.test.jsx:
--------------------------------------------------------------------------------
1 | import { screen } from '@testing-library/react';
2 | import { renderTheme } from '../../styles/render-theme';
3 | import { LogoLink } from '.';
4 |
5 | describe(' ', () => {
6 | it('should render text logo', () => {
7 | renderTheme( );
8 | expect(
9 | screen.getByRole('heading', { name: 'Olá mundo' }),
10 | ).toBeInTheDocument();
11 | expect(screen.getByRole('link', { name: 'Olá mundo' })).toHaveAttribute(
12 | 'href',
13 | '#target',
14 | );
15 | });
16 |
17 | it('should render image logo', () => {
18 | renderTheme(
19 | ,
20 | );
21 | expect(screen.getByAltText('Olá mundo')).toHaveAttribute(
22 | 'src',
23 | 'image.jpg',
24 | );
25 | });
26 |
27 | it('should match snapshot', () => {
28 | const { container } = renderTheme(
29 | ,
30 | );
31 | expect(container.firstChild).toMatchSnapshot();
32 | });
33 | });
34 |
--------------------------------------------------------------------------------
/src/components/NavLinks/NavLinks.test.jsx:
--------------------------------------------------------------------------------
1 | import { screen } from '@testing-library/react';
2 | import { renderTheme } from '../../styles/render-theme';
3 | import { NavLinks } from '.';
4 |
5 | import mock from './mock';
6 | import { theme } from '../../styles/theme';
7 |
8 | describe(' ', () => {
9 | it('should render links', () => {
10 | renderTheme( );
11 | expect(screen.getAllByRole('link')).toHaveLength(mock.length);
12 | });
13 |
14 | it('should not render links', () => {
15 | renderTheme( );
16 | expect(screen.queryAllByText(/links/i)).toHaveLength(0);
17 | });
18 |
19 | it('should render links', () => {
20 | renderTheme( );
21 | expect(screen.getByText(/link 10/i).parentElement).toHaveStyleRule(
22 | 'flex-flow',
23 | 'column wrap',
24 | {
25 | media: theme.media.lteMedium,
26 | },
27 | );
28 | });
29 |
30 | it('should match snapshot', () => {
31 | const { container } = renderTheme( );
32 | expect(container.firstChild).toMatchSnapshot();
33 | });
34 | });
35 |
--------------------------------------------------------------------------------
/src/components/GridText/mock.js:
--------------------------------------------------------------------------------
1 | export default {
2 | background: false,
3 | title: 'My grid',
4 | description:
5 | 'Atque doloribus nobis laudantium esse ut, non commodi maxime distinctio veritatis unde',
6 | grid: [
7 | {
8 | title: 'Teste 1',
9 | description:
10 | 'Lorem ipsum dolor sit, amet consectetur adipisicing elit. Debitis cum delectus molestias. Atque doloribus nobis laudantium esse ut, non commodi maxime distinctio veritatis unde, reprehenderit minus ad dolores provident maiores.',
11 | },
12 | {
13 | title: 'Teste 2',
14 | description:
15 | 'Lorem ipsum dolor sit, amet consectetur adipisicing elit. Debitis cum delectus molestias. Atque doloribus nobis laudantium esse ut, non commodi maxime distinctio veritatis unde, reprehenderit minus ad dolores provident maiores.',
16 | },
17 | {
18 | title: 'Teste 3',
19 | description:
20 | 'Lorem ipsum dolor sit, amet consectetur adipisicing elit. Debitis cum delectus molestias. Atque doloribus nobis laudantium esse ut, non commodi maxime distinctio veritatis unde, reprehenderit minus ad dolores provident maiores.',
21 | },
22 | ],
23 | };
24 |
--------------------------------------------------------------------------------
/src/components/GridTwoColumns/index.jsx:
--------------------------------------------------------------------------------
1 | import P from 'prop-types';
2 | import * as Styled from './styles';
3 | import { SectionBackground } from '../SectionBackground';
4 | import { Heading } from '../Heading';
5 | import { TextComponent } from '../TextComponent';
6 |
7 | export const GridTwoColumns = ({
8 | title,
9 | text,
10 | srcImg,
11 | background = false,
12 | sectionId = '',
13 | }) => {
14 | return (
15 |
16 |
17 |
18 |
19 | {title}
20 |
21 | {text}
22 |
23 |
24 |
25 |
26 |
27 |
28 | );
29 | };
30 |
31 | GridTwoColumns.propTypes = {
32 | title: P.string.isRequired,
33 | text: P.string.isRequired,
34 | srcImg: P.string.isRequired,
35 | background: P.bool,
36 | sectionId: P.string,
37 | };
38 |
--------------------------------------------------------------------------------
/src/components/GridText/styles.js:
--------------------------------------------------------------------------------
1 | import styled, { css } from 'styled-components';
2 | import { Title as HeadingContainer } from '../Heading/styles';
3 | import { Container as TextComponent } from '../TextComponent/styles';
4 |
5 | export const Container = styled.div`
6 | ${({ theme }) => css`
7 | ${TextComponent} {
8 | margin-bottom: ${theme.spacings.xhuge};
9 | }
10 | `}
11 | `;
12 |
13 | export const Grid = styled.div`
14 | ${({ theme }) => css`
15 | counter-reset: grid-counter;
16 | display: grid;
17 | grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
18 | gap: ${theme.spacings.large};
19 | overflow: hidden;
20 | width: 100%;
21 |
22 | @media ${theme.media.lteMedium} {
23 | grid-template-columns: 1fr;
24 | }
25 | `}
26 | `;
27 |
28 | export const GridElement = styled.div`
29 | ${({ theme }) => css`
30 | ${HeadingContainer} {
31 | position: relative;
32 | left: 5rem;
33 | }
34 |
35 | ${HeadingContainer}::before {
36 | counter-increment: grid-counter;
37 | content: counter(grid-counter);
38 | position: absolute;
39 | font-size: 7rem;
40 | top: -3rem;
41 | left: -5rem;
42 | transform: rotate(5deg);
43 | }
44 | `}
45 | `;
46 |
--------------------------------------------------------------------------------
/src/components/GridImage/index.jsx:
--------------------------------------------------------------------------------
1 | import P from 'prop-types';
2 | import { Heading } from '../Heading';
3 | import { SectionBackground } from '../SectionBackground';
4 | import { TextComponent } from '../TextComponent';
5 | import * as Styled from './styles';
6 |
7 | export const GridImage = ({
8 | title,
9 | description,
10 | grid,
11 | background = false,
12 | sectionId = '',
13 | }) => {
14 | return (
15 |
16 |
17 |
18 | {title}
19 |
20 | {description}
21 |
22 | {grid.map((el) => (
23 |
24 |
25 |
26 | ))}
27 |
28 |
29 |
30 | );
31 | };
32 |
33 | GridImage.propTypes = {
34 | background: P.bool,
35 | title: P.string.isRequired,
36 | description: P.string.isRequired,
37 | grid: P.arrayOf(
38 | P.shape({
39 | altText: P.string.isRequired,
40 | srcImg: P.string.isRequired,
41 | }),
42 | ).isRequired,
43 | sectionId: P.string,
44 | };
45 |
--------------------------------------------------------------------------------
/src/components/Menu/index.jsx:
--------------------------------------------------------------------------------
1 | import P from 'prop-types';
2 | import * as Styled from './styles';
3 | import { SectionContainer } from '../SectionContainer';
4 | import { LogoLink } from '../LogoLink';
5 | import { NavLinks } from '../NavLinks';
6 | import { Menu as MenuIcon } from '@styled-icons/material-outlined/Menu';
7 | import { Close as CloseIcon } from '@styled-icons/material-outlined/Close';
8 | import { useState } from 'react';
9 |
10 | export const Menu = ({ links = [], logoData }) => {
11 | const [visible, setVisible] = useState(false);
12 |
13 | return (
14 | <>
15 | setVisible(true)}
18 | aria-label="Open/Close menu"
19 | >
20 | {visible ? (
21 |
22 | ) : (
23 |
24 | )}
25 |
26 | setVisible(false)}>
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 | >
35 | );
36 | };
37 |
38 | Menu.propTypes = {
39 | ...NavLinks.propTypes,
40 | logoData: P.shape(LogoLink.propTypes).isRequired,
41 | };
42 |
--------------------------------------------------------------------------------
/src/templates/Loading/styles.js:
--------------------------------------------------------------------------------
1 | import styled, { css, keyframes } from 'styled-components';
2 |
3 | const rotate = () => keyframes`
4 | 0% {
5 | transform: translate(-50%, -50%) rotate(0deg);
6 | }
7 |
8 | 100% {
9 | transform: translate(-50%, -50%) rotate(360deg);
10 | }
11 | `;
12 |
13 | export const Container = styled.div`
14 | ${({ theme }) => css`
15 | position: absolute;
16 | top: 0;
17 | left: 0;
18 | bottom: 0;
19 | right: 0;
20 | z-index: 10;
21 | background-color: ${theme.colors.primaryColor};
22 |
23 | &:before,
24 | &:after {
25 | content: '';
26 | position: absolute;
27 | top: 50%;
28 | left: 50%;
29 | transform: translate(-50%, -50%);
30 | border-width: 0.5rem;
31 | border-color: transparent;
32 | border-style: solid;
33 | border-radius: 50%;
34 | }
35 |
36 | &:after {
37 | width: 6rem;
38 | height: 6rem;
39 | border-left: 0.5rem solid ${theme.colors.secondaryColor};
40 | border-top: 0.5rem solid ${theme.colors.secondaryColor};
41 | animation: ${rotate()} 600ms linear infinite;
42 | }
43 |
44 | &:before {
45 | width: 2rem;
46 | height: 2rem;
47 | border-left: 0.5rem solid ${theme.colors.secondaryColor};
48 | border-top: 0.5rem solid ${theme.colors.secondaryColor};
49 | animation: ${rotate()} 1s linear reverse infinite;
50 | }
51 | `}
52 | `;
53 |
--------------------------------------------------------------------------------
/src/components/GridText/index.jsx:
--------------------------------------------------------------------------------
1 | import P from 'prop-types';
2 | import * as Styled from './styles';
3 | import { SectionBackground } from '../SectionBackground';
4 | import { Heading } from '../Heading';
5 | import { TextComponent } from '../TextComponent';
6 |
7 | export const GridText = ({
8 | title,
9 | description,
10 | grid,
11 | background = false,
12 | sectionId = '',
13 | }) => {
14 | return (
15 |
16 |
17 |
18 | {title}
19 |
20 | {description}
21 |
22 | {grid.map((el) => (
23 |
24 |
25 | {el.title}
26 |
27 | {el.description}
28 |
29 | ))}
30 |
31 |
32 |
33 | );
34 | };
35 |
36 | GridText.propTypes = {
37 | background: P.bool,
38 | title: P.string.isRequired,
39 | description: P.string.isRequired,
40 | grid: P.arrayOf(
41 | P.shape({
42 | title: P.string.isRequired,
43 | description: P.string.isRequired,
44 | }),
45 | ).isRequired,
46 | sectionId: P.string,
47 | };
48 |
--------------------------------------------------------------------------------
/src/components/Footer/Footer.test.jsx:
--------------------------------------------------------------------------------
1 | import { screen } from '@testing-library/react';
2 | import { renderTheme } from '../../styles/render-theme';
3 | import { Footer } from '.';
4 |
5 | describe('', () => {
6 | it('should render', () => {
7 | const { container } = renderTheme(Olá'} />);
8 | expect(screen.getByRole('heading', { name: 'Olá' })).toBeInTheDocument();
9 | expect(container).toMatchInlineSnapshot(`
10 | .c4 {
11 | font-size: 2.4rem;
12 | }
13 |
14 | .c2 {
15 | max-width: 120rem;
16 | margin: 0 auto;
17 | padding: 3.2rem;
18 | width: 100%;
19 | }
20 |
21 | .c0 {
22 | text-align: center;
23 | border-top: 0.1rem solid #DDDDDD;
24 | }
25 |
26 | .c0 a {
27 | color: inherit;
28 | -webkit-text-decoration: none;
29 | text-decoration: none;
30 | }
31 |
32 | .c0 .c3 {
33 | font-size: 1.6rem;
34 | }
35 |
36 | .c0 .c1 {
37 | padding-top: 0;
38 | padding-bottom: 0;
39 | }
40 |
41 |
42 |
45 |
48 |
51 |
52 | Olá
53 |
54 |
55 |
56 |
57 |
58 | `);
59 | });
60 | });
61 |
--------------------------------------------------------------------------------
/src/components/GridContent/mock.js:
--------------------------------------------------------------------------------
1 | export default {
2 | title: 'O título que eu quero',
3 | html: `Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo. Quisque sit amet est et sapien ullamcorper pharetra. Vestibulum erat wisi, condimentum sed, commodo vitae, ornare sit amet, wisi. Aenean fermentum, elit eget tincidunt condimentum, eros ipsum rutrum orci, sagittis tempus lacus enim ac dui. Donec non enim in turpis pulvinar facilisis. Ut felis.
4 |
5 | Header Level 2
6 |
7 |
8 | Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
9 | Aliquam tincidunt mauris eu risus.
10 |
11 |
12 | Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus magna. Cras in mi at felis aliquet congue. Ut a est eget ligula molestie gravida. Curabitur massa. Donec eleifend, libero at sagittis mollis, tellus est malesuada tellus, at luctus turpis elit sit amet quam. Vivamus pretium ornare est.
13 |
14 | Header Level 3
15 |
16 |
17 | Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
18 | Aliquam tincidunt mauris eu risus.
19 |
20 |
21 |
22 | #header h1 a {
23 | display: block;
24 | width: 300px;
25 | height: 80px;
26 | }
27 | `,
28 | background: false,
29 | };
30 |
--------------------------------------------------------------------------------
/src/components/SectionBackground/__snapshots__/SectionBackground.test.jsx.snap:
--------------------------------------------------------------------------------
1 | // Jest Snapshot v1, https://goo.gl/fbAQLP
2 |
3 | exports[` should render with background dark 1`] = `
4 | .c1 {
5 | max-width: 120rem;
6 | margin: 0 auto;
7 | padding: 3.2rem;
8 | width: 100%;
9 | }
10 |
11 | .c0 {
12 | background: #FFFFFF;
13 | color: #0A1128;
14 | background: #0A1128;
15 | color: #FFFFFF;
16 | min-height: 100vh;
17 | display: -webkit-box;
18 | display: -webkit-flex;
19 | display: -ms-flexbox;
20 | display: flex;
21 | -webkit-align-items: center;
22 | -webkit-box-align: center;
23 | -ms-flex-align: center;
24 | align-items: center;
25 | }
26 |
27 |
28 |
32 |
35 |
36 | Children
37 |
38 |
39 |
40 |
41 | `;
42 |
43 | exports[` should render with background light 1`] = `
44 | .c1 {
45 | max-width: 120rem;
46 | margin: 0 auto;
47 | padding: 3.2rem;
48 | width: 100%;
49 | }
50 |
51 | .c0 {
52 | background: #FFFFFF;
53 | color: #0A1128;
54 | min-height: 100vh;
55 | display: -webkit-box;
56 | display: -webkit-flex;
57 | display: -ms-flexbox;
58 | display: flex;
59 | -webkit-align-items: center;
60 | -webkit-box-align: center;
61 | -ms-flex-align: center;
62 | align-items: center;
63 | }
64 |
65 |
66 |
70 |
73 |
74 | Children
75 |
76 |
77 |
78 |
79 | `;
80 |
--------------------------------------------------------------------------------
/src/api/map-menu.test.js:
--------------------------------------------------------------------------------
1 | import { mapMenu, mapMenuLinks } from './map-menu';
2 |
3 | describe('map-menu', () => {
4 | it('should return a predefined object if no data', () => {
5 | const menu = mapMenu();
6 | expect(menu.newTab).toBe(false);
7 | expect(menu.text).toBe('');
8 | expect(menu.srcImg).toBe('');
9 | expect(menu.link).toBe('');
10 | });
11 |
12 | it('should map menu to match keys and values required', () => {
13 | const menu = mapMenu({
14 | open_in_new_tab: false,
15 | logo_text: 'Landing Page',
16 | logo_link: '#home',
17 | menu: [
18 | {
19 | open_in_new_tab: false,
20 | link_text: 'pricing',
21 | url: '#pricing',
22 | },
23 | {
24 | open_in_new_tab: false,
25 | link_text: 'contact',
26 | url: '#contact',
27 | },
28 | ],
29 | logo: {
30 | url: 'a.svg',
31 | },
32 | });
33 | expect(menu.newTab).toBe(false);
34 | expect(menu.text).toBe('Landing Page');
35 | expect(menu.srcImg).toBe('a.svg');
36 | expect(menu.link).toBe('#home');
37 | expect(menu.links[0].newTab).toBe(false);
38 | expect(menu.links[0].children).toBe('pricing');
39 | expect(menu.links[0].link).toBe('#pricing');
40 | });
41 |
42 | it('should return an empty array if no links', () => {
43 | const links = mapMenuLinks();
44 | expect(links).toEqual([]);
45 | });
46 |
47 | it('should map links if links passed', () => {
48 | const links = mapMenuLinks([
49 | {
50 | open_in_new_tab: false,
51 | link_text: 'pricing',
52 | url: '#pricing',
53 | },
54 | {},
55 | ]);
56 | expect(links[0].newTab).toBe(false);
57 | expect(links[0].children).toBe('pricing');
58 | expect(links[0].link).toBe('#pricing');
59 | });
60 | });
61 |
--------------------------------------------------------------------------------
/src/components/MenuLink/MenuLink.test.jsx:
--------------------------------------------------------------------------------
1 | import { screen } from '@testing-library/react';
2 | import { renderTheme } from '../../styles/render-theme';
3 | import { MenuLink } from '.';
4 |
5 | describe(' ', () => {
6 | it('should render a link', () => {
7 | renderTheme(Children );
8 | expect(screen.getByRole('link', { name: 'Children' })).toHaveAttribute(
9 | 'target',
10 | '_self',
11 | );
12 | });
13 |
14 | it('should render open in a new tab', () => {
15 | renderTheme(
16 |
17 | Children
18 | ,
19 | );
20 | expect(screen.getByRole('link', { name: 'Children' })).toHaveAttribute(
21 | 'target',
22 | '_blank',
23 | );
24 | });
25 |
26 | it('should render open in a new tab', () => {
27 | const { container } = renderTheme(
28 |
29 | Children
30 | ,
31 | );
32 | expect(container.firstChild).toMatchInlineSnapshot(`
33 | .c0 {
34 | display: block;
35 | -webkit-text-decoration: none;
36 | text-decoration: none;
37 | font-size: 1.6rem;
38 | padding: 1.6rem;
39 | color: #0A1128;
40 | position: relative;
41 | }
42 |
43 | .c0::after {
44 | content: '';
45 | position: absolute;
46 | bottom: 0.76rem;
47 | left: 50%;
48 | width: 0;
49 | height: 0.2rem;
50 | background: #dc143c;
51 | -webkit-transition: all 300ms ease-in-out;
52 | transition: all 300ms ease-in-out;
53 | }
54 |
55 | .c0:hover::after {
56 | left: 25%;
57 | width: 50%;
58 | }
59 |
60 |
65 | Children
66 |
67 | `);
68 | });
69 | });
70 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "project-3",
3 | "version": "0.1.0",
4 | "private": true,
5 | "homepage": ".",
6 | "dependencies": {
7 | "@styled-icons/material-outlined": "^10.28.0",
8 | "@testing-library/jest-dom": "^5.11.9",
9 | "@testing-library/react": "^11.2.5",
10 | "@testing-library/user-event": "^12.7.1",
11 | "react": "^17.0.1",
12 | "react-dom": "^17.0.1",
13 | "react-router-dom": "^5.2.0",
14 | "react-scripts": "4.0.2",
15 | "styled-components": "^5.2.1",
16 | "web-vitals": "^1.1.0"
17 | },
18 | "scripts": {
19 | "start": "react-scripts start",
20 | "build": "react-scripts build",
21 | "test": "react-scripts test",
22 | "eject": "react-scripts eject",
23 | "storybook": "start-storybook -p 6006 -s public",
24 | "build-storybook": "build-storybook -s public"
25 | },
26 | "eslintConfig": {
27 | "extends": [
28 | "react-app",
29 | "react-app/jest"
30 | ]
31 | },
32 | "browserslist": {
33 | "production": [
34 | ">0.2%",
35 | "not dead",
36 | "not op_mini all"
37 | ],
38 | "development": [
39 | "last 1 chrome version",
40 | "last 1 firefox version",
41 | "last 1 safari version"
42 | ]
43 | },
44 | "devDependencies": {
45 | "@storybook/addon-actions": "^6.1.18",
46 | "@storybook/addon-essentials": "^6.1.18",
47 | "@storybook/addon-links": "^6.1.18",
48 | "@storybook/node-logger": "^6.1.18",
49 | "@storybook/preset-create-react-app": "^3.1.6",
50 | "@storybook/react": "^6.1.18",
51 | "eslint-config-prettier": "^7.2.0",
52 | "eslint-plugin-prettier": "^3.3.1",
53 | "jest-styled-components": "^7.0.3",
54 | "prettier": "^2.2.1"
55 | },
56 | "jest": {
57 | "collectCoverageFrom": [
58 | "src/**/*.{js,jsx,ts,tsx}",
59 | "!/src/*.{js,jsx,ts,tsx}",
60 | "!/src/**/*mock*.{js,jsx,ts,tsx}",
61 | "!/src/styles/*.{js,jsx,ts,tsx}",
62 | "!/**/stories.{js,jsx,ts,tsx}",
63 | "!/src/templates/**/*.{js,jsx,ts,tsx}",
64 | "!/node_modules/"
65 | ]
66 | }
67 | }
68 |
--------------------------------------------------------------------------------
/src/components/GoTop/GoTop.test.jsx:
--------------------------------------------------------------------------------
1 | import { screen } from '@testing-library/react';
2 | import { renderTheme } from '../../styles/render-theme';
3 | import { GoTop } from '.';
4 |
5 | describe(' ', () => {
6 | it('should render a go to top button', () => {
7 | const { container } = renderTheme( );
8 | expect(screen.getByRole('link', { name: 'Go to top' })).toBeInTheDocument();
9 | expect(screen.getByRole('link', { name: 'Go to top' })).toHaveAttribute(
10 | 'href',
11 | '#',
12 | );
13 | expect(container).toMatchInlineSnapshot(`
14 | .c0 {
15 | position: fixed;
16 | background: #0A1128;
17 | color: #FFFFFF;
18 | display: -webkit-box;
19 | display: -webkit-flex;
20 | display: -ms-flexbox;
21 | display: flex;
22 | -webkit-align-items: center;
23 | -webkit-box-align: center;
24 | -ms-flex-align: center;
25 | align-items: center;
26 | -webkit-box-pack: center;
27 | -webkit-justify-content: center;
28 | -ms-flex-pack: center;
29 | justify-content: center;
30 | width: 4rem;
31 | height: 4rem;
32 | bottom: 2rem;
33 | right: 2rem;
34 | z-index: 6;
35 | }
36 |
37 | .c1 {
38 | display: inline-block;
39 | vertical-align: middle;
40 | overflow: hidden;
41 | }
42 |
43 |
68 | `);
69 | });
70 | });
71 |
--------------------------------------------------------------------------------
/src/components/Menu/Menu.test.jsx:
--------------------------------------------------------------------------------
1 | import { fireEvent, screen } from '@testing-library/react';
2 | import { renderTheme } from '../../styles/render-theme';
3 | import { Menu } from '.';
4 |
5 | import linksMock from '../NavLinks/mock';
6 | import { theme } from '../../styles/theme';
7 | const logoData = {
8 | text: 'Logo',
9 | link: '#target',
10 | };
11 |
12 | describe(' ', () => {
13 | it('should render Logo and Main Menu Nav', () => {
14 | const { container } = renderTheme(
15 | ,
16 | );
17 | expect(screen.getByRole('heading', { name: 'Logo' })).toBeInTheDocument();
18 | expect(
19 | screen.getByRole('navigation', { name: 'Main menu' }),
20 | ).toBeInTheDocument();
21 |
22 | expect(container).toMatchSnapshot();
23 | });
24 |
25 | it('should render menu mobile and button for open and close the menu', () => {
26 | const { container } = renderTheme(
27 | ,
28 | );
29 |
30 | const button = screen.getByLabelText('Open/Close menu');
31 | const menuContainer = button.nextSibling;
32 |
33 | expect(button).toHaveStyleRule('display', 'none');
34 | expect(button).toHaveStyleRule('display', 'flex', {
35 | media: theme.media.lteMedium,
36 | });
37 |
38 | expect(menuContainer).toHaveStyleRule('opacity', '0', {
39 | media: theme.media.lteMedium,
40 | });
41 | expect(screen.getByLabelText('Open menu')).toBeInTheDocument();
42 |
43 | fireEvent.click(button);
44 | expect(menuContainer).toHaveStyleRule('opacity', '1', {
45 | media: theme.media.lteMedium,
46 | });
47 | expect(screen.getByLabelText('Close menu')).toBeInTheDocument();
48 |
49 | fireEvent.click(menuContainer);
50 | expect(menuContainer).toHaveStyleRule('opacity', '0', {
51 | media: theme.media.lteMedium,
52 | });
53 | expect(screen.getByLabelText('Open menu')).toBeInTheDocument();
54 | });
55 |
56 | it('should not render links', () => {
57 | const { container } = renderTheme( );
58 | expect(
59 | screen.queryByRole('navigation', { name: 'Main menu' }).firstChild,
60 | ).not.toBeInTheDocument();
61 | expect(container).toMatchSnapshot();
62 | });
63 | });
64 |
--------------------------------------------------------------------------------
/public/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
14 |
15 |
19 |
20 |
29 | React App
30 |
31 |
32 | You need to enable JavaScript to run this app.
33 |
34 |
44 |
45 |
46 |
--------------------------------------------------------------------------------
/src/components/GridTwoColumns/__snapshots__/GridTwoColumns.test.jsx.snap:
--------------------------------------------------------------------------------
1 | // Jest Snapshot v1, https://goo.gl/fbAQLP
2 |
3 | exports[` should render two column grid 1`] = `
4 | .c5 {
5 | color: #0A1128;
6 | font-size: 6.4rem;
7 | text-transform: uppercase;
8 | }
9 |
10 | .c2 {
11 | display: grid;
12 | grid-template-columns: 1fr 2fr;
13 | -webkit-align-items: center;
14 | -webkit-box-align: center;
15 | -ms-flex-align: center;
16 | align-items: center;
17 | gap: 3.2rem;
18 | }
19 |
20 | .c2 .c4 {
21 | margin-bottom: 4.0rem;
22 | }
23 |
24 | .c1 {
25 | max-width: 120rem;
26 | margin: 0 auto;
27 | padding: 3.2rem;
28 | width: 100%;
29 | }
30 |
31 | .c0 {
32 | background: #FFFFFF;
33 | color: #0A1128;
34 | min-height: 100vh;
35 | display: -webkit-box;
36 | display: -webkit-flex;
37 | display: -ms-flexbox;
38 | display: flex;
39 | -webkit-align-items: center;
40 | -webkit-box-align: center;
41 | -ms-flex-align: center;
42 | align-items: center;
43 | }
44 |
45 | .c6 {
46 | font-size: 2.4rem;
47 | }
48 |
49 | @media (max-width:768px) {
50 | .c5 {
51 | font-size: 4.0rem;
52 | }
53 | }
54 |
55 | @media (max-width:768px) {
56 | .c2 {
57 | grid-template-columns: 1fr;
58 | text-align: center;
59 | }
60 | }
61 |
62 | @media (max-width:768px) {
63 | .c3 {
64 | margin-bottom: 3.2rem;
65 | }
66 | }
67 |
68 |
69 |
73 |
76 |
79 |
82 |
85 | Grid two columns
86 |
87 |
90 | Lorem ipsum dolor sit amet consectetur adipisicing elit. Distinctio magnam culpa eveniet doloribus harum? Ipsam, a necessitatibus? Sequi sunt accusantium quod, animi iure a, aliquid dolor ea vel magni dolore?
91 |
92 |
93 |
96 |
101 |
102 |
103 |
104 |
105 |
106 | `;
107 |
--------------------------------------------------------------------------------
/src/components/Menu/styles.js:
--------------------------------------------------------------------------------
1 | import styled, { css } from 'styled-components';
2 | import { Container as SectionContainer } from '../SectionContainer/styles';
3 | import { Title as Heading } from '../Heading/styles';
4 |
5 | const menuVisible = (theme) => css`
6 | visibility: visible;
7 | opacity: 1;
8 | `;
9 |
10 | export const Container = styled.div`
11 | ${({ theme, visible }) => css`
12 | position: fixed;
13 | z-index: 5;
14 | top: 0;
15 | left: 0;
16 | right: 0;
17 | width: 100%;
18 | border-bottom: ${theme.colors.mediumGray};
19 | background: ${theme.colors.white};
20 | transition: all 300ms ease-in-out;
21 |
22 | > ${SectionContainer} {
23 | padding-top: 0;
24 | padding-bottom: 0;
25 | }
26 |
27 | & ${Heading} {
28 | margin-top: 0;
29 | margin-bottom: 0;
30 | }
31 |
32 | @media ${theme.media.lteMedium} {
33 | height: 100vh;
34 | visibility: hidden;
35 | opacity: 0;
36 | ${visible && menuVisible(theme)}
37 |
38 | > ${SectionContainer} {
39 | display: grid;
40 | grid-template-columns: 1fr;
41 | grid-template-rows: 1fr;
42 | height: 100vh;
43 | align-items: center;
44 | overflow-y: auto;
45 | }
46 |
47 | & ${Heading} {
48 | padding-bottom: ${theme.spacings.large};
49 | display: flex;
50 | justify-content: center;
51 | }
52 | }
53 | `}
54 | `;
55 |
56 | export const MenuContainer = styled.div`
57 | ${({ theme }) => css`
58 | display: flex;
59 | justify-content: space-between;
60 | align-items: center;
61 |
62 | @media ${theme.media.lteMedium} {
63 | display: block;
64 | text-align: center;
65 | padding: ${theme.spacings.xxlarge} 0;
66 | }
67 | `}
68 | `;
69 |
70 | export const Button = styled.button`
71 | ${({ theme, visible }) => css`
72 | z-index: 6;
73 | position: fixed;
74 | top: 2rem;
75 | right: 2rem;
76 | width: 4rem;
77 | height: 4rem;
78 | background: ${theme.colors.primaryColor};
79 | color: ${theme.colors.white};
80 | border: none;
81 | display: none;
82 | pointer-events: ${visible ? 'none' : 'all'};
83 |
84 | @media ${theme.media.lteMedium} {
85 | display: flex;
86 | align-items: center;
87 | justify-content: center;
88 | }
89 |
90 | > svg {
91 | width: 2.5rem;
92 | height: 2.5rem;
93 | }
94 | `}
95 | `;
96 |
--------------------------------------------------------------------------------
/public/assets/images/logo.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/components/NavLinks/__snapshots__/NavLinks.test.jsx.snap:
--------------------------------------------------------------------------------
1 | // Jest Snapshot v1, https://goo.gl/fbAQLP
2 |
3 | exports[` should match snapshot 1`] = `
4 | .c0 {
5 | display: -webkit-box;
6 | display: -webkit-flex;
7 | display: -ms-flexbox;
8 | display: flex;
9 | -webkit-flex-flow: row wrap;
10 | -ms-flex-flow: row wrap;
11 | flex-flow: row wrap;
12 | }
13 |
14 | .c1 {
15 | display: block;
16 | -webkit-text-decoration: none;
17 | text-decoration: none;
18 | font-size: 1.6rem;
19 | padding: 1.6rem;
20 | color: #0A1128;
21 | position: relative;
22 | }
23 |
24 | .c1::after {
25 | content: '';
26 | position: absolute;
27 | bottom: 0.76rem;
28 | left: 50%;
29 | width: 0;
30 | height: 0.2rem;
31 | background: #dc143c;
32 | -webkit-transition: all 300ms ease-in-out;
33 | transition: all 300ms ease-in-out;
34 | }
35 |
36 | .c1:hover::after {
37 | left: 25%;
38 | width: 50%;
39 | }
40 |
41 | @media (max-width:768px) {
42 | .c0 {
43 | -webkit-flex-flow: column wrap;
44 | -ms-flex-flow: column wrap;
45 | flex-flow: column wrap;
46 | -webkit-align-content: center;
47 | -ms-flex-line-pack: center;
48 | align-content: center;
49 | }
50 | }
51 |
52 |
56 |
61 | Link 1
62 |
63 |
68 | Link 2
69 |
70 |
75 | Link 3
76 |
77 |
82 | Link 4
83 |
84 |
89 | Link 5
90 |
91 |
96 | Link 6
97 |
98 |
103 | Link 7
104 |
105 |
110 | Link 8
111 |
112 |
117 | Link 9
118 |
119 |
124 | Link 10
125 |
126 |
127 | `;
128 |
--------------------------------------------------------------------------------
/src/components/GoTop/stories.jsx:
--------------------------------------------------------------------------------
1 | import { GoTop } from '.';
2 |
3 | export default {
4 | title: 'GoTop',
5 | component: GoTop,
6 | args: {
7 | children: 'GoTop',
8 | },
9 | argTypes: {
10 | children: { type: 'string' },
11 | },
12 | };
13 |
14 | export const Template = (args) => {
15 | return (
16 |
17 |
Lorem ipsum dolor sit, amet
18 |
19 | Lorem ipsum dolor sit, amet consectetur adipisicing elit. Animi
20 | doloremque qui eum maxime magni omnis sit, aliquam soluta distinctio nam
21 | dignissimos praesentium ut sunt porro incidunt molestias libero ab
22 | consectetur.
23 |
24 |
Lorem ipsum dolor sit, amet
25 |
26 | Lorem ipsum dolor sit, amet consectetur adipisicing elit. Animi
27 | doloremque qui eum maxime magni omnis sit, aliquam soluta distinctio nam
28 | dignissimos praesentium ut sunt porro incidunt molestias libero ab
29 | consectetur.
30 |
31 |
Lorem ipsum dolor sit, amet
32 |
33 | Lorem ipsum dolor sit, amet consectetur adipisicing elit. Animi
34 | doloremque qui eum maxime magni omnis sit, aliquam soluta distinctio nam
35 | dignissimos praesentium ut sunt porro incidunt molestias libero ab
36 | consectetur.
37 |
38 |
Lorem ipsum dolor sit, amet
39 |
40 | Lorem ipsum dolor sit, amet consectetur adipisicing elit. Animi
41 | doloremque qui eum maxime magni omnis sit, aliquam soluta distinctio nam
42 | dignissimos praesentium ut sunt porro incidunt molestias libero ab
43 | consectetur.
44 |
45 |
Lorem ipsum dolor sit, amet
46 |
47 | Lorem ipsum dolor sit, amet consectetur adipisicing elit. Animi
48 | doloremque qui eum maxime magni omnis sit, aliquam soluta distinctio nam
49 | dignissimos praesentium ut sunt porro incidunt molestias libero ab
50 | consectetur.
51 |
52 |
Lorem ipsum dolor sit, amet
53 |
54 | Lorem ipsum dolor sit, amet consectetur adipisicing elit. Animi
55 | doloremque qui eum maxime magni omnis sit, aliquam soluta distinctio nam
56 | dignissimos praesentium ut sunt porro incidunt molestias libero ab
57 | consectetur.
58 |
59 |
Lorem ipsum dolor sit, amet
60 |
61 | Lorem ipsum dolor sit, amet consectetur adipisicing elit. Animi
62 | doloremque qui eum maxime magni omnis sit, aliquam soluta distinctio nam
63 | dignissimos praesentium ut sunt porro incidunt molestias libero ab
64 | consectetur.
65 |
66 |
67 |
68 | );
69 | };
70 |
--------------------------------------------------------------------------------
/src/templates/Home/index.jsx:
--------------------------------------------------------------------------------
1 | import { useEffect, useState } from 'react';
2 | import { useLocation } from 'react-router-dom';
3 |
4 | import * as Styled from './styles';
5 |
6 | import { mapData } from '../../api/map-data';
7 |
8 | import { Heading } from '../../components/Heading';
9 | import { GridTwoColumns } from '../../components/GridTwoColumns';
10 | import { GridContent } from '../../components/GridContent';
11 | import { GridText } from '../../components/GridText';
12 | import { GridImage } from '../../components/GridImage';
13 |
14 | import { mockBase } from '../Base/mock';
15 | import { Base } from '../Base';
16 | import { PageNotFound } from '../PageNotFound';
17 | import { Loading } from '../Loading';
18 |
19 | import config from '../../config';
20 |
21 | function Home() {
22 | const [data, setData] = useState([]);
23 | const location = useLocation();
24 |
25 | useEffect(() => {
26 | const pathname = location.pathname.replace(/[^a-z0-9-_]/gi, '');
27 | const slug = pathname ? pathname : config.defaultSlug;
28 |
29 | const load = async () => {
30 | try {
31 | const data = await fetch(config.url + slug);
32 | const json = await data.json();
33 | const pageData = mapData(json);
34 | setData(pageData[0]);
35 | } catch (e) {
36 | setData(undefined);
37 | }
38 | };
39 |
40 | load();
41 | }, [location]);
42 |
43 | useEffect(() => {
44 | if (data === undefined) {
45 | document.title = `Página não encontrada | ${config.siteName}`;
46 | }
47 |
48 | if (data && !data.slug) {
49 | document.title = `Carregando... | ${config.siteName}`;
50 | }
51 |
52 | if (data && data.title) {
53 | document.title = `${data.title} | ${config.siteName}`;
54 | }
55 | }, [data]);
56 |
57 | if (data === undefined) {
58 | return ;
59 | }
60 |
61 | if (data && !data.slug) {
62 | return ;
63 | }
64 |
65 | const { menu, sections, footerHtml, slug } = data;
66 | const { links, text, link, srcImg } = menu;
67 |
68 | return (
69 |
74 | {sections.map((section, index) => {
75 | const { component } = section;
76 | const key = `${slug}-${index}`;
77 |
78 | if (component === 'section.section-two-columns') {
79 | return ;
80 | }
81 |
82 | if (component === 'section.section-content') {
83 | return ;
84 | }
85 |
86 | if (component === 'section.section-grid-text') {
87 | return ;
88 | }
89 |
90 | if (component === 'section.section-grid-image') {
91 | return ;
92 | }
93 | })}
94 |
95 | );
96 | }
97 |
98 | export default Home;
99 |
--------------------------------------------------------------------------------
/src/api/map-sections.js:
--------------------------------------------------------------------------------
1 | export const mapSections = (sections = []) => {
2 | return sections.map((section) => {
3 | if (section.__component === 'section.section-two-columns') {
4 | return mapSectionTwoColumns(section);
5 | }
6 | if (section.__component === 'section.section-content') {
7 | return mapSectionContent(section);
8 | }
9 | if (section.__component === 'section.section-grid') {
10 | const { text_grid = [], image_grid = [] } = section;
11 |
12 | if (text_grid.length > 0) {
13 | return mapTextGrid(section);
14 | }
15 |
16 | if (image_grid.length > 0) {
17 | return mapImageGrid(section);
18 | }
19 | }
20 |
21 | return section;
22 | });
23 | };
24 |
25 | export const mapSectionTwoColumns = (section = {}) => {
26 | const {
27 | __component: component = '',
28 | title = '',
29 | description: text = '',
30 | image: { url: srcImg = '' } = '',
31 | metadata: { background = false, section_id: sectionId = '' } = false,
32 | } = section;
33 |
34 | return {
35 | component,
36 | title,
37 | text,
38 | srcImg,
39 | background,
40 | sectionId,
41 | };
42 | };
43 |
44 | export const mapSectionContent = (section = {}) => {
45 | const {
46 | __component: component = '',
47 | title = '',
48 | content: html = '',
49 | metadata: { background = false, section_id: sectionId = '' } = false,
50 | } = section;
51 |
52 | return {
53 | component,
54 | title,
55 | background,
56 | sectionId,
57 | html,
58 | };
59 | };
60 |
61 | export const mapTextGrid = (section = {}) => {
62 | const {
63 | __component: component = '',
64 | title = '',
65 | description = '',
66 | metadata: { background = false, section_id: sectionId = '' } = false,
67 | text_grid: grid = [],
68 | } = section;
69 |
70 | return {
71 | component: 'section.section-grid-text',
72 | title,
73 | background,
74 | sectionId,
75 | description,
76 | grid: grid.map((text) => {
77 | const { title = '', description = '' } = text;
78 | return {
79 | title,
80 | description,
81 | };
82 | }),
83 | };
84 | };
85 |
86 | export const mapImageGrid = (section = {}) => {
87 | const {
88 | __component: component = '',
89 | title = '',
90 | description = '',
91 | metadata: { background = false, section_id: sectionId = '' } = false,
92 | image_grid: grid = [],
93 | } = section;
94 |
95 | return {
96 | component: 'section.section-grid-image',
97 | title,
98 | background,
99 | sectionId,
100 | description,
101 | grid: grid.map((img) => {
102 | const {
103 | image: { url: srcImg = '', alternativeText: altText = '' } = '',
104 | } = img;
105 | return {
106 | srcImg,
107 | altText,
108 | };
109 | }),
110 | };
111 | };
112 |
--------------------------------------------------------------------------------
/src/components/Heading/Heading.test.jsx:
--------------------------------------------------------------------------------
1 | import { screen } from '@testing-library/react';
2 | import { ThemeProvider } from 'styled-components';
3 | import { Heading } from '.';
4 | import { renderTheme } from '../../styles/render-theme';
5 | import { theme } from '../../styles/theme';
6 |
7 | describe(' ', () => {
8 | it('should render with default values', () => {
9 | renderTheme(texto );
10 | const heading = screen.getByRole('heading', { name: 'texto' });
11 |
12 | expect(heading).toHaveStyle({
13 | color: theme.colors.primaryColor,
14 | 'font-size': theme.font.sizes.xhuge,
15 | 'text-transform': 'none',
16 | });
17 | });
18 |
19 | it('should render with white color', () => {
20 | renderTheme(texto );
21 | const heading = screen.getByRole('heading', { name: 'texto' });
22 |
23 | expect(heading).toHaveStyle({
24 | color: theme.colors.white,
25 | });
26 | });
27 |
28 | it('should render correct heading sizes', () => {
29 | const { rerender } = renderTheme(texto );
30 | const heading = screen.getByRole('heading', { name: 'texto' });
31 |
32 | expect(heading).toHaveStyle({
33 | 'font-size': theme.font.sizes.medium,
34 | });
35 |
36 | rerender(
37 |
38 | texto
39 | ,
40 | );
41 |
42 | expect(screen.getByRole('heading', { name: 'texto' })).toHaveStyle({
43 | 'font-size': theme.font.sizes.xlarge,
44 | });
45 |
46 | rerender(
47 |
48 | texto
49 | ,
50 | );
51 |
52 | expect(screen.getByRole('heading', { name: 'texto' })).toHaveStyle({
53 | 'font-size': theme.font.sizes.large,
54 | });
55 |
56 | rerender(
57 |
58 | texto
59 | ,
60 | );
61 |
62 | expect(screen.getByRole('heading', { name: 'texto' })).toHaveStyle({
63 | 'font-size': theme.font.sizes.xhuge,
64 | });
65 | });
66 |
67 | it('should render correct font-size when using mobile', () => {
68 | const { rerender } = renderTheme(texto );
69 | const heading = screen.getByRole('heading', { name: 'texto' });
70 |
71 | expect(screen.getByRole('heading', { name: 'texto' })).toHaveStyleRule(
72 | 'font-size',
73 | theme.font.sizes.xlarge,
74 | {
75 | media: theme.media.lteMedium,
76 | },
77 | );
78 | });
79 |
80 | it('should render with uppercase letters', () => {
81 | renderTheme(texto );
82 | const heading = screen.getByRole('heading', { name: 'texto' });
83 |
84 | expect(heading).toHaveStyle({
85 | 'text-transform': 'uppercase',
86 | });
87 | });
88 |
89 | it('should render correct heading element', () => {
90 | const { container } = renderTheme(texto );
91 | const heading = screen.getByRole('heading', { name: 'texto' });
92 | const h6 = container.querySelector('h6');
93 |
94 | expect(h6.tagName.toLowerCase()).toBe('h6');
95 | });
96 | });
97 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Getting Started with Create React App
2 |
3 | This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).
4 |
5 | ## Available Scripts
6 |
7 | In the project directory, you can run:
8 |
9 | ### `npm start`
10 |
11 | Runs the app in the development mode.\
12 | Open [http://localhost:3000](http://localhost:3000) to view it in the browser.
13 |
14 | The page will reload if you make edits.\
15 | You will also see any lint errors in the console.
16 |
17 | ### `npm test`
18 |
19 | Launches the test runner in the interactive watch mode.\
20 | See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.
21 |
22 | ### `npm run build`
23 |
24 | Builds the app for production to the `build` folder.\
25 | It correctly bundles React in production mode and optimizes the build for the best performance.
26 |
27 | The build is minified and the filenames include the hashes.\
28 | Your app is ready to be deployed!
29 |
30 | See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.
31 |
32 | ### `npm run eject`
33 |
34 | **Note: this is a one-way operation. Once you `eject`, you can’t go back!**
35 |
36 | If you aren’t satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.
37 |
38 | Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own.
39 |
40 | You don’t have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it.
41 |
42 | ## Learn More
43 |
44 | You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).
45 |
46 | To learn React, check out the [React documentation](https://reactjs.org/).
47 |
48 | ### Code Splitting
49 |
50 | This section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting)
51 |
52 | ### Analyzing the Bundle Size
53 |
54 | This section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size)
55 |
56 | ### Making a Progressive Web App
57 |
58 | This section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app)
59 |
60 | ### Advanced Configuration
61 |
62 | This section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration)
63 |
64 | ### Deployment
65 |
66 | This section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment)
67 |
68 | ### `npm run build` fails to minify
69 |
70 | This section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify)
71 |
--------------------------------------------------------------------------------
/src/api/map-sections.test.js:
--------------------------------------------------------------------------------
1 | import {
2 | mapImageGrid,
3 | mapSectionContent,
4 | mapSections,
5 | mapSectionTwoColumns,
6 | mapTextGrid,
7 | } from './map-sections';
8 |
9 | import pagesFakeData from './dados.json';
10 |
11 | describe('map-sections', () => {
12 | it('should render predefined section if no data', () => {
13 | const data = mapSections();
14 | expect(data).toEqual([]);
15 | });
16 |
17 | it('should render sections with correct data', () => {
18 | const data = mapSections(pagesFakeData[0].sections);
19 | expect(data[0].component).toBe('section.section-two-columns');
20 | });
21 |
22 | it('should test section with invalid data', () => {
23 | const withNoTextOrImageGrid = mapSections([
24 | {
25 | __component: 'section.section-grid',
26 | },
27 | ]);
28 |
29 | const WithNoComponent = mapSections([{}]);
30 | expect(withNoTextOrImageGrid).toEqual([
31 | { __component: 'section.section-grid' },
32 | ]);
33 | expect(WithNoComponent).toEqual([{}]);
34 | });
35 |
36 | it('should test section.section-grid with no text_grid or image_grid', () => {
37 | const withNoTextOrImageGrid = mapSections([
38 | {
39 | __component: 'section.section-grid',
40 | image_grid: [{}],
41 | },
42 | {
43 | __component: 'section.section-grid',
44 | text_grid: [{}],
45 | },
46 | ]);
47 | expect(withNoTextOrImageGrid.length).toBe(2);
48 | });
49 |
50 | it('should map section two columns if data is empty', () => {
51 | const data = mapSectionTwoColumns();
52 | expect(data.background).toBe(false);
53 | expect(data.component).toBe('');
54 | expect(data.sectionId).toBe('');
55 | expect(data.srcImg).toBe('');
56 | expect(data.text).toBe('');
57 | expect(data.title).toBe('');
58 | });
59 |
60 | it('should map section two columns with data', () => {
61 | const data = mapSectionTwoColumns({
62 | __component: 'section.section-two-columns',
63 | title: 'title',
64 | description: 'abc',
65 | metadata: {
66 | background: true,
67 | section_id: 'contact',
68 | },
69 | image: {
70 | url: 'a.svg',
71 | },
72 | });
73 | expect(data.background).toBe(true);
74 | expect(data.component).toBe('section.section-two-columns');
75 | expect(data.sectionId).toBe('contact');
76 | expect(data.srcImg).toBe('a.svg');
77 | expect(data.text).toBe('abc');
78 | expect(data.title).toBe('title');
79 | });
80 |
81 | it('should map section content with no data', () => {
82 | const data = mapSectionContent();
83 | expect(data.background).toBe(false);
84 | expect(data.component).toBe('');
85 | expect(data.sectionId).toBe('');
86 | expect(data.title).toBe('');
87 | expect(data.html).toBe('');
88 | });
89 |
90 | it('should map section content', () => {
91 | const data = mapSectionContent({
92 | __component: 'section.section-content',
93 | title: 'Pricing',
94 | content: 'abc',
95 | metadata: {
96 | background: false,
97 | section_id: 'pricing',
98 | },
99 | });
100 | expect(data.background).toBe(false);
101 | expect(data.component).toBe('section.section-content');
102 | expect(data.sectionId).toBe('pricing');
103 | expect(data.title).toBe('Pricing');
104 | expect(data.html).toBe('abc');
105 | });
106 |
107 | it('should map grid text with data', () => {
108 | const data = mapTextGrid({
109 | __component: 'section.section-grid',
110 | description: 'abc',
111 | title: 'My Grid',
112 | text_grid: [
113 | {
114 | title: 'Teste 1',
115 | description: 'Coisa',
116 | },
117 | {
118 | title: 'Teste 2',
119 | description: 'abc',
120 | },
121 | ],
122 | image_grid: [],
123 | metadata: {
124 | background: true,
125 | section_id: 'grid-one',
126 | },
127 | });
128 | expect(data.background).toBe(true);
129 | expect(data.component).toBe('section.section-grid-text');
130 | expect(data.sectionId).toBe('grid-one');
131 | expect(data.title).toBe('My Grid');
132 | expect(data.description).toBe('abc');
133 | expect(data.grid[0].title).toBe('Teste 1');
134 | expect(data.grid[0].description).toBe('Coisa');
135 | });
136 |
137 | it('should map grid text without data', () => {
138 | const data = mapTextGrid(undefined);
139 | expect(data.background).toBe(false);
140 | expect(data.component).toBe('section.section-grid-text');
141 | expect(data.sectionId).toBe('');
142 | expect(data.title).toBe('');
143 | expect(data.description).toBe('');
144 | });
145 |
146 | it('should map grid image without data', () => {
147 | const data = mapImageGrid(undefined);
148 | expect(data.background).toBe(false);
149 | expect(data.component).toBe('section.section-grid-image');
150 | expect(data.sectionId).toBe('');
151 | expect(data.title).toBe('');
152 | expect(data.description).toBe('');
153 | });
154 |
155 | it('should map grid image with data', () => {
156 | const data = mapImageGrid({
157 | __component: 'section.section-grid',
158 | description: 'abc',
159 | title: 'Gallery',
160 | text_grid: [],
161 | image_grid: [
162 | {
163 | image: {
164 | alternativeText: 'abc',
165 | url: 'a.svg',
166 | },
167 | },
168 | ],
169 | metadata: {
170 | background: false,
171 | name: 'gallery',
172 | section_id: 'gallery',
173 | },
174 | });
175 | expect(data.background).toBe(false);
176 | expect(data.component).toBe('section.section-grid-image');
177 | expect(data.sectionId).toBe('gallery');
178 | expect(data.title).toBe('Gallery');
179 | expect(data.description).toBe('abc');
180 | expect(data.grid[0].srcImg).toBe('a.svg');
181 | expect(data.grid[0].altText).toBe('abc');
182 | });
183 | });
184 |
--------------------------------------------------------------------------------
/src/components/GridImage/__snapshots__/GridImage.test.jsx.snap:
--------------------------------------------------------------------------------
1 | // Jest Snapshot v1, https://goo.gl/fbAQLP
2 |
3 | exports[` should render with background 1`] = `
4 | .c3 {
5 | color: #0A1128;
6 | font-size: 6.4rem;
7 | text-transform: uppercase;
8 | }
9 |
10 | .c1 {
11 | max-width: 120rem;
12 | margin: 0 auto;
13 | padding: 3.2rem;
14 | width: 100%;
15 | }
16 |
17 | .c0 {
18 | background: #FFFFFF;
19 | color: #0A1128;
20 | min-height: 100vh;
21 | display: -webkit-box;
22 | display: -webkit-flex;
23 | display: -ms-flexbox;
24 | display: flex;
25 | -webkit-align-items: center;
26 | -webkit-box-align: center;
27 | -ms-flex-align: center;
28 | align-items: center;
29 | }
30 |
31 | .c5 {
32 | font-size: 2.4rem;
33 | }
34 |
35 | .c2 > .c4 {
36 | margin-bottom: 6.4rem;
37 | }
38 |
39 | .c6 {
40 | display: grid;
41 | grid-template-columns: repeat(auto-fill,minmax(280px,1fr));
42 | gap: 3.2rem;
43 | }
44 |
45 | .c7 {
46 | overflow: hidden;
47 | }
48 |
49 | .c8 {
50 | width: 100%;
51 | -webkit-transition: all 300ms ease-in-out;
52 | transition: all 300ms ease-in-out;
53 | }
54 |
55 | .c8:hover {
56 | -webkit-transform: scale(1.2) rotate(10deg);
57 | -ms-transform: scale(1.2) rotate(10deg);
58 | transform: scale(1.2) rotate(10deg);
59 | }
60 |
61 | @media (max-width:768px) {
62 | .c3 {
63 | font-size: 4.0rem;
64 | }
65 | }
66 |
67 | @media (max-width:768px) {
68 | .c6 {
69 | grid-template-columns: 1fr;
70 | }
71 | }
72 |
73 |
74 |
78 |
81 |
84 |
87 | My grid
88 |
89 |
92 | Atque doloribus nobis laudantium esse ut, non commodi maxime distinctio veritatis unde
93 |
94 |
97 |
100 |
105 |
106 |
109 |
114 |
115 |
118 |
123 |
124 |
127 |
132 |
133 |
136 |
141 |
142 |
145 |
150 |
151 |
152 |
153 |
154 |
155 |
156 | `;
157 |
158 | exports[` should render without background 1`] = `
159 | .c3 {
160 | color: #0A1128;
161 | font-size: 6.4rem;
162 | text-transform: uppercase;
163 | }
164 |
165 | .c1 {
166 | max-width: 120rem;
167 | margin: 0 auto;
168 | padding: 3.2rem;
169 | width: 100%;
170 | }
171 |
172 | .c0 {
173 | background: #FFFFFF;
174 | color: #0A1128;
175 | min-height: 100vh;
176 | display: -webkit-box;
177 | display: -webkit-flex;
178 | display: -ms-flexbox;
179 | display: flex;
180 | -webkit-align-items: center;
181 | -webkit-box-align: center;
182 | -ms-flex-align: center;
183 | align-items: center;
184 | }
185 |
186 | .c5 {
187 | font-size: 2.4rem;
188 | }
189 |
190 | .c2 > .c4 {
191 | margin-bottom: 6.4rem;
192 | }
193 |
194 | .c6 {
195 | display: grid;
196 | grid-template-columns: repeat(auto-fill,minmax(280px,1fr));
197 | gap: 3.2rem;
198 | }
199 |
200 | .c7 {
201 | overflow: hidden;
202 | }
203 |
204 | .c8 {
205 | width: 100%;
206 | -webkit-transition: all 300ms ease-in-out;
207 | transition: all 300ms ease-in-out;
208 | }
209 |
210 | .c8:hover {
211 | -webkit-transform: scale(1.2) rotate(10deg);
212 | -ms-transform: scale(1.2) rotate(10deg);
213 | transform: scale(1.2) rotate(10deg);
214 | }
215 |
216 | @media (max-width:768px) {
217 | .c3 {
218 | font-size: 4.0rem;
219 | }
220 | }
221 |
222 | @media (max-width:768px) {
223 | .c6 {
224 | grid-template-columns: 1fr;
225 | }
226 | }
227 |
228 |
229 |
233 |
236 |
239 |
242 | My grid
243 |
244 |
247 | Atque doloribus nobis laudantium esse ut, non commodi maxime distinctio veritatis unde
248 |
249 |
252 |
255 |
260 |
261 |
264 |
269 |
270 |
273 |
278 |
279 |
282 |
287 |
288 |
291 |
296 |
297 |
300 |
305 |
306 |
307 |
308 |
309 |
310 |
311 | `;
312 |
--------------------------------------------------------------------------------
/src/components/GridText/__snapshots__/GridText.test.jsx.snap:
--------------------------------------------------------------------------------
1 | // Jest Snapshot v1, https://goo.gl/fbAQLP
2 |
3 | exports[` should render with background 1`] = `
4 | .c4 {
5 | color: #0A1128;
6 | font-size: 6.4rem;
7 | text-transform: uppercase;
8 | }
9 |
10 | .c9 {
11 | color: #0A1128;
12 | font-size: 3.2rem;
13 | text-transform: none;
14 | }
15 |
16 | .c6 {
17 | font-size: 2.4rem;
18 | }
19 |
20 | .c2 .c5 {
21 | margin-bottom: 6.4rem;
22 | }
23 |
24 | .c7 {
25 | counter-reset: grid-counter;
26 | display: grid;
27 | grid-template-columns: repeat(auto-fill,minmax(280px,1fr));
28 | gap: 3.2rem;
29 | overflow: hidden;
30 | width: 100%;
31 | }
32 |
33 | .c8 .c3 {
34 | position: relative;
35 | left: 5rem;
36 | }
37 |
38 | .c8 .c3::before {
39 | counter-increment: grid-counter;
40 | content: counter(grid-counter);
41 | position: absolute;
42 | font-size: 7rem;
43 | top: -3rem;
44 | left: -5rem;
45 | -webkit-transform: rotate(5deg);
46 | -ms-transform: rotate(5deg);
47 | transform: rotate(5deg);
48 | }
49 |
50 | .c1 {
51 | max-width: 120rem;
52 | margin: 0 auto;
53 | padding: 3.2rem;
54 | width: 100%;
55 | }
56 |
57 | .c0 {
58 | background: #FFFFFF;
59 | color: #0A1128;
60 | min-height: 100vh;
61 | display: -webkit-box;
62 | display: -webkit-flex;
63 | display: -ms-flexbox;
64 | display: flex;
65 | -webkit-align-items: center;
66 | -webkit-box-align: center;
67 | -ms-flex-align: center;
68 | align-items: center;
69 | }
70 |
71 | @media (max-width:768px) {
72 | .c4 {
73 | font-size: 4.0rem;
74 | }
75 | }
76 |
77 | @media (max-width:768px) {
78 | .c7 {
79 | grid-template-columns: 1fr;
80 | }
81 | }
82 |
83 |
84 |
88 |
91 |
94 |
97 | My grid
98 |
99 |
102 | Atque doloribus nobis laudantium esse ut, non commodi maxime distinctio veritatis unde
103 |
104 |
107 |
110 |
113 | Teste 1
114 |
115 |
118 | Lorem ipsum dolor sit, amet consectetur adipisicing elit. Debitis cum delectus molestias. Atque doloribus nobis laudantium esse ut, non commodi maxime distinctio veritatis unde, reprehenderit minus ad dolores provident maiores.
119 |
120 |
121 |
124 |
127 | Teste 2
128 |
129 |
132 | Lorem ipsum dolor sit, amet consectetur adipisicing elit. Debitis cum delectus molestias. Atque doloribus nobis laudantium esse ut, non commodi maxime distinctio veritatis unde, reprehenderit minus ad dolores provident maiores.
133 |
134 |
135 |
138 |
141 | Teste 3
142 |
143 |
146 | Lorem ipsum dolor sit, amet consectetur adipisicing elit. Debitis cum delectus molestias. Atque doloribus nobis laudantium esse ut, non commodi maxime distinctio veritatis unde, reprehenderit minus ad dolores provident maiores.
147 |
148 |
149 |
150 |
151 |
152 |
153 |
154 | `;
155 |
156 | exports[` should render without background 1`] = `
157 | .c4 {
158 | color: #0A1128;
159 | font-size: 6.4rem;
160 | text-transform: uppercase;
161 | }
162 |
163 | .c9 {
164 | color: #0A1128;
165 | font-size: 3.2rem;
166 | text-transform: none;
167 | }
168 |
169 | .c6 {
170 | font-size: 2.4rem;
171 | }
172 |
173 | .c2 .c5 {
174 | margin-bottom: 6.4rem;
175 | }
176 |
177 | .c7 {
178 | counter-reset: grid-counter;
179 | display: grid;
180 | grid-template-columns: repeat(auto-fill,minmax(280px,1fr));
181 | gap: 3.2rem;
182 | overflow: hidden;
183 | width: 100%;
184 | }
185 |
186 | .c8 .c3 {
187 | position: relative;
188 | left: 5rem;
189 | }
190 |
191 | .c8 .c3::before {
192 | counter-increment: grid-counter;
193 | content: counter(grid-counter);
194 | position: absolute;
195 | font-size: 7rem;
196 | top: -3rem;
197 | left: -5rem;
198 | -webkit-transform: rotate(5deg);
199 | -ms-transform: rotate(5deg);
200 | transform: rotate(5deg);
201 | }
202 |
203 | .c1 {
204 | max-width: 120rem;
205 | margin: 0 auto;
206 | padding: 3.2rem;
207 | width: 100%;
208 | }
209 |
210 | .c0 {
211 | background: #FFFFFF;
212 | color: #0A1128;
213 | min-height: 100vh;
214 | display: -webkit-box;
215 | display: -webkit-flex;
216 | display: -ms-flexbox;
217 | display: flex;
218 | -webkit-align-items: center;
219 | -webkit-box-align: center;
220 | -ms-flex-align: center;
221 | align-items: center;
222 | }
223 |
224 | @media (max-width:768px) {
225 | .c4 {
226 | font-size: 4.0rem;
227 | }
228 | }
229 |
230 | @media (max-width:768px) {
231 | .c7 {
232 | grid-template-columns: 1fr;
233 | }
234 | }
235 |
236 |
237 |
241 |
244 |
247 |
250 | My grid
251 |
252 |
255 | Atque doloribus nobis laudantium esse ut, non commodi maxime distinctio veritatis unde
256 |
257 |
260 |
263 |
266 | Teste 1
267 |
268 |
271 | Lorem ipsum dolor sit, amet consectetur adipisicing elit. Debitis cum delectus molestias. Atque doloribus nobis laudantium esse ut, non commodi maxime distinctio veritatis unde, reprehenderit minus ad dolores provident maiores.
272 |
273 |
274 |
277 |
280 | Teste 2
281 |
282 |
285 | Lorem ipsum dolor sit, amet consectetur adipisicing elit. Debitis cum delectus molestias. Atque doloribus nobis laudantium esse ut, non commodi maxime distinctio veritatis unde, reprehenderit minus ad dolores provident maiores.
286 |
287 |
288 |
291 |
294 | Teste 3
295 |
296 |
299 | Lorem ipsum dolor sit, amet consectetur adipisicing elit. Debitis cum delectus molestias. Atque doloribus nobis laudantium esse ut, non commodi maxime distinctio veritatis unde, reprehenderit minus ad dolores provident maiores.
300 |
301 |
302 |
303 |
304 |
305 |
306 |
307 | `;
308 |
--------------------------------------------------------------------------------
/src/components/GridContent/__snapshots__/GridContent.test.jsx.snap:
--------------------------------------------------------------------------------
1 | // Jest Snapshot v1, https://goo.gl/fbAQLP
2 |
3 | exports[` should render grid content 1`] = `
4 | .c3 {
5 | color: #0A1128;
6 | font-size: 6.4rem;
7 | text-transform: uppercase;
8 | }
9 |
10 | .c1 {
11 | max-width: 120rem;
12 | margin: 0 auto;
13 | padding: 3.2rem;
14 | width: 100%;
15 | }
16 |
17 | .c0 {
18 | background: #FFFFFF;
19 | color: #0A1128;
20 | min-height: 100vh;
21 | display: -webkit-box;
22 | display: -webkit-flex;
23 | display: -ms-flexbox;
24 | display: flex;
25 | -webkit-align-items: center;
26 | -webkit-box-align: center;
27 | -ms-flex-align: center;
28 | align-items: center;
29 | }
30 |
31 | .c5 {
32 | font-size: 2.4rem;
33 | }
34 |
35 | .c2 {
36 | text-align: center;
37 | max-width: 58rem;
38 | margin: 0 auto;
39 | }
40 |
41 | .c4 {
42 | margin: 6.4rem 0;
43 | }
44 |
45 | @media (max-width:768px) {
46 | .c3 {
47 | font-size: 4.0rem;
48 | }
49 | }
50 |
51 |
52 |
56 |
59 |
62 |
65 | O título que eu quero
66 |
67 |
70 |
73 |
74 |
75 | Pellentesque habitant morbi tristique
76 |
77 | senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper.
78 |
79 | Aenean ultricies mi vitae est.
80 |
81 | Mauris placerat eleifend leo. Quisque sit amet est et sapien ullamcorper pharetra. Vestibulum erat wisi, condimentum sed,
82 |
83 | commodo vitae
84 |
85 | , ornare sit amet, wisi. Aenean fermentum, elit eget tincidunt condimentum, eros ipsum rutrum orci, sagittis tempus lacus enim ac dui.
86 |
89 | Donec non enim
90 |
91 | in turpis pulvinar facilisis. Ut felis.
92 |
93 |
94 |
95 |
96 |
97 | Header Level 2
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 | Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
107 |
108 |
109 |
110 |
111 | Aliquam tincidunt mauris eu risus.
112 |
113 |
114 |
115 |
116 |
117 |
118 |
119 |
120 |
121 | Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus magna. Cras in mi at felis aliquet congue. Ut a est eget ligula molestie gravida. Curabitur massa. Donec eleifend, libero at sagittis mollis, tellus est malesuada tellus, at luctus turpis elit sit amet quam. Vivamus pretium ornare est.
122 |
123 |
124 |
125 |
126 |
127 |
128 | Header Level 3
129 |
130 |
131 |
132 |
133 |
134 |
135 |
136 |
137 | Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
138 |
139 |
140 |
141 |
142 | Aliquam tincidunt mauris eu risus.
143 |
144 |
145 |
146 |
147 |
148 |
149 |
150 |
151 |
152 |
153 | #header h1 a {
154 | display: block;
155 | width: 300px;
156 | height: 80px;
157 | }
158 |
159 |
160 |
161 |
162 |
163 |
164 |
165 |
166 |
167 | `;
168 |
169 | exports[` should render grid content 2`] = `
170 | .c3 {
171 | color: #0A1128;
172 | font-size: 6.4rem;
173 | text-transform: uppercase;
174 | }
175 |
176 | .c1 {
177 | max-width: 120rem;
178 | margin: 0 auto;
179 | padding: 3.2rem;
180 | width: 100%;
181 | }
182 |
183 | .c0 {
184 | background: #FFFFFF;
185 | color: #0A1128;
186 | min-height: 100vh;
187 | display: -webkit-box;
188 | display: -webkit-flex;
189 | display: -ms-flexbox;
190 | display: flex;
191 | -webkit-align-items: center;
192 | -webkit-box-align: center;
193 | -ms-flex-align: center;
194 | align-items: center;
195 | }
196 |
197 | .c5 {
198 | font-size: 2.4rem;
199 | }
200 |
201 | .c2 {
202 | text-align: center;
203 | max-width: 58rem;
204 | margin: 0 auto;
205 | }
206 |
207 | .c4 {
208 | margin: 6.4rem 0;
209 | }
210 |
211 | @media (max-width:768px) {
212 | .c3 {
213 | font-size: 4.0rem;
214 | }
215 | }
216 |
217 |
218 |
222 |
225 |
228 |
231 | O título que eu quero
232 |
233 |
236 |
239 |
240 |
241 | Pellentesque habitant morbi tristique
242 |
243 | senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper.
244 |
245 | Aenean ultricies mi vitae est.
246 |
247 | Mauris placerat eleifend leo. Quisque sit amet est et sapien ullamcorper pharetra. Vestibulum erat wisi, condimentum sed,
248 |
249 | commodo vitae
250 |
251 | , ornare sit amet, wisi. Aenean fermentum, elit eget tincidunt condimentum, eros ipsum rutrum orci, sagittis tempus lacus enim ac dui.
252 |
255 | Donec non enim
256 |
257 | in turpis pulvinar facilisis. Ut felis.
258 |
259 |
260 |
261 |
262 |
263 | Header Level 2
264 |
265 |
266 |
267 |
268 |
269 |
270 |
271 |
272 | Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
273 |
274 |
275 |
276 |
277 | Aliquam tincidunt mauris eu risus.
278 |
279 |
280 |
281 |
282 |
283 |
284 |
285 |
286 |
287 | Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus magna. Cras in mi at felis aliquet congue. Ut a est eget ligula molestie gravida. Curabitur massa. Donec eleifend, libero at sagittis mollis, tellus est malesuada tellus, at luctus turpis elit sit amet quam. Vivamus pretium ornare est.
288 |
289 |
290 |
291 |
292 |
293 |
294 | Header Level 3
295 |
296 |
297 |
298 |
299 |
300 |
301 |
302 |
303 | Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
304 |
305 |
306 |
307 |
308 | Aliquam tincidunt mauris eu risus.
309 |
310 |
311 |
312 |
313 |
314 |
315 |
316 |
317 |
318 |
319 | #header h1 a {
320 | display: block;
321 | width: 300px;
322 | height: 80px;
323 | }
324 |
325 |
326 |
327 |
328 |
329 |
330 |
331 |
332 |
333 | `;
334 |
--------------------------------------------------------------------------------
/src/components/Menu/__snapshots__/Menu.test.jsx.snap:
--------------------------------------------------------------------------------
1 | // Jest Snapshot v1, https://goo.gl/fbAQLP
2 |
3 | exports[` should not render links 1`] = `
4 | .c4 {
5 | max-width: 120rem;
6 | margin: 0 auto;
7 | padding: 3.2rem;
8 | width: 100%;
9 | }
10 |
11 | .c7 {
12 | color: #0A1128;
13 | font-size: 2.4rem;
14 | text-transform: uppercase;
15 | }
16 |
17 | .c2 {
18 | position: fixed;
19 | z-index: 5;
20 | top: 0;
21 | left: 0;
22 | right: 0;
23 | width: 100%;
24 | border-bottom: #DDDDDD;
25 | background: #FFFFFF;
26 | -webkit-transition: all 300ms ease-in-out;
27 | transition: all 300ms ease-in-out;
28 | }
29 |
30 | .c2 > .c3 {
31 | padding-top: 0;
32 | padding-bottom: 0;
33 | }
34 |
35 | .c2 .c6 {
36 | margin-top: 0;
37 | margin-bottom: 0;
38 | }
39 |
40 | .c5 {
41 | display: -webkit-box;
42 | display: -webkit-flex;
43 | display: -ms-flexbox;
44 | display: flex;
45 | -webkit-box-pack: justify;
46 | -webkit-justify-content: space-between;
47 | -ms-flex-pack: justify;
48 | justify-content: space-between;
49 | -webkit-align-items: center;
50 | -webkit-box-align: center;
51 | -ms-flex-align: center;
52 | align-items: center;
53 | }
54 |
55 | .c0 {
56 | z-index: 6;
57 | position: fixed;
58 | top: 2rem;
59 | right: 2rem;
60 | width: 4rem;
61 | height: 4rem;
62 | background: #0A1128;
63 | color: #FFFFFF;
64 | border: none;
65 | display: none;
66 | pointer-events: all;
67 | }
68 |
69 | .c0 > svg {
70 | width: 2.5rem;
71 | height: 2.5rem;
72 | }
73 |
74 | .c8 {
75 | display: -webkit-box;
76 | display: -webkit-flex;
77 | display: -ms-flexbox;
78 | display: flex;
79 | -webkit-align-items: center;
80 | -webkit-box-align: center;
81 | -ms-flex-align: center;
82 | align-items: center;
83 | -webkit-text-decoration: none;
84 | text-decoration: none;
85 | color: inherit;
86 | }
87 |
88 | .c8 > img {
89 | height: 3rem;
90 | }
91 |
92 | .c9 {
93 | display: -webkit-box;
94 | display: -webkit-flex;
95 | display: -ms-flexbox;
96 | display: flex;
97 | -webkit-flex-flow: row wrap;
98 | -ms-flex-flow: row wrap;
99 | flex-flow: row wrap;
100 | }
101 |
102 | .c1 {
103 | display: inline-block;
104 | vertical-align: middle;
105 | overflow: hidden;
106 | }
107 |
108 | @media (max-width:768px) {
109 | .c2 {
110 | height: 100vh;
111 | visibility: hidden;
112 | opacity: 0;
113 | }
114 |
115 | .c2 > .c3 {
116 | display: grid;
117 | grid-template-columns: 1fr;
118 | grid-template-rows: 1fr;
119 | height: 100vh;
120 | -webkit-align-items: center;
121 | -webkit-box-align: center;
122 | -ms-flex-align: center;
123 | align-items: center;
124 | overflow-y: auto;
125 | }
126 |
127 | .c2 .c6 {
128 | padding-bottom: 3.2rem;
129 | display: -webkit-box;
130 | display: -webkit-flex;
131 | display: -ms-flexbox;
132 | display: flex;
133 | -webkit-box-pack: center;
134 | -webkit-justify-content: center;
135 | -ms-flex-pack: center;
136 | justify-content: center;
137 | }
138 | }
139 |
140 | @media (max-width:768px) {
141 | .c5 {
142 | display: block;
143 | text-align: center;
144 | padding: 4.8rem 0;
145 | }
146 | }
147 |
148 | @media (max-width:768px) {
149 | .c0 {
150 | display: -webkit-box;
151 | display: -webkit-flex;
152 | display: -ms-flexbox;
153 | display: flex;
154 | -webkit-align-items: center;
155 | -webkit-box-align: center;
156 | -ms-flex-align: center;
157 | align-items: center;
158 | -webkit-box-pack: center;
159 | -webkit-justify-content: center;
160 | -ms-flex-pack: center;
161 | justify-content: center;
162 | }
163 | }
164 |
165 | @media (max-width:768px) {
166 | .c9 {
167 | -webkit-flex-flow: column wrap;
168 | -ms-flex-flow: column wrap;
169 | flex-flow: column wrap;
170 | -webkit-align-content: center;
171 | -ms-flex-line-pack: center;
172 | align-content: center;
173 | }
174 | }
175 |
176 |
177 |
181 |
190 |
194 |
197 |
198 |
199 |
225 |
226 | `;
227 |
228 | exports[` should render Logo and Main Menu Nav 1`] = `
229 | .c4 {
230 | max-width: 120rem;
231 | margin: 0 auto;
232 | padding: 3.2rem;
233 | width: 100%;
234 | }
235 |
236 | .c7 {
237 | color: #0A1128;
238 | font-size: 2.4rem;
239 | text-transform: uppercase;
240 | }
241 |
242 | .c2 {
243 | position: fixed;
244 | z-index: 5;
245 | top: 0;
246 | left: 0;
247 | right: 0;
248 | width: 100%;
249 | border-bottom: #DDDDDD;
250 | background: #FFFFFF;
251 | -webkit-transition: all 300ms ease-in-out;
252 | transition: all 300ms ease-in-out;
253 | }
254 |
255 | .c2 > .c3 {
256 | padding-top: 0;
257 | padding-bottom: 0;
258 | }
259 |
260 | .c2 .c6 {
261 | margin-top: 0;
262 | margin-bottom: 0;
263 | }
264 |
265 | .c5 {
266 | display: -webkit-box;
267 | display: -webkit-flex;
268 | display: -ms-flexbox;
269 | display: flex;
270 | -webkit-box-pack: justify;
271 | -webkit-justify-content: space-between;
272 | -ms-flex-pack: justify;
273 | justify-content: space-between;
274 | -webkit-align-items: center;
275 | -webkit-box-align: center;
276 | -ms-flex-align: center;
277 | align-items: center;
278 | }
279 |
280 | .c0 {
281 | z-index: 6;
282 | position: fixed;
283 | top: 2rem;
284 | right: 2rem;
285 | width: 4rem;
286 | height: 4rem;
287 | background: #0A1128;
288 | color: #FFFFFF;
289 | border: none;
290 | display: none;
291 | pointer-events: all;
292 | }
293 |
294 | .c0 > svg {
295 | width: 2.5rem;
296 | height: 2.5rem;
297 | }
298 |
299 | .c8 {
300 | display: -webkit-box;
301 | display: -webkit-flex;
302 | display: -ms-flexbox;
303 | display: flex;
304 | -webkit-align-items: center;
305 | -webkit-box-align: center;
306 | -ms-flex-align: center;
307 | align-items: center;
308 | -webkit-text-decoration: none;
309 | text-decoration: none;
310 | color: inherit;
311 | }
312 |
313 | .c8 > img {
314 | height: 3rem;
315 | }
316 |
317 | .c9 {
318 | display: -webkit-box;
319 | display: -webkit-flex;
320 | display: -ms-flexbox;
321 | display: flex;
322 | -webkit-flex-flow: row wrap;
323 | -ms-flex-flow: row wrap;
324 | flex-flow: row wrap;
325 | }
326 |
327 | .c10 {
328 | display: block;
329 | -webkit-text-decoration: none;
330 | text-decoration: none;
331 | font-size: 1.6rem;
332 | padding: 1.6rem;
333 | color: #0A1128;
334 | position: relative;
335 | }
336 |
337 | .c10::after {
338 | content: '';
339 | position: absolute;
340 | bottom: 0.76rem;
341 | left: 50%;
342 | width: 0;
343 | height: 0.2rem;
344 | background: #dc143c;
345 | -webkit-transition: all 300ms ease-in-out;
346 | transition: all 300ms ease-in-out;
347 | }
348 |
349 | .c10:hover::after {
350 | left: 25%;
351 | width: 50%;
352 | }
353 |
354 | .c1 {
355 | display: inline-block;
356 | vertical-align: middle;
357 | overflow: hidden;
358 | }
359 |
360 | @media (max-width:768px) {
361 | .c2 {
362 | height: 100vh;
363 | visibility: hidden;
364 | opacity: 0;
365 | }
366 |
367 | .c2 > .c3 {
368 | display: grid;
369 | grid-template-columns: 1fr;
370 | grid-template-rows: 1fr;
371 | height: 100vh;
372 | -webkit-align-items: center;
373 | -webkit-box-align: center;
374 | -ms-flex-align: center;
375 | align-items: center;
376 | overflow-y: auto;
377 | }
378 |
379 | .c2 .c6 {
380 | padding-bottom: 3.2rem;
381 | display: -webkit-box;
382 | display: -webkit-flex;
383 | display: -ms-flexbox;
384 | display: flex;
385 | -webkit-box-pack: center;
386 | -webkit-justify-content: center;
387 | -ms-flex-pack: center;
388 | justify-content: center;
389 | }
390 | }
391 |
392 | @media (max-width:768px) {
393 | .c5 {
394 | display: block;
395 | text-align: center;
396 | padding: 4.8rem 0;
397 | }
398 | }
399 |
400 | @media (max-width:768px) {
401 | .c0 {
402 | display: -webkit-box;
403 | display: -webkit-flex;
404 | display: -ms-flexbox;
405 | display: flex;
406 | -webkit-align-items: center;
407 | -webkit-box-align: center;
408 | -ms-flex-align: center;
409 | align-items: center;
410 | -webkit-box-pack: center;
411 | -webkit-justify-content: center;
412 | -ms-flex-pack: center;
413 | justify-content: center;
414 | }
415 | }
416 |
417 | @media (max-width:768px) {
418 | .c9 {
419 | -webkit-flex-flow: column wrap;
420 | -ms-flex-flow: column wrap;
421 | flex-flow: column wrap;
422 | -webkit-align-content: center;
423 | -ms-flex-line-pack: center;
424 | align-content: center;
425 | }
426 | }
427 |
428 |
429 |
433 |
442 |
446 |
449 |
450 |
451 |
548 |
549 | `;
550 |
--------------------------------------------------------------------------------
/src/api/dados.json:
--------------------------------------------------------------------------------
1 | [
2 | {
3 | "_id": "602fdf2d540c00269e056171",
4 | "published_at": "2021-02-19T15:54:33.499Z",
5 | "footer_text": "Feito com ❤ por Otávio Miranda
",
6 | "slug": "landing-page",
7 | "title": "Landing Page",
8 | "sections": [
9 | {
10 | "__component": "section.section-two-columns",
11 | "_id": "602fdf2d540c00269e056172",
12 | "title": "January brings us Firefox 85",
13 | "description": "To wrap up January, we are proud to bring you the release of Firefox 85. In this version we are bringing you support for the :focus-visible pseudo-class in CSS and associated devtools, and the complete removal of Flash support from Firefox.",
14 | "metadata": {
15 | "background": true,
16 | "_id": "602fdf2d540c00269e05617f",
17 | "section_id": "home",
18 | "name": "Home",
19 | "__v": 0,
20 | "id": "602fdf2d540c00269e05617f"
21 | },
22 | "__v": 1,
23 | "image": {
24 | "_id": "602fdc2b540c00269e05616a",
25 | "name": "javascript.svg",
26 | "alternativeText": "Desenho de pessoas segurando logos do CSS, JS e HTML",
27 | "caption": "Desenho de pessoas segurando logos do CSS, JS e HTML",
28 | "hash": "javascript_b57bf48cda",
29 | "ext": ".svg",
30 | "mime": "image/svg+xml",
31 | "size": 30.31,
32 | "url": "https://res.cloudinary.com/dlizakp2a/image/upload/v1613749289/javascript_b57bf48cda.svg",
33 | "provider_metadata": {
34 | "public_id": "javascript_b57bf48cda",
35 | "resource_type": "image"
36 | },
37 | "provider": "cloudinary",
38 | "width": 1030,
39 | "height": 730,
40 | "related": [
41 | "602fdf2d540c00269e056178",
42 | "602fdf2d540c00269e056172"
43 | ],
44 | "createdAt": "2021-02-19T15:41:31.808Z",
45 | "updatedAt": "2021-02-19T15:54:22.590Z",
46 | "__v": 0,
47 | "id": "602fdc2b540c00269e05616a"
48 | },
49 | "id": "602fdf2d540c00269e056172"
50 | },
51 | {
52 | "__component": "section.section-content",
53 | "_id": "602fdf2d540c00269e056173",
54 | "title": "news coverage and some surprises",
55 | "content": "The release of Apple Silicon-based Macs at the end of last year generated a flurry of news coverage and some surprises at the machine’s performance. This post details some background information on the experience of porting Firefox to run natively on these CPUs.
We’ll start with some background on the Mac transition and give an overview of Firefox internals that needed to know about the new architecture, before moving on to the concept of Universal Binaries.
We’ll then explain how DRM/EME works on the new platform, talk about our experience with macOS Big Sur, and discuss various updater problems we had to deal with. We’ll conclude with the release and an overview of various other improvements that are in the pipeline.
",
56 | "metadata": {
57 | "background": false,
58 | "_id": "602fdf2d540c00269e05617a",
59 | "name": "intro",
60 | "section_id": "intro",
61 | "__v": 0,
62 | "id": "602fdf2d540c00269e05617a"
63 | },
64 | "__v": 1,
65 | "id": "602fdf2d540c00269e056173"
66 | },
67 | {
68 | "__component": "section.section-grid",
69 | "_id": "602fdf2d540c00269e056174",
70 | "description": "Debitis cum delectus molestias. Atque doloribus nobis laudantium esse ut",
71 | "title": "My Grid",
72 | "text_grid": [
73 | {
74 | "_id": "602fdf2d540c00269e05617c",
75 | "title": "Teste 1",
76 | "description": "Lorem ipsum dolor sit, amet consectetur adipisicing elit. Debitis cum delectus molestias. Atque doloribus nobis laudantium esse ut, non commodi maxime distinctio veritatis unde, reprehenderit minus ad dolores provident maiores.",
77 | "__v": 0,
78 | "id": "602fdf2d540c00269e05617c"
79 | },
80 | {
81 | "_id": "602fdf2d540c00269e05617d",
82 | "title": "Teste 2",
83 | "description": "Lorem ipsum dolor sit, amet consectetur adipisicing elit. Debitis cum delectus molestias. Atque doloribus nobis laudantium esse ut, non commodi maxime distinctio veritatis unde, reprehenderit minus ad dolores provident maiores.",
84 | "__v": 0,
85 | "id": "602fdf2d540c00269e05617d"
86 | },
87 | {
88 | "_id": "602fdf2d540c00269e05617e",
89 | "title": "Teste 3",
90 | "description": "Lorem ipsum dolor sit, amet consectetur adipisicing elit. Debitis cum delectus molestias. Atque doloribus nobis laudantium esse ut, non commodi maxime distinctio veritatis unde, reprehenderit minus ad dolores provident maiores.",
91 | "__v": 0,
92 | "id": "602fdf2d540c00269e05617e"
93 | }
94 | ],
95 | "image_grid": [],
96 | "metadata": {
97 | "background": true,
98 | "_id": "602fdf2e540c00269e056199",
99 | "name": "grid-one",
100 | "section_id": "grid-one",
101 | "__v": 0,
102 | "id": "602fdf2e540c00269e056199"
103 | },
104 | "__v": 2,
105 | "id": "602fdf2d540c00269e056174"
106 | },
107 | {
108 | "__component": "section.section-grid",
109 | "_id": "602fdf2d540c00269e056175",
110 | "description": "Distinctio veritatis unde, reprehenderit minus ad dolores provident maiores.",
111 | "title": "Gallery",
112 | "text_grid": [],
113 | "image_grid": [
114 | {
115 | "_id": "602fdf2d540c00269e056183",
116 | "__v": 0,
117 | "image": {
118 | "_id": "602fde37540c00269e05616b",
119 | "name": "http://source.unsplash.com/random/360x360?r=1",
120 | "alternativeText": "Uma paisagem com céu claro e montanhas bonitas",
121 | "caption": "",
122 | "hash": "360x360_r_1_6a2049d13a",
123 | "ext": "",
124 | "mime": "image/jpeg",
125 | "size": 29.09,
126 | "width": 360,
127 | "height": 360,
128 | "url": "https://res.cloudinary.com/dlizakp2a/image/upload/v1613749814/360x360_r_1_6a2049d13a.jpg",
129 | "provider_metadata": {
130 | "public_id": "360x360_r_1_6a2049d13a",
131 | "resource_type": "image"
132 | },
133 | "formats": {
134 | "thumbnail": {
135 | "name": "thumbnail_http://source.unsplash.com/random/360x360?r=1",
136 | "hash": "thumbnail_360x360_r_1_6a2049d13a",
137 | "ext": "",
138 | "mime": "image/jpeg",
139 | "width": 156,
140 | "height": 156,
141 | "size": 6.48,
142 | "path": null,
143 | "url": "https://res.cloudinary.com/dlizakp2a/image/upload/v1613749815/thumbnail_360x360_r_1_6a2049d13a.jpg",
144 | "provider_metadata": {
145 | "public_id": "thumbnail_360x360_r_1_6a2049d13a",
146 | "resource_type": "image"
147 | }
148 | }
149 | },
150 | "provider": "cloudinary",
151 | "related": [
152 | "602fdf2d540c00269e056183"
153 | ],
154 | "createdAt": "2021-02-19T15:50:15.686Z",
155 | "updatedAt": "2021-02-19T15:54:21.862Z",
156 | "__v": 0,
157 | "id": "602fde37540c00269e05616b"
158 | },
159 | "id": "602fdf2d540c00269e056183"
160 | },
161 | {
162 | "_id": "602fdf2d540c00269e056184",
163 | "__v": 0,
164 | "image": {
165 | "_id": "602fde37540c00269e05616c",
166 | "name": "http://source.unsplash.com/random/360x360?r=1",
167 | "alternativeText": "Um livro grande aberto",
168 | "caption": "",
169 | "hash": "360x360_r_1_c073b11d09",
170 | "ext": "",
171 | "mime": "image/jpeg",
172 | "size": 29.39,
173 | "width": 360,
174 | "height": 360,
175 | "url": "https://res.cloudinary.com/dlizakp2a/image/upload/v1613749814/360x360_r_1_c073b11d09.jpg",
176 | "provider_metadata": {
177 | "public_id": "360x360_r_1_c073b11d09",
178 | "resource_type": "image"
179 | },
180 | "formats": {
181 | "thumbnail": {
182 | "name": "thumbnail_http://source.unsplash.com/random/360x360?r=1",
183 | "hash": "thumbnail_360x360_r_1_c073b11d09",
184 | "ext": "",
185 | "mime": "image/jpeg",
186 | "width": 156,
187 | "height": 156,
188 | "size": 5.52,
189 | "path": null,
190 | "url": "https://res.cloudinary.com/dlizakp2a/image/upload/v1613749815/thumbnail_360x360_r_1_c073b11d09.jpg",
191 | "provider_metadata": {
192 | "public_id": "thumbnail_360x360_r_1_c073b11d09",
193 | "resource_type": "image"
194 | }
195 | }
196 | },
197 | "provider": "cloudinary",
198 | "related": [
199 | "602fdf2d540c00269e056184"
200 | ],
201 | "createdAt": "2021-02-19T15:50:15.760Z",
202 | "updatedAt": "2021-02-19T15:54:21.980Z",
203 | "__v": 0,
204 | "id": "602fde37540c00269e05616c"
205 | },
206 | "id": "602fdf2d540c00269e056184"
207 | },
208 | {
209 | "_id": "602fdf2d540c00269e056185",
210 | "__v": 0,
211 | "image": {
212 | "_id": "602fde37540c00269e05616d",
213 | "name": "http://source.unsplash.com/random/360x360?r=2",
214 | "alternativeText": "Imagem do topo de uma cidade grande",
215 | "caption": "Imagem do topo de uma cidade grande",
216 | "hash": "360x360_r_2_38651a645b",
217 | "ext": "",
218 | "mime": "image/jpeg",
219 | "size": 35.98,
220 | "width": 360,
221 | "height": 360,
222 | "url": "https://res.cloudinary.com/dlizakp2a/image/upload/v1613749814/360x360_r_2_38651a645b.jpg",
223 | "provider_metadata": {
224 | "public_id": "360x360_r_2_38651a645b",
225 | "resource_type": "image"
226 | },
227 | "formats": {
228 | "thumbnail": {
229 | "name": "thumbnail_http://source.unsplash.com/random/360x360?r=2",
230 | "hash": "thumbnail_360x360_r_2_38651a645b",
231 | "ext": "",
232 | "mime": "image/jpeg",
233 | "width": 156,
234 | "height": 156,
235 | "size": 7.97,
236 | "path": null,
237 | "url": "https://res.cloudinary.com/dlizakp2a/image/upload/v1613749815/thumbnail_360x360_r_2_38651a645b.jpg",
238 | "provider_metadata": {
239 | "public_id": "thumbnail_360x360_r_2_38651a645b",
240 | "resource_type": "image"
241 | }
242 | }
243 | },
244 | "provider": "cloudinary",
245 | "related": [
246 | "602fdf2d540c00269e056185"
247 | ],
248 | "createdAt": "2021-02-19T15:50:15.821Z",
249 | "updatedAt": "2021-02-19T15:54:21.968Z",
250 | "__v": 0,
251 | "id": "602fde37540c00269e05616d"
252 | },
253 | "id": "602fdf2d540c00269e056185"
254 | },
255 | {
256 | "_id": "602fdf2d540c00269e056186",
257 | "__v": 0,
258 | "image": {
259 | "_id": "602fde37540c00269e05616e",
260 | "name": "http://source.unsplash.com/random/360x360?r=1",
261 | "alternativeText": "Filme para câmeras antigas",
262 | "caption": "",
263 | "hash": "360x360_r_1_9d32ada1f9",
264 | "ext": "",
265 | "mime": "image/jpeg",
266 | "size": 12.56,
267 | "width": 360,
268 | "height": 360,
269 | "url": "https://res.cloudinary.com/dlizakp2a/image/upload/v1613749814/360x360_r_1_9d32ada1f9.jpg",
270 | "provider_metadata": {
271 | "public_id": "360x360_r_1_9d32ada1f9",
272 | "resource_type": "image"
273 | },
274 | "formats": {
275 | "thumbnail": {
276 | "name": "thumbnail_http://source.unsplash.com/random/360x360?r=1",
277 | "hash": "thumbnail_360x360_r_1_9d32ada1f9",
278 | "ext": "",
279 | "mime": "image/jpeg",
280 | "width": 156,
281 | "height": 156,
282 | "size": 3.5,
283 | "path": null,
284 | "url": "https://res.cloudinary.com/dlizakp2a/image/upload/v1613749815/thumbnail_360x360_r_1_9d32ada1f9.jpg",
285 | "provider_metadata": {
286 | "public_id": "thumbnail_360x360_r_1_9d32ada1f9",
287 | "resource_type": "image"
288 | }
289 | }
290 | },
291 | "provider": "cloudinary",
292 | "related": [
293 | "602fdf2d540c00269e056186"
294 | ],
295 | "createdAt": "2021-02-19T15:50:15.861Z",
296 | "updatedAt": "2021-02-19T15:54:21.887Z",
297 | "__v": 0,
298 | "id": "602fde37540c00269e05616e"
299 | },
300 | "id": "602fdf2d540c00269e056186"
301 | },
302 | {
303 | "_id": "602fdf2d540c00269e056187",
304 | "__v": 0,
305 | "image": {
306 | "_id": "602fde37540c00269e056170",
307 | "name": "http://source.unsplash.com/random/360x360?r=a1",
308 | "alternativeText": "Tela de notebook com Webull",
309 | "caption": "Tela de notebook com Webull",
310 | "hash": "360x360_r_a1_973b2a68c9",
311 | "ext": "",
312 | "mime": "image/jpeg",
313 | "size": 12.64,
314 | "width": 360,
315 | "height": 360,
316 | "url": "https://res.cloudinary.com/dlizakp2a/image/upload/v1613749814/360x360_r_a1_973b2a68c9.jpg",
317 | "provider_metadata": {
318 | "public_id": "360x360_r_a1_973b2a68c9",
319 | "resource_type": "image"
320 | },
321 | "formats": {
322 | "thumbnail": {
323 | "name": "thumbnail_http://source.unsplash.com/random/360x360?r=a1",
324 | "hash": "thumbnail_360x360_r_a1_973b2a68c9",
325 | "ext": "",
326 | "mime": "image/jpeg",
327 | "width": 156,
328 | "height": 156,
329 | "size": 3.9,
330 | "path": null,
331 | "url": "https://res.cloudinary.com/dlizakp2a/image/upload/v1613749815/thumbnail_360x360_r_a1_973b2a68c9.jpg",
332 | "provider_metadata": {
333 | "public_id": "thumbnail_360x360_r_a1_973b2a68c9",
334 | "resource_type": "image"
335 | }
336 | }
337 | },
338 | "provider": "cloudinary",
339 | "related": [
340 | "602fdf2d540c00269e056187"
341 | ],
342 | "createdAt": "2021-02-19T15:50:15.979Z",
343 | "updatedAt": "2021-02-19T15:54:21.992Z",
344 | "__v": 0,
345 | "id": "602fde37540c00269e056170"
346 | },
347 | "id": "602fdf2d540c00269e056187"
348 | },
349 | {
350 | "_id": "602fdf2d540c00269e056188",
351 | "__v": 0,
352 | "image": {
353 | "_id": "602fde37540c00269e05616f",
354 | "name": "http://source.unsplash.com/random/360x360?r=1",
355 | "alternativeText": "Filme Kodak para câmeras antigas",
356 | "caption": "",
357 | "hash": "360x360_r_1_b3fcbf1d93",
358 | "ext": "",
359 | "mime": "image/jpeg",
360 | "size": 12.24,
361 | "width": 360,
362 | "height": 360,
363 | "url": "https://res.cloudinary.com/dlizakp2a/image/upload/v1613749814/360x360_r_1_b3fcbf1d93.jpg",
364 | "provider_metadata": {
365 | "public_id": "360x360_r_1_b3fcbf1d93",
366 | "resource_type": "image"
367 | },
368 | "formats": {
369 | "thumbnail": {
370 | "name": "thumbnail_http://source.unsplash.com/random/360x360?r=1",
371 | "hash": "thumbnail_360x360_r_1_b3fcbf1d93",
372 | "ext": "",
373 | "mime": "image/jpeg",
374 | "width": 156,
375 | "height": 156,
376 | "size": 3.77,
377 | "path": null,
378 | "url": "https://res.cloudinary.com/dlizakp2a/image/upload/v1613749815/thumbnail_360x360_r_1_b3fcbf1d93.jpg",
379 | "provider_metadata": {
380 | "public_id": "thumbnail_360x360_r_1_b3fcbf1d93",
381 | "resource_type": "image"
382 | }
383 | }
384 | },
385 | "provider": "cloudinary",
386 | "related": [
387 | "602fdf2d540c00269e056188"
388 | ],
389 | "createdAt": "2021-02-19T15:50:15.975Z",
390 | "updatedAt": "2021-02-19T15:54:21.989Z",
391 | "__v": 0,
392 | "id": "602fde37540c00269e05616f"
393 | },
394 | "id": "602fdf2d540c00269e056188"
395 | }
396 | ],
397 | "metadata": {
398 | "background": false,
399 | "_id": "602fdf2e540c00269e0561a4",
400 | "name": "gallery",
401 | "section_id": "gallery",
402 | "__v": 0,
403 | "id": "602fdf2e540c00269e0561a4"
404 | },
405 | "__v": 2,
406 | "id": "602fdf2d540c00269e056175"
407 | },
408 | {
409 | "__component": "section.section-grid",
410 | "_id": "602fdf2d540c00269e056176",
411 | "description": " Atque doloribus nobis laudantium esse ut, non commodi maxime distinctio",
412 | "title": "Outra grid",
413 | "text_grid": [
414 | {
415 | "_id": "602fdf2d540c00269e056180",
416 | "title": "Teste 1",
417 | "description": "Lorem ipsum dolor sit, amet consectetur adipisicing elit. Debitis cum delectus molestias. Atque doloribus nobis laudantium esse ut, non commodi maxime distinctio veritatis unde, reprehenderit minus ad dolores provident maiores.",
418 | "__v": 0,
419 | "id": "602fdf2d540c00269e056180"
420 | },
421 | {
422 | "_id": "602fdf2d540c00269e056181",
423 | "title": "Teste 2",
424 | "description": "Lorem ipsum dolor sit, amet consectetur adipisicing elit. Debitis cum delectus molestias. Atque doloribus nobis laudantium esse ut, non commodi maxime distinctio veritatis unde, reprehenderit minus ad dolores provident maiores.",
425 | "__v": 0,
426 | "id": "602fdf2d540c00269e056181"
427 | },
428 | {
429 | "_id": "602fdf2d540c00269e056182",
430 | "title": "Teste 3",
431 | "description": "Lorem ipsum dolor sit, amet consectetur adipisicing elit. Debitis cum delectus molestias. Atque doloribus nobis laudantium esse ut, non commodi maxime distinctio veritatis unde, reprehenderit minus ad dolores provident maiores.",
432 | "__v": 0,
433 | "id": "602fdf2d540c00269e056182"
434 | }
435 | ],
436 | "image_grid": [],
437 | "metadata": {
438 | "background": true,
439 | "_id": "602fdf2e540c00269e05619a",
440 | "name": "grid-two",
441 | "section_id": "grid-two",
442 | "__v": 0,
443 | "id": "602fdf2e540c00269e05619a"
444 | },
445 | "__v": 2,
446 | "id": "602fdf2d540c00269e056176"
447 | },
448 | {
449 | "__component": "section.section-content",
450 | "_id": "602fdf2d540c00269e056177",
451 | "title": "Pricing",
452 | "content": "The release of Apple Silicon-based Macs at the end of last year generated a flurry of news coverage and some surprises at the machine’s performance. This post details some background information on the experience of porting Firefox to run natively on these CPUs.
We’ll start with some background on the Mac transition and give an overview of Firefox internals that needed to know about the new architecture, before moving on to the concept of Universal Binaries.
Title 1 Title 2 Title 3 Title 4 Title 5 Content 1 Content 2 Content 3 Content 3 Content 3 Content 1 Content 2 Content 3 Content 3 Content 3 Content 1 Content 2 Content 3 Content 3 Content 3 Testando
",
453 | "metadata": {
454 | "background": false,
455 | "_id": "602fdf2d540c00269e056179",
456 | "name": "pricing",
457 | "section_id": "pricing",
458 | "__v": 0,
459 | "id": "602fdf2d540c00269e056179"
460 | },
461 | "__v": 1,
462 | "id": "602fdf2d540c00269e056177"
463 | },
464 | {
465 | "__component": "section.section-two-columns",
466 | "_id": "602fdf2d540c00269e056178",
467 | "title": "January brings us Firefox 85",
468 | "description": "To wrap up January, we are proud to bring you the release of Firefox 85. In this version we are bringing you support for the :focus-visible pseudo-class in CSS and associated devtools, and the complete removal of Flash support from Firefox.",
469 | "metadata": {
470 | "background": true,
471 | "_id": "602fdf2d540c00269e05617b",
472 | "name": "contact",
473 | "section_id": "contact",
474 | "__v": 0,
475 | "id": "602fdf2d540c00269e05617b"
476 | },
477 | "__v": 1,
478 | "image": {
479 | "_id": "602fdc2b540c00269e05616a",
480 | "name": "javascript.svg",
481 | "alternativeText": "Desenho de pessoas segurando logos do CSS, JS e HTML",
482 | "caption": "Desenho de pessoas segurando logos do CSS, JS e HTML",
483 | "hash": "javascript_b57bf48cda",
484 | "ext": ".svg",
485 | "mime": "image/svg+xml",
486 | "size": 30.31,
487 | "url": "https://res.cloudinary.com/dlizakp2a/image/upload/v1613749289/javascript_b57bf48cda.svg",
488 | "provider_metadata": {
489 | "public_id": "javascript_b57bf48cda",
490 | "resource_type": "image"
491 | },
492 | "provider": "cloudinary",
493 | "width": 1030,
494 | "height": 730,
495 | "related": [
496 | "602fdf2d540c00269e056178",
497 | "602fdf2d540c00269e056172"
498 | ],
499 | "createdAt": "2021-02-19T15:41:31.808Z",
500 | "updatedAt": "2021-02-19T15:54:22.590Z",
501 | "__v": 0,
502 | "id": "602fdc2b540c00269e05616a"
503 | },
504 | "id": "602fdf2d540c00269e056178"
505 | }
506 | ],
507 | "menu": {
508 | "open_in_new_tab": false,
509 | "_id": "602fdf30540c00269e0561ae",
510 | "logo_text": "Landing Page",
511 | "logo_link": "#home",
512 | "menu": [
513 | {
514 | "open_in_new_tab": false,
515 | "_id": "602fdf30540c00269e0561af",
516 | "link_text": "intro",
517 | "url": "#intro",
518 | "__v": 0,
519 | "id": "602fdf30540c00269e0561af"
520 | },
521 | {
522 | "open_in_new_tab": false,
523 | "_id": "602fdf30540c00269e0561b0",
524 | "link_text": "grid-one",
525 | "url": "#grid-one",
526 | "__v": 0,
527 | "id": "602fdf30540c00269e0561b0"
528 | },
529 | {
530 | "open_in_new_tab": false,
531 | "_id": "602fdf30540c00269e0561b1",
532 | "url": "#gallery",
533 | "link_text": "gallery",
534 | "__v": 0,
535 | "id": "602fdf30540c00269e0561b1"
536 | },
537 | {
538 | "open_in_new_tab": false,
539 | "_id": "602fdf30540c00269e0561b2",
540 | "link_text": "grid-two",
541 | "url": "#grid-two",
542 | "__v": 0,
543 | "id": "602fdf30540c00269e0561b2"
544 | },
545 | {
546 | "open_in_new_tab": false,
547 | "_id": "602fdf30540c00269e0561b3",
548 | "link_text": "pricing",
549 | "url": "#pricing",
550 | "__v": 0,
551 | "id": "602fdf30540c00269e0561b3"
552 | },
553 | {
554 | "open_in_new_tab": false,
555 | "_id": "602fdf30540c00269e0561b4",
556 | "link_text": "contact",
557 | "url": "#contact",
558 | "__v": 0,
559 | "id": "602fdf30540c00269e0561b4"
560 | }
561 | ],
562 | "__v": 1,
563 | "logo": {
564 | "_id": "602fda0abba83e6e2dd2ebfd",
565 | "name": "landing-page-2.svg",
566 | "alternativeText": "Landing Page Logo",
567 | "caption": "Landing Page Logo",
568 | "hash": "landing_page_2_f7da938739",
569 | "ext": ".svg",
570 | "mime": "image/svg+xml",
571 | "size": 2.51,
572 | "url": "https://res.cloudinary.com/dlizakp2a/image/upload/v1613748744/landing_page_2_f7da938739.svg",
573 | "provider_metadata": {
574 | "public_id": "landing_page_2_f7da938739",
575 | "resource_type": "image"
576 | },
577 | "provider": "cloudinary",
578 | "width": 47,
579 | "height": 9,
580 | "related": [
581 | "602fdf30540c00269e0561ae"
582 | ],
583 | "createdAt": "2021-02-19T15:32:26.947Z",
584 | "updatedAt": "2021-02-19T15:54:25.379Z",
585 | "__v": 0,
586 | "id": "602fda0abba83e6e2dd2ebfd"
587 | },
588 | "id": "602fdf30540c00269e0561ae"
589 | },
590 | "createdAt": "2021-02-19T15:54:21.125Z",
591 | "updatedAt": "2021-02-19T15:54:34.769Z",
592 | "__v": 2,
593 | "id": "602fdf2d540c00269e056171"
594 | }
595 | ]
596 |
--------------------------------------------------------------------------------
/public/assets/images/javascript.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------