diff --git a/.babelrc b/.babelrc new file mode 100644 index 0000000..b77a25d --- /dev/null +++ b/.babelrc @@ -0,0 +1,25 @@ +{ + "presets": ["next/babel", "@babel/preset-typescript"], + "plugins": [ + [ + "babel-plugin-styled-components", + { + "ssr": true, + "displayName": true + } + ] + ], + "env": { + "test": { + "plugins": [ + [ + "babel-plugin-styled-components", + { + "ssr": false, + "displayName": false + } + ] + ] + } + } +} diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..5d47c21 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,12 @@ +# EditorConfig is awesome: https://EditorConfig.org + +# top-most EditorConfig file +root = true + +[*] +indent_style = space +indent_size = 2 +end_of_line = lf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true diff --git a/.env.example b/.env.example new file mode 100644 index 0000000..c32957c --- /dev/null +++ b/.env.example @@ -0,0 +1 @@ +NEXT_PUBLIC_DEVCHALLENGE_API=http://localhost:3333 diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 0000000..97b7210 --- /dev/null +++ b/.eslintignore @@ -0,0 +1,2 @@ +!.storybook +!.jest diff --git a/.eslintrc.json b/.eslintrc.json new file mode 100644 index 0000000..9a2face --- /dev/null +++ b/.eslintrc.json @@ -0,0 +1,35 @@ +{ + "env": { + "browser": true, + "es2021": true, + "jest": true, + "node": true + }, + "settings": { + "react": { + "version": "detect" + } + }, + "extends": [ + "eslint:recommended", + "plugin:react/recommended", + "plugin:@typescript-eslint/recommended", + "plugin:prettier/recommended" + ], + "parser": "@typescript-eslint/parser", + "parserOptions": { + "ecmaFeatures": { + "jsx": true + }, + "ecmaVersion": 12, + "sourceType": "module" + }, + "plugins": ["react", "@typescript-eslint", "react-hooks"], + "rules": { + "react-hooks/rules-of-hooks": "error", + "react-hooks/exhaustive-deps": "warn", + "react/prop-types": "off", + "react/react-in-jsx-scope": "off", + "@typescript-eslint/explicit-module-boundary-types": "off" + } +} diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..c0c0da4 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,36 @@ +name: ci +on: [pull_request] + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout Repository + uses: actions/checkout@v2 + + - name: Setup Node + uses: actions/setup-node@v1 + with: + node-version: 14.x + + - uses: actions/cache@v2 + id: yarn-cache + with: + path: | + ~/cache + !~/cache/exclude + **/node_modules + key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} + restore-keys: | + ${{ runner.os }}-yarn- + - name: Install dependencies + run: yarn install + + - name: Linting + run: yarn lint + + - name: Test + run: yarn test + + - name: Build + run: yarn build diff --git a/frontend/.gitignore b/.gitignore similarity index 67% rename from frontend/.gitignore rename to .gitignore index e40d1f1..3ddeb42 100644 --- a/frontend/.gitignore +++ b/.gitignore @@ -8,16 +8,34 @@ # testing /coverage +# next.js +/.next/ +/out/ + # production /build # misc .DS_Store +*.pem + +# debug +npm-debug.log* +yarn-debug.log* +yarn-error.log* + +# local env files .env.local .env.development.local .env.test.local .env.production.local -npm-debug.log* -yarn-debug.log* -yarn-error.log* -.vscode + +# vercel +.vercel + +# sw stuff +public/sw.js +public/workbox-*.js + +# storybook +storybook-static diff --git a/.husky/.gitignore b/.husky/.gitignore new file mode 100644 index 0000000..c9cdc63 --- /dev/null +++ b/.husky/.gitignore @@ -0,0 +1 @@ +_ \ No newline at end of file diff --git a/.husky/pre-commit b/.husky/pre-commit new file mode 100755 index 0000000..86b0c4a --- /dev/null +++ b/.husky/pre-commit @@ -0,0 +1,5 @@ +#!/bin/sh +. "$(dirname "$0")/_/husky.sh" + +npx --no-install lint-staged +yarn lint-staged diff --git a/.jest/setup.ts b/.jest/setup.ts new file mode 100644 index 0000000..c488bdd --- /dev/null +++ b/.jest/setup.ts @@ -0,0 +1,2 @@ +import '@testing-library/jest-dom'; +import 'jest-styled-components'; diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 0000000..97b7210 --- /dev/null +++ b/.prettierignore @@ -0,0 +1,2 @@ +!.storybook +!.jest diff --git a/.prettierrc b/.prettierrc new file mode 100644 index 0000000..0dbf448 --- /dev/null +++ b/.prettierrc @@ -0,0 +1,5 @@ +{ + "trailingComma": "es5", + "semi": true, + "singleQuote": true +} diff --git a/.storybook/main.js b/.storybook/main.js new file mode 100644 index 0000000..ac0711b --- /dev/null +++ b/.storybook/main.js @@ -0,0 +1,7 @@ +module.exports = { + stories: [ + '../src/**/*.stories.mdx', + '../src/components/**/stories.@(js|jsx|ts|tsx)', + ], + addons: ['@storybook/addon-essentials'], +}; diff --git a/.storybook/preview.js b/.storybook/preview.js new file mode 100644 index 0000000..52d135b --- /dev/null +++ b/.storybook/preview.js @@ -0,0 +1,10 @@ +import GlobalStyles from '../src/styles/global'; + +export const decorators = [ + (Story) => ( + <> + + + + ), +]; diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..ae563b1 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,6 @@ +{ + "editor.formatOnSave": false, + "editor.codeActionsOnSave": { + "source.fixAll.eslint": true, + } +} diff --git a/frontend/.editorconfig b/frontend/.editorconfig deleted file mode 100644 index f9366fa..0000000 --- a/frontend/.editorconfig +++ /dev/null @@ -1,8 +0,0 @@ -root = true - -[*] -indent_style = space -indent_size = 4 -charset = utf-8 -trim_trailing_whitespace = true -insert_final_newline = true diff --git a/frontend/.env b/frontend/.env deleted file mode 100644 index 506dc23..0000000 --- a/frontend/.env +++ /dev/null @@ -1 +0,0 @@ -REACT_APP_API_URL=http://localhost:3333 \ No newline at end of file diff --git a/frontend/.eslintrc.js b/frontend/.eslintrc.js deleted file mode 100644 index 91bba3f..0000000 --- a/frontend/.eslintrc.js +++ /dev/null @@ -1,38 +0,0 @@ -module.exports = { - env: { - es6: true, - }, - extends: ['airbnb', 'prettier', 'prettier/react'], - globals: { - Atomics: 'readonly', - SharedArrayBuffer: 'readonly', - __DEV__: 'readonly', - }, - parser: 'babel-eslint', - parserOptions: { - ecmaFeatures: { - jsx: true, - }, - ecmaVersion: 2018, - sourceType: 'module', - }, - plugins: ['react', 'prettier'], - rules: { - 'prettier/prettier': 'error', - 'react/jsx-filename-extension': [ - 'warn', - { - extensions: ['.jsx', '.js'], - }, - ], - 'import/prefer-default-export': 'off', - 'react/state-in-constructor': 'off', - 'react/static-property-placement': 'off', - 'react/jsx-props-no-spreading': 'off', - 'react/prop-types': 'off', - 'no-param-reassign': 'off', - 'no-console': 'off', - 'no-undef': 'off', - 'no-alert': 'off', - }, -}; diff --git a/frontend/.prettierrc b/frontend/.prettierrc deleted file mode 100644 index c1a6f66..0000000 --- a/frontend/.prettierrc +++ /dev/null @@ -1,4 +0,0 @@ -{ - "singleQuote": true, - "trailingComma": "es5" -} diff --git a/frontend/Teste.log b/frontend/Teste.log deleted file mode 100644 index a87a691..0000000 --- a/frontend/Teste.log +++ /dev/null @@ -1 +0,0 @@ -Testando PR na branch \ No newline at end of file diff --git a/frontend/__tests__/__utils__/file-mock.js b/frontend/__tests__/__utils__/file-mock.js deleted file mode 100644 index 602eb23..0000000 --- a/frontend/__tests__/__utils__/file-mock.js +++ /dev/null @@ -1 +0,0 @@ -export default 'test-file-stub'; diff --git a/frontend/__tests__/__utils__/mock-api.js b/frontend/__tests__/__utils__/mock-api.js deleted file mode 100644 index 24530a2..0000000 --- a/frontend/__tests__/__utils__/mock-api.js +++ /dev/null @@ -1,6 +0,0 @@ -import MockAdapter from 'axios-mock-adapter'; -import api from '../../src/services/api'; - -export function mockApi() { - return new MockAdapter(api); -} diff --git a/frontend/__tests__/__utils__/rtl.js b/frontend/__tests__/__utils__/rtl.js deleted file mode 100644 index 562e23e..0000000 --- a/frontend/__tests__/__utils__/rtl.js +++ /dev/null @@ -1,30 +0,0 @@ -import React from 'react'; -import * as Rtl from '@testing-library/react'; - -export const render = (Component, props, wrapper) => { - const rendered = Rtl.render(, { wrapper }); - - return { - showOutput: rendered.debug, - element: { - withText: rendered.getByText, - withTestId: rendered.getByTestId, - }, - allElements: { - withTestId: rendered.getAllByTestId, - }, - }; -}; - -export const waitForUseEffect = Rtl.wait; - -export const waitForStateUpdate = Rtl.wait; - -export const applySelect = (select) => { - return { - withOption: (option) => - Rtl.fireEvent.change(select, { - target: { value: option }, - }), - }; -}; diff --git a/frontend/__tests__/__utils__/setup-tests.js b/frontend/__tests__/__utils__/setup-tests.js deleted file mode 100644 index b535f6a..0000000 --- a/frontend/__tests__/__utils__/setup-tests.js +++ /dev/null @@ -1 +0,0 @@ -import 'regenerator-runtime/runtime'; diff --git a/frontend/__tests__/pages/Challenges.spec.js b/frontend/__tests__/pages/Challenges.spec.js deleted file mode 100644 index 4c75675..0000000 --- a/frontend/__tests__/pages/Challenges.spec.js +++ /dev/null @@ -1,76 +0,0 @@ -import React from 'react'; -import Challenges from '../../src/pages/Challenges'; -import { - applySelect, - render, - waitForStateUpdate, - waitForUseEffect, -} from '../__utils__/rtl'; -import loadChallenges from '../../src/services/loadChallenges'; -import Header from '../../src/components/Header'; -import capitalize from '../../src/utils/capitalize'; -import ChallengeCard from '../../src/components/ChallengeCard'; - -jest.mock('../../src/services/loadChallenges'); -jest.mock('../../src/components/Header'); -jest.mock('../../src/utils/capitalize'); -jest.mock('../../src/components/ChallengeCard'); - -describe(Challenges, () => { - let sut; - const mock = { - challenges: [ - { _id: 1, name: 'ch-1' }, - { _id: 2, name: 'ch-2' }, - ], - filter: { - default: 'All', - type: 'Frontend', - }, - location: { - search: 'type=All', - }, - }; - - beforeEach(async () => { - jest.spyOn(window, 'scrollTo').mockImplementation(jest.fn()); - capitalize.mockImplementation((word) => word); - ChallengeCard.mockImplementation(({ challenge }) => ( -
{challenge.name}
- )); - Header.mockReturnValue(
); - loadChallenges.mockResolvedValue({ - challenges: mock.challenges, - }); - - await waitForUseEffect(() => { - sut = render(Challenges, { location: mock.location }); - }); - }); - - it('should call api with default value if no option selected', async () => { - expect(loadChallenges).toHaveBeenCalledWith({ - typeFilter: mock.filter.default, - }); - }); - - it('should call api with selected value', async () => { - const selector = sut.element.withTestId( - 'challenges__type-select-input' - ); - - await waitForStateUpdate(() => { - applySelect(selector).withOption(mock.filter.type); - }); - - expect(loadChallenges).toHaveBeenCalledWith({ - typeFilter: mock.filter.type, - }); - }); - - it('should render all the challenges', () => { - mock.challenges.forEach((challenge) => { - expect(sut.element.withText(challenge.name)).toBeTruthy(); - }); - }); -}); diff --git a/frontend/__tests__/pages/Details.spec.js b/frontend/__tests__/pages/Details.spec.js deleted file mode 100644 index bb564ac..0000000 --- a/frontend/__tests__/pages/Details.spec.js +++ /dev/null @@ -1,88 +0,0 @@ -import { useParams } from 'react-router-dom'; -import React from 'react'; -import Detail from '../../src/pages/Detail'; -import loadChallengesById from '../../src/services/loadChallengesById'; -import { render, waitForUseEffect } from '../__utils__/rtl'; -import Header from '../../src/components/Header'; - -jest.mock('../../src/services/loadChallengesById'); -jest.mock('../../src/components/Header'); -jest.mock('react-router-dom', () => { - return { - useParams: jest.fn(), - NavLink: ({ children }) => children, - }; -}); - -describe(Detail, () => { - let sut; - const mock = { - id: 'mock-id', - first_challenge: { - brief: 'This is an challenge brief', - description: 'This is an challenge description', - type: 'Backend', - dev_id: 'any-id', - images: ['http://fake-url.com/', 'http://another-fake-url.com/'], - techs: ['Tech1, Tech2, Tech3'], - github_url: 'http://github/challenge/', - }, - }; - - beforeEach(async () => { - jest.spyOn(window, 'scrollTo').mockImplementation(jest.fn()); - Header.mockReturnValue(
); - useParams.mockReturnValue({ id: mock.id }); - loadChallengesById.mockResolvedValue({ - first_challenge: mock.first_challenge, - }); - - await waitForUseEffect(() => { - sut = render(Detail); - }); - }); - - it('should get the data from api', () => { - expect(loadChallengesById).toHaveBeenCalledWith({ id: mock.id }); - }); - - const insideText = (text) => new RegExp(text); - - it('should render the correct techs', () => { - mock.first_challenge.techs.forEach((tech) => { - const splitTech = tech.split(', '); - splitTech.forEach((sTech) => { - expect(sut.element.withText(sTech)).toBeTruthy(); - }); - }); - }); - - it('should render the brief', () => { - const brief = sut.element.withText( - insideText(mock.first_challenge.brief) - ); - expect(brief).toBeTruthy(); - }); - - it('should render the description', () => { - const brief = sut.element.withText( - insideText(mock.first_challenge.description) - ); - expect(brief).toBeTruthy(); - }); - - it('should render the type', () => { - const type = sut.element.withText( - insideText(mock.first_challenge.type) - ); - expect(type).toBeTruthy(); - }); - - it('should render the github_url', () => { - const githubUrl = sut.element.withText('Iniciar desafio'); - expect(githubUrl).toHaveProperty( - 'href', - mock.first_challenge.github_url - ); - }); -}); diff --git a/frontend/__tests__/pages/Devs.spec.js b/frontend/__tests__/pages/Devs.spec.js deleted file mode 100644 index a7b0319..0000000 --- a/frontend/__tests__/pages/Devs.spec.js +++ /dev/null @@ -1,50 +0,0 @@ -import React from 'react'; -import Challenges from '../../src/pages/Devs'; -import { render, waitForUseEffect } from '../__utils__/rtl'; -import loadChallengesDevs from '../../src/services/loadChallengesDevs'; -import Header from '../../src/components/Header'; - -jest.mock('../../src/services/loadChallengesDevs'); -jest.mock('../../src/components/Header'); - -describe(Challenges, () => { - let sut; - let devs; - - const mockDevs = (length) => { - return Array.from({ length }, (_, index) => { - return { - _id: index, - name: `name-${index}`, - position: `position-${index}`, - avatar: `https://avatar-url.com/${index}`, - github: `github@${index}`, - linkedin: `linkedin@${index}`, - }; - }); - }; - - beforeEach(async () => { - devs = mockDevs(3); - - Header.mockReturnValue(
); - loadChallengesDevs.mockResolvedValue({ - devs, - }); - - await waitForUseEffect(() => { - sut = render(Challenges); - }); - }); - - it('should call api on start', () => { - expect(loadChallengesDevs).toHaveBeenCalled(); - }); - - it('should render devs from api', () => { - devs.forEach((dev) => { - expect(sut.element.withText(dev.name)).toBeTruthy(); - expect(sut.element.withText(dev.position)).toBeTruthy(); - }); - }); -}); diff --git a/frontend/__tests__/services/loadChallenges.spec.js b/frontend/__tests__/services/loadChallenges.spec.js deleted file mode 100644 index 70bb81a..0000000 --- a/frontend/__tests__/services/loadChallenges.spec.js +++ /dev/null @@ -1,43 +0,0 @@ -import loadChallenges from '../../src/services/loadChallenges'; -import capitalize from '../../src/utils/capitalize'; -import { mockApi } from '../__utils__/mock-api'; - -jest.mock('../../src/utils/capitalize'); - -describe(loadChallenges, () => { - const mock = { - filter: { undefined, any: 'any-filter' }, - response: { with_no_filters: [], with_filters: [{}, {}] }, - }; - - beforeEach(() => { - const apiMock = mockApi(); - capitalize.mockImplementation((word) => word); - - apiMock.onGet('challenges').reply(200, mock.response.with_no_filters); - - apiMock - .onGet(`challenges/?type=${mock.filter.any}`) - .reply(200, mock.response.with_filters); - }); - - describe('when have no filter', () => { - it('should get all the challenges', async () => { - const { challenges } = await loadChallenges({ - typeFilter: mock.filter.undefined, - }); - expect(capitalize).not.toHaveBeenCalled(); - expect(challenges).toEqual(mock.response.with_no_filters); - }); - }); - - describe('when have filter', () => { - it('should get all the filtered challenges', async () => { - const { challenges } = await loadChallenges({ - typeFilter: mock.filter.any, - }); - expect(capitalize).toHaveBeenCalledWith(mock.filter.any); - expect(challenges).toEqual(mock.response.with_filters); - }); - }); -}); diff --git a/frontend/__tests__/services/loadChallengesById.spec.js b/frontend/__tests__/services/loadChallengesById.spec.js deleted file mode 100644 index b183976..0000000 --- a/frontend/__tests__/services/loadChallengesById.spec.js +++ /dev/null @@ -1,23 +0,0 @@ -import loadChallengesById from '../../src/services/loadChallengesById'; -import { mockApi } from '../__utils__/mock-api'; - -describe(loadChallengesById, () => { - const mock = { - id: 'any-id', - response: { - data: [{ id: 'right-id' }, { id: 'wrong-id' }], - }, - }; - - beforeEach(() => { - mockApi() - .onGet(`/challenges/${mock.id}`) - .reply(200, mock.response.data); - }); - - it('should get the data from api with right id', async () => { - // eslint-disable-next-line camelcase - const { first_challenge } = await loadChallengesById({ id: mock.id }); - expect(first_challenge).toEqual(mock.response.data[0]); - }); -}); diff --git a/frontend/__tests__/services/loadChallengesDevs.spec.js b/frontend/__tests__/services/loadChallengesDevs.spec.js deleted file mode 100644 index c95f0fd..0000000 --- a/frontend/__tests__/services/loadChallengesDevs.spec.js +++ /dev/null @@ -1,15 +0,0 @@ -import loadChallengesDevs from '../../src/services/loadChallengesDevs'; -import { mockApi } from '../__utils__/mock-api'; - -describe(loadChallengesDevs, () => { - const mock = { response: { data: [] } }; - - beforeEach(() => { - mockApi().onGet('devs').reply(200, mock.response.data); - }); - - it('should get the data from api', async () => { - const { devs } = await loadChallengesDevs(); - expect(devs).toEqual(mock.response.data); - }); -}); diff --git a/frontend/__tests__/utils/capitalize.spec.js b/frontend/__tests__/utils/capitalize.spec.js deleted file mode 100644 index 0aa303d..0000000 --- a/frontend/__tests__/utils/capitalize.spec.js +++ /dev/null @@ -1,14 +0,0 @@ -import capitalize from '../../src/utils/capitalize'; - -describe(capitalize, () => { - it('should ignore falsy-string', () => { - expect(capitalize(undefined)).toBeUndefined(); - expect(capitalize(null)).toBeUndefined(); - }); - - it('should capitalize the string', () => { - expect(capitalize('string')).toBe('String'); - expect(capitalize('STring')).toBe('STring'); - expect(capitalize('spaced string')).toBe('Spaced string'); - }); -}); diff --git a/frontend/__tests__/utils/toast.spec.js b/frontend/__tests__/utils/toast.spec.js deleted file mode 100644 index 19da6a4..0000000 --- a/frontend/__tests__/utils/toast.spec.js +++ /dev/null @@ -1,46 +0,0 @@ -import { toast } from 'react-toastify'; -import ToastNotification from '../../src/utils/toast'; - -jest.mock('react-toastify'); - -describe(ToastNotification.notify, () => { - const mock = { - msg: { - error: 'this is an error message', - success: 'this is an success message', - }, - }; - - beforeEach(() => { - toast.mockReturnValue({ - error: jest.fn(), - success: jest.fn(), - }); - }); - - describe('error method', () => { - it('should call react-toastify', () => { - ToastNotification.notify('error', mock.msg.error); - expect(toast.error).toHaveBeenCalledWith(mock.msg.error); - }); - - it('should have an default message', () => { - ToastNotification.notify('error'); - expect(toast.error).toHaveBeenCalledWith( - 'Ocorreu um erro no processamento' - ); - }); - }); - - describe('success method', () => { - it('should call react-toastify', () => { - ToastNotification.notify('success', mock.msg.success); - expect(toast.success).toHaveBeenCalledWith(mock.msg.success); - }); - - it('should have an default message', () => { - ToastNotification.notify('success'); - expect(toast.success).toHaveBeenCalledWith('Sucesso'); - }); - }); -}); diff --git a/frontend/debug.log b/frontend/debug.log deleted file mode 100644 index b8febe5..0000000 --- a/frontend/debug.log +++ /dev/null @@ -1,32 +0,0 @@ -[0729/221145.237:ERROR:crash_report_database_win.cc(469)] failed to stat report -[0729/221145.282:ERROR:crash_report_database_win.cc(469)] failed to stat report -[0729/221145.283:ERROR:crash_report_database_win.cc(469)] failed to stat report -[0729/221145.283:ERROR:crash_report_database_win.cc(469)] failed to stat report -[0729/223542.097:ERROR:crash_report_database_win.cc(469)] failed to stat report -[0729/223542.098:ERROR:crash_report_database_win.cc(469)] failed to stat report -[0729/223542.098:ERROR:crash_report_database_win.cc(469)] failed to stat report -[0729/223542.098:ERROR:crash_report_database_win.cc(469)] failed to stat report -[0729/235052.267:ERROR:crash_report_database_win.cc(469)] failed to stat report -[0729/235052.268:ERROR:crash_report_database_win.cc(469)] failed to stat report -[0729/235052.304:ERROR:crash_report_database_win.cc(469)] failed to stat report -[0729/235052.304:ERROR:crash_report_database_win.cc(469)] failed to stat report -[0730/213507.902:ERROR:crash_report_database_win.cc(469)] failed to stat report -[0730/213507.904:ERROR:crash_report_database_win.cc(469)] failed to stat report -[0730/213507.904:ERROR:crash_report_database_win.cc(469)] failed to stat report -[0730/213507.904:ERROR:crash_report_database_win.cc(469)] failed to stat report -[0731/195201.876:ERROR:crash_report_database_win.cc(469)] failed to stat report -[0731/195201.899:ERROR:crash_report_database_win.cc(469)] failed to stat report -[0731/195201.899:ERROR:crash_report_database_win.cc(469)] failed to stat report -[0731/195201.899:ERROR:crash_report_database_win.cc(469)] failed to stat report -[0801/210611.449:ERROR:crash_report_database_win.cc(469)] failed to stat report -[0801/210611.500:ERROR:crash_report_database_win.cc(469)] failed to stat report -[0801/210611.500:ERROR:crash_report_database_win.cc(469)] failed to stat report -[0801/210611.500:ERROR:crash_report_database_win.cc(469)] failed to stat report -[0813/135559.995:ERROR:crash_report_database_win.cc(469)] failed to stat report -[0813/135600.175:ERROR:crash_report_database_win.cc(469)] failed to stat report -[0813/135600.175:ERROR:crash_report_database_win.cc(469)] failed to stat report -[0813/135600.176:ERROR:crash_report_database_win.cc(469)] failed to stat report -[0813/172932.159:ERROR:crash_report_database_win.cc(469)] failed to stat report -[0813/172932.219:ERROR:crash_report_database_win.cc(469)] failed to stat report -[0813/172932.219:ERROR:crash_report_database_win.cc(469)] failed to stat report -[0813/172932.219:ERROR:crash_report_database_win.cc(469)] failed to stat report diff --git a/frontend/package.json b/frontend/package.json deleted file mode 100644 index 232adc1..0000000 --- a/frontend/package.json +++ /dev/null @@ -1,67 +0,0 @@ -{ - "name": "frontend", - "version": "0.1.0", - "private": true, - "dependencies": { - "@fortawesome/fontawesome-svg-core": "^1.2.28", - "@fortawesome/free-brands-svg-icons": "^5.13.0", - "@fortawesome/free-solid-svg-icons": "^5.13.0", - "@fortawesome/react-fontawesome": "^0.1.9", - "@lottiefiles/react-lottie-player": "^1.0.2", - "axios": "^0.19.2", - "dotenv": "^8.2.0", - "react": "^16.13.1", - "react-awesome-slider": "^4.1.0", - "react-dom": "^16.13.1", - "react-icons": "^3.11.0", - "react-loading-skeleton": "^2.0.1", - "react-router-dom": "^5.2.0", - "react-scripts": "3.4.1", - "react-toastify": "^6.0.5", - "react-web-vector-icons": "^1.0.2", - "styled-components": "^5.1.1", - "styled-media-query": "^2.1.2" - }, - "scripts": { - "start": "react-scripts start", - "build": "react-scripts build", - "test": "react-scripts test", - "eject": "react-scripts eject" - }, - "eslintConfig": { - "extends": "react-app" - }, - "browserslist": { - "production": [ - ">0.2%", - "not dead", - "not op_mini all" - ], - "development": [ - "last 1 chrome version", - "last 1 firefox version", - "last 1 safari version" - ] - }, - "devDependencies": { - "@testing-library/jest-dom": "^5.12.0", - "@testing-library/react": "^11.2.7", - "@testing-library/user-event": "^13.1.9", - "@types/jest": "^26.0.23", - "axios-mock-adapter": "^1.19.0", - "babel-eslint": "^10.1.0", - "eslint": "^6.8.0", - "eslint-config-airbnb": "^18.1.0", - "eslint-config-prettier": "^6.11.0", - "eslint-plugin-import": "^2.20.2", - "eslint-plugin-jsx-a11y": "^6.2.3", - "eslint-plugin-prettier": "^3.1.3", - "eslint-plugin-react": "^7.20.0", - "eslint-plugin-react-hooks": "^2.5.1", - "identity-obj-proxy": "^3.0.0", - "jest": "24.9.0", - "jest-styled-components": "^7.0.4", - "prettier": "^2.0.5", - "regenerator-runtime": "^0.13.7" - } -} diff --git a/frontend/public/index.html b/frontend/public/index.html deleted file mode 100644 index 38e2381..0000000 --- a/frontend/public/index.html +++ /dev/null @@ -1,57 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - DevChallenge - - - - - -
- - diff --git a/frontend/src/App.js b/frontend/src/App.js deleted file mode 100644 index c368411..0000000 --- a/frontend/src/App.js +++ /dev/null @@ -1,8 +0,0 @@ -import React from 'react'; -import Routes from './routes'; - -function App() { - return ; -} - -export default App; diff --git a/frontend/src/components/Banner/index.js b/frontend/src/components/Banner/index.js deleted file mode 100644 index e5d7556..0000000 --- a/frontend/src/components/Banner/index.js +++ /dev/null @@ -1,20 +0,0 @@ -import React from 'react'; -import { Link } from 'react-router-dom'; - -import * as S from './styled'; - -export default function Banner() { - return ( - - - Melhore suas habilidades - - - Com desafios de front-end, back-end e mobile - - - Bora codar! - - - ); -} diff --git a/frontend/src/components/Banner/styled.js b/frontend/src/components/Banner/styled.js deleted file mode 100644 index c7ad2e5..0000000 --- a/frontend/src/components/Banner/styled.js +++ /dev/null @@ -1,84 +0,0 @@ -import styled from 'styled-components'; -import media from 'styled-media-query'; - -export const BannerContainer = styled.div` - display: flex; - flex-direction: column; - flex-wrap: wrap; - justify-content: center; - align-items: center; - margin-top: 160px; - margin-bottom: 160px; - ${media.lessThan('medium')` - margin-top: 14%; - margin-bottom: 14%; - margin-left: 3%; - margin-right: 3%; - `} -`; - -export const BannerTitle = styled.h1` - color: var(--white); - font-size: 60px; -`; - -export const BannerSubtitle = styled.h2` - color: var(--yellow); - font-size: 20px; - margin-top: 10px; - margin-bottom: 20px; - - ${media.lessThan('medium')` - font-size: 1em; - `} -`; - -export const BannerButton = styled.button` - color: var(--white); - background-color: var(--purple); - width: 250px; - height: 60px; - font-weight: bold; - font-size: 20px; - border-radius: 50px; - cursor: pointer; - transition: 0.3s; - - &:hover { - background-color: var(--dark-purple); - } -`; - -export const Typewriter = styled.div` - h1 { - color: var(--white); - overflow: hidden; - border-right: 0.15em solid var(--purple); - white-space: nowrap; - letter-spacing: 0.02em; - animation: typing 3.5s steps(30, end), - blink-caret 0.5s step-end infinite; - - ${media.lessThan('medium')` - font-size: 1.8em; - `} - } - @keyframes typing { - from { - width: 0; - } - to { - width: 100%; - } - } - - @keyframes blink-caret { - from, - to { - border-color: transparent; - } - 50% { - border-color: var(--purple); - } - } -`; diff --git a/frontend/src/components/CategoriesList/index.js b/frontend/src/components/CategoriesList/index.js deleted file mode 100644 index 03c489d..0000000 --- a/frontend/src/components/CategoriesList/index.js +++ /dev/null @@ -1,20 +0,0 @@ -import React from 'react'; -import CategoryListItem from '../CategoryListItem'; - -import * as S from './styled'; - -const categories = [ - { _id: 1, name: 'Front-end', icon: 'desktop' }, - { _id: 2, name: 'Back-end', icon: 'code' }, - { _id: 3, name: 'Mobile', icon: 'mobile' }, -]; - -export default function CategoriesList() { - return ( - - {categories.map((category) => ( - - ))} - - ); -} diff --git a/frontend/src/components/CategoriesList/styled.js b/frontend/src/components/CategoriesList/styled.js deleted file mode 100644 index 4a4dcdb..0000000 --- a/frontend/src/components/CategoriesList/styled.js +++ /dev/null @@ -1,9 +0,0 @@ -import styled from 'styled-components'; - -export const Techs = styled.section` - display: flex; - flex-direction: row; - flex-wrap: wrap; - align-items: center; - justify-content: center; -`; diff --git a/frontend/src/components/CategoryListItem/index.js b/frontend/src/components/CategoryListItem/index.js deleted file mode 100644 index 82646cc..0000000 --- a/frontend/src/components/CategoryListItem/index.js +++ /dev/null @@ -1,28 +0,0 @@ -import React from 'react'; - -import Icon from 'react-web-vector-icons'; -import * as S from './styled'; - -export default function CategoryListItem({ category }) { - const type = category.name.replace('-', '').toLowerCase(); - - return ( - - - - {category.name} - - - ); -} diff --git a/frontend/src/components/CategoryListItem/styled.js b/frontend/src/components/CategoryListItem/styled.js deleted file mode 100644 index 2188e4a..0000000 --- a/frontend/src/components/CategoryListItem/styled.js +++ /dev/null @@ -1,69 +0,0 @@ -import styled from 'styled-components'; -import media from 'styled-media-query'; - -import { Link } from 'react-router-dom'; - -export const Anchor = styled(Link)` - text-decoration: none; - margin: 0 25px 0 25px; - - @media(max-width: 1053px) and (min-width: 700px) { - &:last-child { - margin-top: 30px - } - } - - ${media.lessThan('medium')` - margin: 15px 25px 10px 25px; - `} -`; - -export const Card = styled.div` - width: 300px; - height: 300px; - background-color: var(--gray); - border-radius: 10px; - - cursor: pointer; - display: flex; - flex-direction: column; - align-items: center; - justify-content: center; - - ${media.lessThan('medium')` - height: 8em; - width: 20em; - `} - - transition: background-color 0.25s; - - &:hover { - background-color: var(--dark-hover); - } -`; - -export const Title = styled.h2` - color: var(--white); - margin-top: 20px; - - ${media.lessThan('medium')` - margin-top: 0.6em; - `} -`; - -export const Anchor = styled(Link)` - color: transparent; - text-decoration: none; - margin: 50px; - display: inline-block; - - ${media.lessThan('medium')` - margin: 1.4em; - `} - - transition: outline-color 0.25s; - - &:focus { - outline: 1px solid var(--white); - } -`; diff --git a/frontend/src/components/ChallengeCard/index.js b/frontend/src/components/ChallengeCard/index.js deleted file mode 100644 index cb7f8f7..0000000 --- a/frontend/src/components/ChallengeCard/index.js +++ /dev/null @@ -1,72 +0,0 @@ -import React, { useState, useEffect } from 'react'; - -import * as S from './styled'; - -const colorMatch = { - beginner: 'nephritis', - intermediate: 'pumpkin', - advanced: 'pomegranate', - Mobile: 'blue', - Frontend: 'red', - Backend: 'light-purple', -}; - -function ChallengeCard({ challenge, progress, redirect, buttonText }) { - const [techs, setTechs] = useState([]); - - useEffect(() => { - const techsUnOrder = challenge.techs - .toString() - .split(',') - .map((element) => element.replace(/^[ ]/, '')); - - techsUnOrder.forEach((techItem, i) => { - techsUnOrder.forEach((element, j) => { - if (j > i && element.length > techItem.length) { - const aux = techItem; - techsUnOrder[i] = element; - techsUnOrder[j] = aux; - } - }); - }); - - setTechs(techsUnOrder); - }, [challenge.techs]); - - return ( - - - - - {techs.map((item) => ( -

- {item} -

- ))} -
- - - {challenge.type} - - - {challenge.level} - - - -
- {progress && } -
- - -

{challenge.name}

-
-

{challenge.description}

{' '} -
- - {buttonText} - -
- ); -} - -export default ChallengeCard; diff --git a/frontend/src/components/ChallengeCard/styled.js b/frontend/src/components/ChallengeCard/styled.js deleted file mode 100644 index bc87fea..0000000 --- a/frontend/src/components/ChallengeCard/styled.js +++ /dev/null @@ -1,151 +0,0 @@ -import styled from 'styled-components'; -import { Link } from 'react-router-dom'; - -export const Anchor = styled(Link)` - text-decoration: none; - cursor: pointer; - - color: var(--white-gray); -`; - -export const Level = styled.span` - background-color: var(--${(props) => props.color}); - padding: 6px 16px; - font-size: 11px; - height: 23px; - border-radius: 20px; - font-weight: bold; - margin-bottom: 5px; -`; - -export const ChallengeCard = styled.div` - height: 350px; - width: 300px; - - background-color: var(--secondary); - border-radius: 16px; - - margin: 1em 1em 1em 1em; - - display: flex; - flex-direction: column; - align-items: center; - - position: relative; - overflow: hidden; -`; - -export const CardImage = styled.div` - overflow: hidden; - height: 150px; - width: 300px; - background-color: #2b3035; - - img { - transition: 0.3s; - width: 100%; - } - img:hover { - transform: scale(1.1); - } -`; - -export const CardContent = styled.div` - margin-top: 10px; - color: var(--white-gray); - text-align: center; - width: 100%; - padding: 0 16px; - - h1 { - font-size: 25px; - margin-top: 0px; - font-weight: 500; - } - - p { - margin-top: 10px; - } -`; - -export const CardTechs = styled.div` - position: absolute; - right: 0; - top: 16px; - padding: 0 16px; - height: auto; - display: flex; - flex-direction: column; - justify-content: space-between; - align-items: flex-end; - z-index: 999; - .tech { - background-color: var(--quaternary); - padding: 5px 15px; - margin-bottom: 5px; - border-radius: 25px; - text-align: center; - font-weight: bold; - color: var(--white); - align-items: center; - font-size: 13px; - } - - .level { - color: var(--yellow); - font-weight: bold; - } -`; - -export const CardPlatforms = styled.div` - position: absolute; - left: 0; - top: 16px; - padding: 0 16px; - height: auto; - display: flex; - flex-direction: column; - justify-content: space-between; - align-items: flex-start; - z-index: 999; -`; - -export const Button = styled.button` - width: 80%; - height: 46px; - - position: absolute; - bottom: 16px; - left: 50%; - transform: translateX(-50%); - - background: var(--purple); - color: var(--white); - font-weight: bold; - font-size: 18px; - - border-radius: 50px; - - cursor: pointer; - - transition: 0.25s; - - &:hover { - width: 83%; - } -`; - -export const ProgressBar = styled.div` - width: 100%; - height: 8px; - background: var(--quinary); - - &::after { - position: absolute; - content: ' '; - width: ${(props) => `${props.progress}%`}; - height: 8px; - background: var(--green); - border-radius: 0 5px 5px 0; - } -`; diff --git a/frontend/src/components/ChallengesSkeleton/index.js b/frontend/src/components/ChallengesSkeleton/index.js deleted file mode 100644 index b109ccc..0000000 --- a/frontend/src/components/ChallengesSkeleton/index.js +++ /dev/null @@ -1,19 +0,0 @@ -import React from 'react'; -import Skeleton, { SkeletonTheme } from 'react-loading-skeleton'; -import * as S from './styled'; - -export default function ChallengesSkeleton({ cards = 4 }) { - const arr = Array.from({ length: cards }, (_, i) => i + 1); - - return ( - - - {arr.map((item) => ( - - - - ))} - - - ); -} diff --git a/frontend/src/components/ChallengesSkeleton/styled.js b/frontend/src/components/ChallengesSkeleton/styled.js deleted file mode 100644 index 7130117..0000000 --- a/frontend/src/components/ChallengesSkeleton/styled.js +++ /dev/null @@ -1,21 +0,0 @@ -import styled from 'styled-components'; - -export const Section = styled.section` - margin-top: 3%; - display: flex; - flex-wrap: wrap; - max-width: 100vw; - align-items: center; - justify-content: center; -`; - -export const ChallengeSkeleton = styled.div` - border-radius: 16px; - cursor: pointer; - - height: 350px; - width: 300px; - margin: 0 0.5em 1em 0.5em; - - overflow: hidden; -`; diff --git a/frontend/src/components/DashboardDefault/index.js b/frontend/src/components/DashboardDefault/index.js deleted file mode 100644 index 4cd2269..0000000 --- a/frontend/src/components/DashboardDefault/index.js +++ /dev/null @@ -1,22 +0,0 @@ -import React from 'react'; - -import SidebarUser from '../SidebarUser'; -import Logo from '../Logo'; -import { DashboardWrapper, DashboardContent, DbHeader } from './styled'; - -function DashboardDefault(props) { - return ( - - - - - - - - {props.children} - - - ); -} - -export default DashboardDefault; diff --git a/frontend/src/components/DevCard/index.js b/frontend/src/components/DevCard/index.js deleted file mode 100644 index 5a5f11c..0000000 --- a/frontend/src/components/DevCard/index.js +++ /dev/null @@ -1,42 +0,0 @@ -import React from 'react'; - -import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; -import { faGithubSquare, faLinkedin } from '@fortawesome/free-brands-svg-icons'; - -import * as S from './styled'; - -function DevCard(props) { - return ( - - {`Avatar: - -

{props.name}

- {props.position} -
- - {props.github && ( - - - - )} - {props.linkedin && ( - - - - )} - -
- ); -} - -export default DevCard; diff --git a/frontend/src/components/DevCard/styled.js b/frontend/src/components/DevCard/styled.js deleted file mode 100644 index 50e5d91..0000000 --- a/frontend/src/components/DevCard/styled.js +++ /dev/null @@ -1,79 +0,0 @@ -import styled from 'styled-components'; -import media from 'styled-media-query'; - - -export const Card = styled.div` - min-width: 300px; - height: 90px; - - box-sizing: border-box; - padding: 0px 10px; - - background: var(--secondary); - border-radius: 16px; - - display: flex; - align-items: center; - - position: relative; - - > img { - height: 70px; - width: 70px; - border-radius: 50%; - } - - ${media.lessThan('medium')` - margin-bottom: 5%; - `} -`; - - -export const Infos = styled.div` - max-width: 200px; - flex-wrap: wrap; - - display: flex; - flex-direction: column; - justify-content: center; - align-items: left; - - margin: 0 16px; - - > h1 { - font-size: 18px; - font-weight: bold; - color: var(--white); - } - - > span { - font-size: 14px; - font-weight: 500; - color: var(--yellow); - } -`; - - -export const Social = styled.div` - display: flex; - flex-direction: column; - - position: absolute; - right: 16px; -`; - -export const Anchor = styled.a` - text-decoration: none; - color: var(--white); - font-size: 20px; - - display: flex; - align-items: center; - justify-content: center; - - transition: .25s; - - &:hover{ - color: var(--yellow); - } -`; \ No newline at end of file diff --git a/frontend/src/components/Footer/index.js b/frontend/src/components/Footer/index.js deleted file mode 100644 index c6fe560..0000000 --- a/frontend/src/components/Footer/index.js +++ /dev/null @@ -1,52 +0,0 @@ -import React from 'react'; - -import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; -import { faGithub, faDiscord, faInstagram, faTwitter } from '@fortawesome/free-brands-svg-icons'; - -import * as S from './styled'; - -function Footer() { - return ( - - - - - - - - - - - - - - - - - DevChallenge - - - ); -} - -export default Footer; \ No newline at end of file diff --git a/frontend/src/components/Footer/styled.js b/frontend/src/components/Footer/styled.js deleted file mode 100644 index 45e85c1..0000000 --- a/frontend/src/components/Footer/styled.js +++ /dev/null @@ -1,54 +0,0 @@ -import styled from 'styled-components'; -import media from 'styled-media-query'; - -export const Container = styled.footer` - width: 100%; - height: 100px; - - padding: 40px 100px; - - background-color: var(--tertiary); - - display: flex; - justify-content: space-between; - - ${media.lessThan('small')` - flex-direction: column-reverse; - align-items: center; - justify-content: center; - `} -`; - -export const Social = styled.div` - display: flex; - - > a ~ a { - margin-left: 20px; - } -`; - -export const Title = styled.div` - font-size: 24px; - font-weight: bold; - color: var(--white); - - span { - color: var(--yellow); - } - - ${media.lessThan('small')` - margin-bottom: 25px; - `} -`; - -export const Anchor = styled.a` - text-decoration: none; - font-size: 22px; - color: var(--quinary); - - transition: 0.25s; - - &:hover { - color: var(--yellow); - } -`; diff --git a/frontend/src/components/Header/index.js b/frontend/src/components/Header/index.js deleted file mode 100644 index 270470b..0000000 --- a/frontend/src/components/Header/index.js +++ /dev/null @@ -1,64 +0,0 @@ -import React, { useState, useEffect } from 'react'; -import { useLocation } from 'react-router-dom'; -import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; -import { faBars, faTimes } from '@fortawesome/free-solid-svg-icons'; -import { faGithub } from '@fortawesome/free-brands-svg-icons'; - -import Logo from '../Logo' - -import * as S from './styled'; - -export default function Header() { - const location = useLocation(); - const [clicked, setClicked] = useState(false); - - useEffect(() => { - setClicked(false); - }, [location]); - - return ( - - - - setClicked(!clicked)}> - {!clicked ? ( - - ) : ( - - )} - - - -
    -
  • - - Início - -
  • -
  • - - Desafios - -
  • -
  • - - Comunidade - -
  • -
  • - - Entrar - - -
  • -
-
-
- ); -} diff --git a/frontend/src/components/Header/index.test.js b/frontend/src/components/Header/index.test.js deleted file mode 100644 index c794ddf..0000000 --- a/frontend/src/components/Header/index.test.js +++ /dev/null @@ -1,49 +0,0 @@ -import React from 'react'; -import { render, screen, fireEvent } from '../../utils/test-utils'; - -import Header from '.'; - -describe('
', () => { - beforeEach(() => { - render(
); - }); - - it('should render with Logo as link to home', () => { - expect( - screen.getByRole('link', { name: /dev challenge/i }) - ).toHaveAttribute('href', '/'); - }); - - it('should handle the open/close mobile menu', () => { - expect(screen.getByLabelText(/menu closed/i)).toBeInTheDocument(); - expect(screen.queryByLabelText(/menu opened/i)).not.toBeInTheDocument(); - - // click to open menu - fireEvent.click(screen.getByLabelText(/menu closed/i)); - expect(screen.queryByLabelText(/menu closed/i)).not.toBeInTheDocument(); - expect(screen.getByLabelText(/menu opened/i)).toBeInTheDocument(); - - // click to close menu - fireEvent.click(screen.getByLabelText(/menu opened/i)); - expect(screen.getByLabelText(/menu closed/i)).toBeInTheDocument(); - expect(screen.queryByLabelText(/menu opened/i)).not.toBeInTheDocument(); - }); - - it('should render with correct nav links', () => { - expect(screen.getByRole('link', { name: /Início/i })).toHaveAttribute( - 'href', - '/' - ); - expect(screen.getByRole('link', { name: /Desafios/i })).toHaveAttribute( - 'href', - '/challenges' - ); - expect( - screen.getByRole('link', { name: /Comunidade/i }) - ).toHaveAttribute('href', '/devs'); - expect(screen.getByRole('link', { name: /Entrar/i })).toHaveAttribute( - 'href', - '/login' - ); - }); -}); diff --git a/frontend/src/components/Logo/__snapshots__/index.test.js.snap b/frontend/src/components/Logo/__snapshots__/index.test.js.snap deleted file mode 100644 index 8946cf8..0000000 --- a/frontend/src/components/Logo/__snapshots__/index.test.js.snap +++ /dev/null @@ -1,39 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[` should render as link to home 1`] = ` -.c1 { - -webkit-text-decoration: none; - text-decoration: none; - color: var(--white); - cursor: pointer; -} - -.c1.is-active { - color: var(--yellow); -} - -.c0 { - font-size: 30px; - font-weight: bold; - color: var(--white); -} - -.c0 span { - color: var(--yellow); -} - - -`; diff --git a/frontend/src/components/Logo/index.js b/frontend/src/components/Logo/index.js deleted file mode 100644 index b54d359..0000000 --- a/frontend/src/components/Logo/index.js +++ /dev/null @@ -1,17 +0,0 @@ -import React from 'react'; - -import { StyledLink } from '../Header/styled'; - -import * as S from './styled'; - -function Logo() { - return ( - - - DevChallenge - - - ); -} - -export default Logo; diff --git a/frontend/src/components/Logo/index.test.js b/frontend/src/components/Logo/index.test.js deleted file mode 100644 index 4f77a0e..0000000 --- a/frontend/src/components/Logo/index.test.js +++ /dev/null @@ -1,24 +0,0 @@ -import React from 'react'; -import { render, screen } from '../../utils/test-utils'; - -import Logo from '.'; - -describe('', () => { - it('should render as link to home', () => { - const { container } = render(); - - expect( - screen.getByRole('link', { name: /dev challenge/i }) - ).toHaveAttribute('href', '/'); - - expect(container.firstChild).toMatchSnapshot(); - }); - - it('should render "challenge" in yellow', () => { - render(); - - expect(screen.getByText('Challenge')).toHaveStyle({ - color: 'var(--yellow)', - }); - }); -}); diff --git a/frontend/src/components/Logo/styled.js b/frontend/src/components/Logo/styled.js deleted file mode 100644 index 1bf2f98..0000000 --- a/frontend/src/components/Logo/styled.js +++ /dev/null @@ -1,10 +0,0 @@ -import styled from 'styled-components'; - -export const Title = styled.div` - font-size: 30px; - font-weight: bold; - color: var(--white); - span { - color: var(--yellow); - } -`; diff --git a/frontend/src/components/Newsletter/index.js b/frontend/src/components/Newsletter/index.js deleted file mode 100644 index 41c98f8..0000000 --- a/frontend/src/components/Newsletter/index.js +++ /dev/null @@ -1,64 +0,0 @@ -import React, { useState } from 'react'; -import { Player } from '@lottiefiles/react-lottie-player'; -import api from '../../services/api'; -import ToastNotification from '../../utils/toast'; - -import * as S from './styled'; - -export default function Newsletter() { - const [email, setEmail] = useState(''); - - async function handleSubscribe(e) { - e.preventDefault(); - - const data = { - email, - }; - - try { - await api.post('newsletter', data); - ToastNotification.notify( - 'success', - 'Feito! Você será o primeiro a saber sobre novos desafios :)' - ); - } catch (err) { - ToastNotification.notify( - 'error', - 'Opa, algo deu errado! Pode tentar novamente? :c' - ); - } - } - - return ( - -
- -
-
- - Seja notificado sobre novos desafios! - - - Inscreva-se para ser o primeiro a saber sobre novos desafios - :) - - - setEmail(e.target.value)} - required - /> - - -
-
- ); -} diff --git a/frontend/src/components/SidebarUser/index.js b/frontend/src/components/SidebarUser/index.js deleted file mode 100644 index eaccb69..0000000 --- a/frontend/src/components/SidebarUser/index.js +++ /dev/null @@ -1,97 +0,0 @@ -import React, { useEffect, useState } from 'react'; -import { useLocation } from 'react-router-dom'; -import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; -import { faBars, faTimes } from '@fortawesome/free-solid-svg-icons'; - -import Icon from 'react-web-vector-icons'; -import { Aside, Img, UserInfo, StyledLink, Menu, MenuMobile } from './styles'; - -function SidebarUser() { - const location = useLocation(); - const [clicked, setClicked] = useState(false); - const [user, setUser] = useState({}); - - useEffect(() => { - setClicked(false); - setUser({ - name: 'Dev Challenge', - username: '@devChallenge', - img: '', - }); - }, [location]); - - return ( - <> - setClicked(!clicked)}> - {!clicked ? ( - - ) : ( - - )} - - - - ); -} - -export default SidebarUser; diff --git a/frontend/src/components/SidebarUser/styles.js b/frontend/src/components/SidebarUser/styles.js deleted file mode 100644 index 2bd921e..0000000 --- a/frontend/src/components/SidebarUser/styles.js +++ /dev/null @@ -1,107 +0,0 @@ -import styled from 'styled-components'; -import media from 'styled-media-query'; -import { NavLink } from 'react-router-dom'; - -export const Aside = styled.aside` - display: flex; - align-items: center; - flex-direction: column; - text-align: center; - - width: 350px; - background: var(--secondary); - color: var(--white); - - ${media.between('medium', 'large')` - width: 278px; - `} - - ${media.lessThan('860px')` - position: absolute; - top: 0; - bottom: 0; - z-index: 9998; - - transform: ${({ open }) => - open ? 'translateX(0)' : 'translateX(-350px)'}; - transition: 0.5s ease; - `} -`; - -export const UserInfo = styled.div` - margin-top: 40px; - - & > p { - font-size: 16px; - font-family: Roboto; - } - - & > span { - font-family: Roboto; - font-size: 12px; - } -`; - -export const Img = styled.img` - height: 90px; - width: 90px; - border-radius: 50%; - margin-bottom: 10px; - border: 3px solid var(--yellow); -`; - -export const Menu = styled.div` - ul { - display: flex; - flex-direction: column; - align-items: center; - justify-content: center; - width: 350px; - margin-top: 60px; - list-style: none; - - ${media.between('medium', 'large')` - width: 278px; - `} - - li { - width: 200px; - height: 45px; - display: flex; - align-items: center; - font-size: 18px; - } - - li:hover { - opacity: 0.8; - } - } -`; - -export const StyledLink = styled(NavLink)` - text-decoration: none; - color: var(--white); - - &.is-active { - color: var(--yellow); - } -`; - -export const MenuMobile = styled.div` - display: none; - - transition: 0.25s; - - ${media.lessThan('860px')` - display: block; - position: absolute; - font-size: 25px; - color: var(--white); - top: 50px; - left: 20px; - margin-right: 20px; - cursor: pointer; - - z-index: 9999; - `} -`; diff --git a/frontend/src/components/StatusCard/index.js b/frontend/src/components/StatusCard/index.js deleted file mode 100644 index 6d67b68..0000000 --- a/frontend/src/components/StatusCard/index.js +++ /dev/null @@ -1,14 +0,0 @@ -import React from 'react'; - -import { CardWrapper } from './styled'; - -function StatusCard(props) { - return ( - -

{props.title}

-

{props.count}

-
- ); -} - -export default StatusCard; diff --git a/frontend/src/components/StatusCard/styled.js b/frontend/src/components/StatusCard/styled.js deleted file mode 100644 index 099996b..0000000 --- a/frontend/src/components/StatusCard/styled.js +++ /dev/null @@ -1,26 +0,0 @@ -import styled from 'styled-components'; - -export const CardWrapper = styled.div` - display: flex; - width: 48%; - max-width: 350px; - height: 110px; - background: var(--secondary); - border-radius: 11px; - border: 2px solid; - padding: 25px; - align-items: center; - justify-content: space-between; - color: var(--white); - - & > p { - width: 150px; - font-weight: 400; - font-size: 20px; - padding: 10px; - } - - & > h1 { - font-size: 50px; - } -`; diff --git a/frontend/src/components/Steps/index.js b/frontend/src/components/Steps/index.js deleted file mode 100644 index 67c0d12..0000000 --- a/frontend/src/components/Steps/index.js +++ /dev/null @@ -1,27 +0,0 @@ -import React from 'react'; -import { - faSearch, - faCode, - faShareSquare, -} from '@fortawesome/free-solid-svg-icons'; - -import * as S from './styled'; - -export default function Steps() { - return ( - - - -

Escolha

-
- - -

Desenvolva

-
- - -

Compartilhe

-
-
- ); -} diff --git a/frontend/src/components/Steps/styled.js b/frontend/src/components/Steps/styled.js deleted file mode 100644 index 2629662..0000000 --- a/frontend/src/components/Steps/styled.js +++ /dev/null @@ -1,46 +0,0 @@ -import styled from 'styled-components'; -import media from 'styled-media-query'; - -import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; - -export const StepsContainer = styled.section` - margin-top: 100px; - - display: flex; - align-items: center; - justify-content: center; - - ${media.lessThan('medium')` - padding: 0; - `} -`; - -export const Step = styled.div` - width: 300px; - height:300px; - - display: flex; - flex-direction: column; - align-items: center; - justify-content: center; - - h2 { - color: var(--yellow); - margin-top: 20px; - - ${media.lessThan('medium')` - font-size: 1em; - `} - } -`; - -export const Icon = styled(FontAwesomeIcon)` - color: var(--white); - width: 60px !important; - height: 60px; - - ${media.lessThan('medium')` - height: 3em; - width: 3em; - `} -`; diff --git a/frontend/src/index.js b/frontend/src/index.js deleted file mode 100644 index da830b4..0000000 --- a/frontend/src/index.js +++ /dev/null @@ -1,18 +0,0 @@ -import React from 'react'; -import ReactDOM from 'react-dom'; -import App from './App'; -import * as serviceWorker from './serviceWorker'; -import { GlobalStyles } from './styles/GlobalStyles'; - -ReactDOM.render( - - - - , - document.getElementById('root') -); - -// If you want your app to work offline and load faster, you can change -// unregister() to register() below. Note this comes with some pitfalls. -// Learn more about service workers: https://bit.ly/CRA-PWA -serviceWorker.unregister(); diff --git a/frontend/src/pages/Challenges/index.js b/frontend/src/pages/Challenges/index.js deleted file mode 100644 index 77ed0b8..0000000 --- a/frontend/src/pages/Challenges/index.js +++ /dev/null @@ -1,103 +0,0 @@ -import React, { useEffect, useState } from 'react'; -import ChallengesSkeleton from '../../components/ChallengesSkeleton'; -import ChallengeCard from '../../components/ChallengeCard'; -import Header from '../../components/Header'; -import * as S from './styled'; -import loadChallenges from '../../services/loadChallenges'; -import capitalize from '../../utils/capitalize'; - -const languages = [ - { id: 1, name: 'React Native' }, - { id: 2, name: 'Free Choice' }, - { id: 3, name: 'Javascript' }, - { id: 4, name: 'HTML' }, - { id: 5, name: 'CSS' }, -]; - -const types = [ - { id: 1, name: 'Frontend' }, - { id: 2, name: 'Backend' }, - { id: 3, name: 'Mobile' }, -]; - -export default function Challenges({ location }) { - const [challenges, setChallenges] = useState([]); - const [loading, setLoading] = useState(true); - const [languageFilter, setLanguageFilter] = useState(''); - const [typeFilter, setTypeFilter] = useState(location.search.split('=')[1]); - - useEffect(() => { - window.scrollTo(0, 0); - - loadChallenges({ typeFilter }).then((res) => { - setChallenges(res.challenges); - setLoading(false); - }); - }, [location, typeFilter, languageFilter]); - - return ( - <> -
- -

Desafios

- - - - - - - - - - - - - - -
- - {loading && } - {!loading && ( - - {challenges.map((challenge) => { - return ( - - ); - })} - - )} - - ); -} diff --git a/frontend/src/pages/Challenges/styled.js b/frontend/src/pages/Challenges/styled.js deleted file mode 100644 index 7259df8..0000000 --- a/frontend/src/pages/Challenges/styled.js +++ /dev/null @@ -1,78 +0,0 @@ -import styled from 'styled-components'; -import media from 'styled-media-query'; -import chevronDown from '../../assets/chevron-down.svg'; - -export const Section = styled.section` - margin-top: 3%; - display: flex; - flex-wrap: wrap; - max-width: 100vw; - align-items: center; - justify-content: center; -`; - -export const Head = styled.div` - display: flex; - justify-content: space-between; - align-items: center; - border-bottom: 1px solid var(--quaternary); - margin-top: 60px; - padding: 0 80px; - font-size: 18px; - - h1 { - color: whitesmoke; - ${media.lessThan('medium')` - font-size: 30px; - `} - } - - ${media.lessThan('medium')` - padding: 0 20px; - `} -`; - -export const Filters = styled.form` - color: white; - display: flex; -`; - -export const InputGroup = styled.div` - margin: 0 0 0 14px; - - label { - padding-left: 4px; - font-size: 14px; - font-weight: bold; - display: block; - } -`; - -export const Select = styled.div` - padding-right: 20px; - height: 34px; - overflow: hidden; - background: url(${chevronDown}) no-repeat right var(--primary); - - select { - width: 120%; - padding-right: 20px; - background: transparent; - padding: 5px; - font-size: 16px; - line-height: 1; - border: 0; - border-radius: 0; - height: 34px; - -webkit-appearance: none; - -webkit-user-select: none; - -moz-user-select: none; - -ms-user-select: none; - color: white; - } - - option { - background-color: var(--primary); - border: 0; - } -`; diff --git a/frontend/src/pages/ConstructPage/index.js b/frontend/src/pages/ConstructPage/index.js deleted file mode 100644 index 29e12b0..0000000 --- a/frontend/src/pages/ConstructPage/index.js +++ /dev/null @@ -1,30 +0,0 @@ -import React from 'react'; - -import pageInConstruction from '../../assets/page-under-construction.png'; -import Header from '../../components/Header'; - -function ConstructPage() { - return ( - <> -
-
- -

Pagina em Construção

-
- - ); -} - -export default ConstructPage; diff --git a/frontend/src/pages/Dashboard/index.js b/frontend/src/pages/Dashboard/index.js deleted file mode 100644 index 0c1b0f6..0000000 --- a/frontend/src/pages/Dashboard/index.js +++ /dev/null @@ -1,42 +0,0 @@ -import React, { useState, useEffect } from 'react'; - -import DashboardDefault from '../../components/DashboardDefault'; -import StatusCard from '../../components/StatusCard'; -import { StatusCardWrapper, Title, Container } from './styled'; -import { ChallengeCard } from '../../components/ChallengeCard/styled'; - -const fakeData = { - complete: 5, - inProgress: 2, -}; - -function Dashboard() { - const [statusCount, setStatusCount] = useState({}); - - useEffect(() => { - setStatusCount(fakeData); - }, []); - - return ( - - - - - - - #WeeklyDevChallenge - - - - ); -} - -export default Dashboard; diff --git a/frontend/src/pages/Detail/index.js b/frontend/src/pages/Detail/index.js deleted file mode 100644 index c9113be..0000000 --- a/frontend/src/pages/Detail/index.js +++ /dev/null @@ -1,178 +0,0 @@ -import React, { useState, useEffect } from 'react'; -import { useParams } from 'react-router-dom'; -import { faCheck } from '@fortawesome/free-solid-svg-icons'; -import AwesomeSlider from 'react-awesome-slider'; -import 'react-awesome-slider/dist/styles.css'; -import DevCard from '../../components/DevCard'; - -import * as S from './styled'; -import Header from '../../components/Header'; -import loadChallengesById from '../../services/loadChallengesById'; - -const includes = [ - { - id: 1, - instruction: - 'Readme com instruções de requisitos e as rotas da aplicação', - }, - { - id: 2, - instruction: 'Imagens para adicionar no projeto', - }, - { - id: 3, - instruction: 'Modelo como design para utilizar como referência', - }, - { - id: 4, - instruction: 'Arquivo contendo o texto que será utilizado', - }, -]; - -const starts = [ - { - id: 1, - steps: 'Clone o projeto com o código inicial', - }, - { - id: 2, - steps: 'Leia as instruções disponíveis no readme', - }, - { - id: 3, - steps: 'Inicie o desenvolvimento!', - }, - { - id: 4, - steps: 'Compartilhe seus resultados com a comunidade', - }, -]; - -const colorMatch = { - beginner: 'nephritis', - intermediate: 'pumpkin', - advanced: 'pomegranate', - Mobile: 'blue', - Frontend: 'red', - Backend: 'light-purple', -}; - -export default function Detail() { - const [challenge, setChallenge] = useState({}); - const [techs, setTechs] = useState([]); - const [dev, setDev] = useState({}); - const [images, setImages] = useState([]); - const { id } = useParams(); - - useEffect(() => { - window.scrollTo(0, 0); - - // eslint-disable-next-line camelcase - loadChallengesById({ id }).then(({ first_challenge }) => { - setChallenge(first_challenge); - setDev(first_challenge.dev_id); - setImages(first_challenge.images); - setTechs(first_challenge.techs); - }); - }, [id]); - - return ( - <> -
- - - - -

{challenge.name}

-
- - - - {challenge.level} - - - {challenge.type} - - {techs[0]?.split(', ').map((item, idx) => ( - {item} - ))} - - - - {challenge.description} - - - - Iniciar desafio - -
- - - {images.map((image) => ( -
- Challenge -
- ))} -
-
-
- - - - -

Sobre o desafio

-

Seu desafio é {challenge.brief}.

-
- - -

O que está incluso?

- - {challenge.type === 'Backend' ? ( - - Readme com - instruções de requisitos e as rotas da - aplicação - - ) : ( - <> - {includes.map((include) => ( - - {' '} - {include.instruction} - - ))} - - )} -
- -

Como iniciar?

- {starts.map((start) => ( -

- {start.id} - - {start.steps} -

- ))} -
-
-
- -
-
- - ); -} diff --git a/frontend/src/pages/Detail/styled.js b/frontend/src/pages/Detail/styled.js deleted file mode 100644 index 2ea2aff..0000000 --- a/frontend/src/pages/Detail/styled.js +++ /dev/null @@ -1,340 +0,0 @@ -import styled from 'styled-components'; -import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; -import media from 'styled-media-query'; - -export const Container = styled.div` - display: flex; - flex-direction: column; - justify-content: center; - margin: 2%; - flex: 1; - - ${media.lessThan('medium')` - flex-direction: column; - align-items: center; - justify-content: center; - width: 100%; - margin: 0%; - margin-top: 5%; - `} -`; - -export const Banner = styled.div` - display: flex; - align-items: center; - justify-content: center; - margin-top: 3em; - - ${media.lessThan('medium')` - flex-wrap: wrap-reverse; - `} -`; - -export const LeftColumn = styled.div` - display: flex; - flex-direction: column; - align-items: left; - justify-content: center; - width: 40%; - text-align: left; - - ${media.lessThan('medium')` - display: flex; - width: 100%; - margin-top: 8%; - flex-direction: column; - align-items: center; - justify-content: center; - margin-left: 0; - margin-right: 0; - `} - - ${media.lessThan('small')` - margin-right: 4%; - margin-left: 4%; - `} -`; - -export const InfosType = styled.div` - filter: brightness(90%); - width: 10em; - border-radius: 20px; - text-align: left; - font-weight: bold; - margin-left: 4%; - margin-bottom: 1%; - color: var(--purple); - ${media.lessThan('medium')` - text-align: center; - margin: 0; - width: 5em; - `}; -`; - -export const TitleContainer = styled.div` - margin-left: 4%; - margin-bottom: 1%; - h1 { - color: var(--yellow); - text-align: left; - } - - ${media.lessThan('medium')` - margin: 0; - margin-top: 4%; - text-align: center; - `} -`; - -export const ChallengeDescription = styled.div` - color: var(--white); - font-size: 1.2em; - margin-left: 4%; - margin-bottom: 4%; - - ${media.lessThan('medium')` - text-align: left; - margin-left: 0; - margin-top: 2%; - margin-bottom: 4%; - `} -`; - -export const Infos = styled.div` - display: flex; - flex-wrap: wrap; - align-items: center; - justify-content: left; - padding: 0 4%; - font-size: 14px; - margin-bottom: 10px; - - ${media.lessThan('medium')` - align-items: start; - width: 100%; - padding: 0; - `} -`; - -export const InfosLevel = styled.div` - background-color: var(--${(props) => props.color}); - filter: brightness(90%); - padding: 7px 15px; - margin-right: 2%; - margin-bottom: 2%; - border-radius: 20px; - text-align: center; - font-weight: bold; - color: var(--white); -`; - -export const InfosTechs = styled.div` - background-color: var(--quaternary); - filter: brightness(90%); - padding: 7px 15px; - margin-right: 2%; - margin-bottom: 2%; - border-radius: 20px; - text-align: center; - font-weight: bold; - color: var(--white); -`; - -export const ChallengeLink = styled.a` - color: var(--white); - background-color: var(--purple); - width: 15em; - height: 3em; - font-weight: bold; - font-size: 20px; - border-radius: 50px; - cursor: pointer; - transition: 0.3s; - margin: 4%; - text-decoration: none; - display: flex; - justify-content: center; - align-items: center; - - &:hover { - background-color: var(--dark-purple); - } - - ${media.lessThan('medium')` - margin: 0; - margin-top: 5%; - margin-bottom: 2%; - `} - - ${media.between('large', 'huge')` - width: 20em; - `} -`; - -export const Demo = styled.div` - width: 47em; - border-radius: 10px; - - .image { - height: 100%; - } - - .slider { - width: 100%; - height: 100%; - } - - .awssld__wrapper { - border-radius: 10px; - } - - .awssld__bullets { - bottom: 0; - z-index: 9999; - padding: 10px 0; - transition: 0.4s; - } - - .awssld__bullets:hover { - background-color: rgba(0, 0, 0, 0.3); - } - - .awssld__bullets button { - border: 3px solid var(--yellow); - background-color: rgba(0, 0, 0, 0); - } - - .awssld__bullets .awssld__bullets--active { - background-color: var(--yellow); - } - - .image { - height: 100%; - width: 100%; - } - - ${media.lessThan('medium')` - width: 90%; - height: 100%; - margin-bottom: 20px; - `} -`; - -export const FlexContainer = styled.div` - display: flex; - flex-direction: column; - align-items: center; - - ${media.lessThan('medium')` - align-items: center; - justify-content: center; - max-width: 100%; - `} -`; - -export const Content = styled.div` - margin-top: 3%; -`; - -export const ChallengeAbout = styled.div` - width: 100%; - margin-top: 5%; - margin-bottom: 4%; - text-align: left; - - h1 { - color: var(--purple); - font-size: 1.6em; - } - - p { - margin-top: 1%; - color: var(--white); - } - - ${media.lessThan('medium')` - align-items: center; - justify-content: center; - margin-left: 4%; - margin-right: 4%; - max-width: 95%; - `} -`; - -export const ChallengeContainer = styled.div` - width: 100%; - display: flex; - align-items: center; - justify-content: center; - line-height: 1.5em; - margin-bottom: 4%; - p { - color: var(--white); - } - - ${media.lessThan('medium')` - text-align: left; - flex-wrap: wrap; - `} -`; - -export const ChallengeInclude = styled.div` - display: flex; - margin-right: 8%; - flex-direction: column; - - h3 { - color: var(--purple); - margin-top: 0.3em; - padding: 0.2em; - font-size: 1.6em; - } - - span { - color: var(--white); - padding: 0.2em; - display: block; - } - - ${media.lessThan('medium')` - margin-right: 0; - `} - - ${media.lessThan('small')` - margin-right: 4%; - margin-left: 4%; - `} -`; - -export const Icon = styled(FontAwesomeIcon)` - color: var(--green); -`; - -export const ChallengeStart = styled.div` - display: flex; - flex-direction: column; - - h3 { - color: var(--purple); - padding: 0.2em; - margin-top: 0.3em; - font-size: 1.6em; - } - - p { - color: var(--white); - padding: 0.2em; - } - - span { - color: var(--yellow); - font-weight: bold; - margin: 0; - padding: 0; - } - - ${media.lessThan('small')` - margin-right: 4%; - margin-left: 4%; - `} -`; diff --git a/frontend/src/pages/Devs/index.js b/frontend/src/pages/Devs/index.js deleted file mode 100644 index 666f3ea..0000000 --- a/frontend/src/pages/Devs/index.js +++ /dev/null @@ -1,106 +0,0 @@ -import React, { useEffect, useState } from 'react'; -import { - faLightbulb, - faCodeBranch, - faComment, -} from '@fortawesome/free-solid-svg-icons'; - -import * as S from './styled'; - -import DevCard from '../../components/DevCard'; -import Header from '../../components/Header'; -import loadChallengesDevs from '../../services/loadChallengesDevs'; - -export default function Challenges() { - const [devs, setDevs] = useState([]); - const [loading, setLoading] = useState(true); - - useEffect(() => { - loadChallengesDevs().then((res) => { - setDevs(res.devs); - setLoading(false); - }); - }, []); - - return ( - <> -
- {!loading && ( - - - - - - - - Submeter -
- novo desafio -
-
-
- - - - - Participar -
- da comunidade -
-
-
- - - - - Contribuir -
- open source -
-
-
-
- -

Últimas contribuições

- - {devs.map((dev) => ( - - ))} - -
-
- )} - - ); -} diff --git a/frontend/src/pages/Devs/styled.js b/frontend/src/pages/Devs/styled.js deleted file mode 100644 index cce7162..0000000 --- a/frontend/src/pages/Devs/styled.js +++ /dev/null @@ -1,107 +0,0 @@ -import styled from 'styled-components'; -import media from 'styled-media-query'; -import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; - -export const Container = styled.div` - display: flex; - flex-direction: column; - justify-content: center; - margin: 6%; - flex: 1 1; - - ${media.lessThan('medium')` - flex-direction: column; - align-items: center; - justify-content: center; - width: 100%; - margin: 0%; - margin-top: 5%; - `} -`; - -export const OptionsContainer = styled.div` - display: flex; - flex-direction: row; - flex-wrap: wrap; - align-items: center; - justify-content: center; - a { - text-decoration: none; - } -`; - -export const Option = styled.div` - width: 300px; - height: 300px; - - background-color: var(--secondary); - - margin: 20px; - border-radius: 10px; - - cursor: pointer; - - display: flex; - flex-direction: column; - flex-wrap: wrap; - align-items: center; - justify-content: center; - - transition: .25s; - - &:hover { - transform: scale(1.05); - background-color: var(--dark-hover); - } -`; - -export const OptionIcon = styled(FontAwesomeIcon)` - color: var(--yellow) !important; - font-size: 60px !important; - height: 60px; -`; - -export const OptionTitle = styled.h2` - color: var(--white); - margin-top: 20px; - text-align: center; -`; - -export const Help = styled.div` - display: flex; - flex-direction: column; - justify-content: center; - align-items: center; - - h3 { - color: var(--white); - font-size: 18px; - font-weight: normal; - margin-bottom: 0.5em; - } -`; - -export const DevsContainer = styled.div` - margin-top: 4em; - color: var(--white); - - display: flex; - flex-direction: column; - align-items: center; - - >h1 { - margin-bottom: 1em; - } -`; - -export const Devs = styled.div` - display: flex; - flex-direction: row; - - justify-content: space-evenly; - flex-wrap: wrap; - - > div { - margin-bottom: 2em; - } -`; diff --git a/frontend/src/pages/MyChallenges/index.js b/frontend/src/pages/MyChallenges/index.js deleted file mode 100644 index 97ee72f..0000000 --- a/frontend/src/pages/MyChallenges/index.js +++ /dev/null @@ -1,101 +0,0 @@ -import React, { useState, useEffect } from 'react'; - -import DashboardDefault from '../../components/DashboardDefault'; -import { ProgressBar } from '../../components/ChallengeCard/styled'; -import ChallengeCard from '../../components/ChallengeCard'; - -import { Title, Section, Container } from './styled'; - -const fakeData = { - inProgress: [ - { - techs: ['CSS, React Native'], - images: [ - 'https://i.imgur.com/nAsuQSs.png', - 'https://i.imgur.com/A9sWFtn.png', - ], - _id: '5ec1cd5b9cd83622b185db7f', - type: 'Mobile', - name: 'Fisiotherapp', - description: 'Ajude pacientes com exercícios de fisioterapia!', - level: 'beginner', - background: 'https://i.imgur.com/4FgywHQ.png', - github_url: 'https://github.com/Lorenalgm/fisiotheapp', - brief: - 'criar um aplicativo em React Native para ajudar pessoas com exercícios de fisioterapia', - dev_id: '5ec31e81e8051f63faefdf5e', - createdAt: '2020-05-17T23:48:43.265Z', - updatedAt: '2020-08-09T00:31:57.252Z', - __v: 0, - }, - ], - complete: [ - { - techs: ['CSS, React Native'], - images: [ - 'https://i.imgur.com/nAsuQSs.png', - 'https://i.imgur.com/A9sWFtn.png', - ], - _id: '5ec1cd5b9cd83622b185db7f', - type: 'Mobile', - name: 'Fisiotherapp', - description: 'Ajude pacientes com exercícios de fisioterapia!', - level: 'beginner', - background: 'https://i.imgur.com/4FgywHQ.png', - github_url: 'https://github.com/Lorenalgm/fisiotheapp', - brief: - 'criar um aplicativo em React Native para ajudar pessoas com exercícios de fisioterapia', - dev_id: '5ec31e81e8051f63faefdf5e', - createdAt: '2020-05-17T23:48:43.265Z', - updatedAt: '2020-08-09T00:31:57.252Z', - __v: 0, - }, - ], -}; - -function MyChallenges() { - const [challengesList, setChallengesList] = useState({}); - - useEffect(() => { - setChallengesList(fakeData); - }, []); - - return ( - - - Em andamento -
- {challengesList.inProgress?.map((challenge) => ( - - - - ))} -
- - Concluídos - -
- {challengesList.complete?.map((challenge) => ( - - - - ))} -
-
-
- ); -} - -export default MyChallenges; diff --git a/frontend/src/pages/Ranking/fake-data.js b/frontend/src/pages/Ranking/fake-data.js deleted file mode 100644 index 1da5797..0000000 --- a/frontend/src/pages/Ranking/fake-data.js +++ /dev/null @@ -1,98 +0,0 @@ -import elemento from '../../assets/elemento.png'; - -const fakeData = { - ranking: [ - { - rank: 1, - name: 'Maria Silveira', - position: 'Full stack developer', - image: elemento, - github: 'https://github.com', - linkedin: 'https://linkedin.com', - score: '95', - }, - { - rank: 2, - name: 'Marcos Paliari', - position: 'Full stack developer', - image: elemento, - github: 'https://github.com', - linkedin: 'https://linkedin.com', - score: '88', - }, - { - rank: 3, - name: 'Ana Monteiro', - position: 'Full stack developer', - image: elemento, - github: 'https://github.com', - linkedin: 'https://linkedin.com', - score: '84', - }, - { - rank: 4, - name: 'Julio Souza', - position: 'Full stack developer', - image: elemento, - github: 'https://github.com', - linkedin: 'https://linkedin.com', - score: '80', - }, - { - rank: 5, - name: 'Luana Costa', - position: 'Full stack developer', - image: elemento, - github: 'https://github.com', - linkedin: 'https://linkedin.com', - score: '76', - }, - { - rank: 6, - name: 'Laura Monteiro Oliveira', - position: 'Full stack developer', - image: elemento, - github: 'https://github.com', - linkedin: 'https://linkedin.com', - score: '73', - }, - { - rank: 7, - name: 'Junior Correia', - position: 'Full stack developer', - image: elemento, - github: 'https://github.com', - linkedin: 'https://linkedin.com', - score: '69', - }, - { - rank: 8, - name: 'Laura Monteiro Oliveira', - position: 'Full stack developer', - image: elemento, - github: 'https://github.com', - linkedin: 'https://linkedin.com', - score: '68', - }, - { - rank: 9, - name: 'Ana Monteiro', - position: 'Full stack developer', - image: elemento, - github: 'https://github.com', - linkedin: 'https://linkedin.com', - score: '62', - }, - { - rank: 10, - name: 'Junior Correia', - position: 'Full stack developer', - image: elemento, - github: 'https://github.com', - linkedin: 'https://linkedin.com', - score: '57', - }, - ], -}; - -export default fakeData; diff --git a/frontend/src/pages/Ranking/index.js b/frontend/src/pages/Ranking/index.js deleted file mode 100644 index 28a47e8..0000000 --- a/frontend/src/pages/Ranking/index.js +++ /dev/null @@ -1,110 +0,0 @@ -import React from 'react'; - -import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; -import { faGithub, faLinkedin } from '@fortawesome/free-brands-svg-icons'; - -import Header from '../../components/Header'; - -import goldCrown from '../../assets/gold-crown.svg'; -import silverCrown from '../../assets/silver-crown.svg'; -import bronzeCrown from '../../assets/bronze-crown.svg'; - -import * as R from './styled'; - -import fakeData from './fake-data'; - -function Ranking() { - return ( - <> -
- - - Top 10 - - Desenvolvedores com mais desafios concluídos - - - {fakeData.ranking - .filter((item) => item.rank < 4) - .map( - ({ - rank, - name, - image, - position, - github, - linkedin, - score, - }) => ( - - Coroa - - - {score} - /100 - -

{name}

-

{position}

- - - - - - - - - {rank} -
- ) - )} -
-
- - - {fakeData.ranking - .filter((item) => item.rank >= 4) - .map(({ rank, name, image, position, score }) => ( - - -
- - {rank} -
-
-

{name}

-

{position}

-
-
- - {score} - /100 - -
- ))} -
- - ); -} - -export default Ranking; diff --git a/frontend/src/pages/Ranking/styled.js b/frontend/src/pages/Ranking/styled.js deleted file mode 100644 index 880ba87..0000000 --- a/frontend/src/pages/Ranking/styled.js +++ /dev/null @@ -1,356 +0,0 @@ -import styled from 'styled-components'; -import media from 'styled-media-query'; - -import bg from '../../assets/trophies-bg.svg'; - -const tools = { - cardsTitle: ` - font-size: 24px; - font-weight: 700; - line-height: 28px; - color: white; - `, - - cardsText: ` - font-size: 14px; - font-weight: 500; - line-height: 16px; - color: var(--yellow); - `, -}; - -export const Head = styled.section` - display: flex; - flex-direction: column; - - padding: 48px 80px 80px 80px; - margin: 86px 0 35px 0; - - background: url(${bg}) var(--primary); - box-shadow: 0px 4px 4px rgba(0, 0, 0, 0.25); - - ${media.between('medium', 'large')` - padding: 48px 60px 60px 60px; - `} - - ${media.lessThan('medium')` - display: flex; - flex-direction: column; - padding: 48px 0 0 0; - position: relative; - width: 100%; - margin: 0 auto; - `} -`; - -export const Title = styled.h2` - font-size: 72px; - line-height: 84px; - text-align: center; - - margin-bottom: 24px; - align-self: center; - - color: var(--white); - - ${media.lessThan('medium')` - font-size: 48px; - `} -`; - -export const Description = styled.p` - font-size: 24px; - font-weight: 700; - line-height: 1.5em; - text-align: center; - - color: var(--yellow); - align-self: center; - - margin-bottom: 73px; -`; - -export const Top3 = styled.section` - display: grid; - grid-template-columns: 1fr 1fr 1fr; - grid-template-areas: 'top2 top1 top3'; - justify-content: center; - height: 570px; - column-gap: 66px; - - ${media.lessThan('medium')` - display: flex; - flex-direction: column; - align-content: center; - width: 100%; - height: auto; - `} - - ${media.lessThan('large')` - column-gap: 24px; - `} -`; - -export const Top3Card = styled.article` - background: var(--dark-hover); - border-radius: 20px; - border: 1px solid rgba(244, 207, 10, 0.18); - box-shadow: 0 0 0 10px var(--dark-hover); - box-sizing: border-box; - - position: relative; - display: flex; - flex-direction: column; - align-items: center; - z-index: 10; - - padding: 6px 109px 42px 109px; - justify-self: start; - - ${media.lessThan('medium')` - padding: 0px 74px 0 74px; - align-self: center !important; - margin-bottom: 64px; - `} - - ${media.between('medium', 'large')` - padding: 6px 50px 42px 50px; - max-width: 100%; - `} - - ${media.between('large', 'huge')` - padding: 6px 74px 42px 74px; - `} - - > img:first-child { - margin-bottom: 16px; - } - - > h3 { - ${tools.cardsTitle} - - text-align: center; - margin-bottom: 4px; - } - - > p { - ${tools.cardsText} - - text-align: center; - margin-bottom: 42px; - } - - &:last-child { - grid-area: top3; - place-self: flex-end; - } - - &:first-child { - grid-area: top1; - align-self: flex-start; - justify-self: center; - } - - &:nth-child(2) { - grid-area: top2; - align-self: flex-end; - } -`; - -export const RankIcon = styled.div` - padding: 6px; - filter: drop-shadow(0px 4px 4px rgba(0, 0, 0, 0.25)); - border-radius: 50%; - background: var(--dark-hover); - width: 40px; - height: 40px; - - z-index: 20; - position: absolute; - left: 43%; - right: 45.56%; - top: 95.47%; - display: flex; - place-content: center; - - font-weight: 500; - font-size: 20px; - line-height: 23px; - color: var(--yellow); -`; - -export const Avatar = styled.img` - border: 5px solid var(--nephritis); - border-radius: 50%; - width: ${(props) => (props.width ? props.width : '140px')}; - height: ${(props) => (props.width ? props.width : '140px')}; - - margin-bottom: 12px; -`; - -export const Score = styled.span` - font-size: ${(props) => (props.top3 ? '24px' : '44px')}; - font-weight: 700; - line-height: ${(props) => (props.top3 ? '28px' : '52px')}; - color: var(--nephritis); - - margin-bottom: 24px; - - > sub { - font-size: ${(props) => (props.top3 ? '22px' : '38px')}; - line-height: 25.72px; - color: var(--quinary); - } -`; - -export const Top3SocialMedias = styled.aside` - position: absolute; - right: 13px; - bottom: 13px; - - > a { - width: 30px; - height: 30px; - - svg { - width: 25px !important; - height: 25px; - - color: var(--quinary); - } - - ~ a { - margin-left: 8px; - } - } -`; - -export const List = styled.section` - display: flex; - flex-direction: column; - place-content: center; - - padding: 0 80px 184px 80px; - margin: 86px auto 35px auto; - - ${media.between('medium', 'large')` - padding: 0px 60px 184px 60px; - `} - - ${media.lessThan('medium')` - display: flex; - flex-direction: column; - justify-content: center; - padding: 0 0 64px 0; - position: relative; - `} -`; - -export const ListItem = styled.article` - display: flex; - justify-content: space-between; - align-items: center; - - width: 100%; - background: var(--dark-hover); - padding: 24px; - border: 1px solid rgba(244, 207, 10, 0.18); - border-radius: 20px; - - > span { - margin-bottom: 0; - - ${media.lessThan('medium')` - font-size: 24px; - line-height: 28px; - - > sub { - font-size: 22px; - line-height: 25.72px; - } - `} - } - - & { - margin-bottom: 28px; - } - - &:last-child { - margin-bottom: 0px; - } - - ${media.lessThan('medium')` - width: 85%; - align-self: center; - padding: 12px; - `} - - ${media.lessThan('small')` - flex-direction: column; - `} -`; - -export const ListItemInfo = styled.section` - display: flex; - align-items: center; - - > section:first-child { - position: relative; - } - - > section:last-child { - margin-left: 41px; - - display: flex; - flex-direction: column; - align-items: flex-start; - - ${media.lessThan('medium')` - margin-left:12px; - `} - - ${media.lessThan('small')` - margin-left:0px; - `} - } - - > section:last-child h3 { - ${tools.cardsTitle} - - margin-bottom: 12px; - - ${media.lessThan('medium')` - font-size: 20px; - `} - - ${media.lessThan('small')` - align-self: center; - `} - } - - > section:last-child p { - ${tools.cardsText}; - background: #1f2124; - padding: 5px 7px; - - ${media.lessThan('small')` - margin-bottom: 12px; - align-self: center; - `} - } - - ${media.lessThan('small')` - flex-direction: column; - align-items: center; - `} -`; - -export const ListRankIcon = styled(RankIcon)` - left: 64%; - top: -9%; - - width: 35px; - height: 35px; - padding: 5px; - filter: drop-shadow(0px 4px 4px rgba(0, 0, 0, 0.25)); -`; diff --git a/frontend/src/pages/Submit/index.js b/frontend/src/pages/Submit/index.js deleted file mode 100644 index 50b6795..0000000 --- a/frontend/src/pages/Submit/index.js +++ /dev/null @@ -1,193 +0,0 @@ -import React, { useState } from 'react'; -import { FiXCircle } from 'react-icons/fi'; - -import * as S from './styled'; -import Header from '../../components/Header'; - -const levels = [ - { id: 1, title: 'iniciante' }, - { id: 2, title: 'intermediário' }, - { id: 3, title: 'avançado' }, -]; -const categories = [ - { id: 1, title: 'Frontend' }, - { id: 2, title: 'Backend' }, - { id: 3, title: 'Mobile' }, -]; - -const linkVerify = /^https:\/\/[A-z]/; - -export default function Submit() { - const [title, setTitle] = useState(''); - const [level, setLevel] = useState('iniciante'); - const [category, setCategory] = useState(''); - const [description, setDescription] = useState(''); - const [languages, setLanguages] = useState(''); - const [link, setLink] = useState(''); - const [imageLink, setImageLink] = useState([]); - const [imageInput, setImageInput] = useState(''); - - function set(data) { - let newString = ''; - if (category.includes(data)) { - newString = category.replace(data, ''); - } else { - newString = category.concat(` ${data}`); - } - setCategory(newString.trim()); - } - - async function addLink() { - console.log(linkVerify.test(imageInput)); - if (imageInput !== '' && linkVerify.test(imageInput)) { - await fetch(`${imageInput}`).then((response) => { - if (response.ok) { - setImageLink([...imageLink, imageInput]); - setImageInput(''); - } - }); - } - } - - function removeImageItem(index) { - const updatedLinkImages = imageLink.filter((item, i) => i !== index); - setImageLink(updatedLinkImages); - } - - function submitForm() {} - - function clearForm() { - setCategory(''); - setDescription(''); - setTitle(''); - setLink(''); - setImageLink([]); - setImageInput(''); - } - - return ( - <> -
- - - Submissão de desafios - - - Categoria - - {categories.map((categoryItem) => ( - set(categoryItem.title)} - key={categoryItem.id} - > - {categoryItem.title} - - ))} - - - - Nível - - {levels.map((levelItem) => ( - - setLevel(levelItem.title) - } - key={levelItem.id} - > - {levelItem.title} - - ))} - - - - Título - setTitle(e.target.value)} - /> - - - Descrição - setDescription(e.target.value)} - /> - - - - Imagens - - setImageInput(e.target.value)} - onKeyPress={(e) => { - if (e.key === 'Enter') { - addLink(); - } - }} - required - value={imageInput} - /> - - - Add Image + - - - - {imageLink.map((linkItem, i) => ( -
  • - - -
  • - ))} -
    -
    - - - Linguagens - setLanguages(e.target.value)} - /> - - - - Informe o link do desafio no github - - setLink(e.target.value)} - /> - - - - Limpar - - - Enviar - - -
    -
    -
    - - ); -} diff --git a/frontend/src/pages/Submit/styled.js b/frontend/src/pages/Submit/styled.js deleted file mode 100644 index 63f91a9..0000000 --- a/frontend/src/pages/Submit/styled.js +++ /dev/null @@ -1,241 +0,0 @@ -import styled from 'styled-components'; -import media from 'styled-media-query'; - -export const Section = styled.section` - margin-top: 3%; - margin-bottom: 10%; - display: flex; - flex-wrap: wrap; - max-width: 100vw; - align-items: center; - justify-content: center; - - ${media.lessThan('medium')` - margin-top: 15%; - margin-bottom: 15%; - `} -`; - -export const Container = styled.div` - background-color: var(--secondary); - width: 50%; - max-width: 800px; - height: 50%; - padding: 36px 48px 31px; - border-radius: 10px; - - ${media.between('medium', 'large')` - width: 70%; - height: 70%; - `} - - ${media.between('small', 'medium')` - width: 80%; - height: 80%; - `} - - ${media.lessThan('small')` - width: 80%; - padding: 20px 28px 18px; - `} -`; - -export const Title = styled.p` - color: var(--white); - font-size: 20px; - margin-bottom: 20px; - font-weight: bold; -`; - -export const Form = styled.div` - width: 100%; - margin: 0 0 15px; -`; -export const Field = styled.div` - display: flex; - flex-direction: column; - justify-content: space-between; - margin-bottom: 15px; - - ${media.lessThan('small')` - flex-direction: column; - align-items: flex-start; - `} -`; -export const Label = styled.p` - margin-bottom: 7px; - color: var(--quaternary); - font-size: 18px; - font-weight: bold; -`; -export const Input = styled.input` - width: 100%; - background: var(--quaternary); - height: 40px; - display: flex; - align-items: center; - color: white; - font-size: 14px; - padding: 0 15px; - border-radius: 40px; - - & + Input { - margin-top: 10px; - } - - ${media.lessThan('small')` - width: 100%; - `} -`; - -export const Textarea = styled.textarea` - width: 100%; - min-height: 200px; - background: var(--quaternary); - padding: 10px 15px; - font-size: 16px; - color: white; - border-radius: 20px; - - resize: vertical; -`; - -export const Select = styled.div` - display: flex; - height: 40px; - - ${media.lessThan('small')` - margin-bottom: 60px; - width: 100%; - flex-direction: column; - `} -`; - -const colorMatch = { - category: [ - 'var(--quaternary)', - 'var(--red)', - 'var(--light-purple)', - 'var(--blue)', - ], - level: [ - 'var(--quaternary)', - 'var(--nephritis)', - 'var(--pumpkin)', - 'var(--pomegranate)', - ], -}; - -export const Item = styled.button` - width: 100%; - padding: 5px 10px; - - text-transform: uppercase; - color: var(--tertiary); - font-size: 12px; - font-weight: bold; - - cursor: pointer; - - &:first-child { - background-color: ${(props) => - props.selected - ? colorMatch[props.type][1] - : colorMatch[props.type][0]}; - border-top-left-radius: 25px; - border-bottom-left-radius: 25px; - } - - &:nth-child(2) { - background-color: ${(props) => - props.selected - ? colorMatch[props.type][2] - : colorMatch[props.type][0]}; - border-style: none solid; - } - - &:last-child { - background-color: ${(props) => - props.selected - ? colorMatch[props.type][3] - : colorMatch[props.type][0]}; - border-top-right-radius: 25px; - border-bottom-right-radius: 25px; - } - - ${media.lessThan('small')` - padding: 10px 0; - &:first-child { - border-top-right-radius: 20px; - border-top-left-radius: 20px; - border-bottom-left-radius: 0; - } - &:nth-child(2) { - border-style: solid none; - } - &:last-child { - border-top-right-radius: 0; - border-bottom-right-radius: 20px; - border-bottom-left-radius: 20px; - } - `} -`; - -export const Actions = styled.div` - display: flex; - width: 100%; - margin-top: 30px; - align-items: center; - justify-content: space-around; -`; - -export const Button = styled.button` - padding: 10px 15px; - border-radius: 40px; - font-size: 18px; - cursor: pointer; - - background-color: ${(props) => - props.type === 'submit' ? 'var(--yellow)' : 'var(--quaternary)'}; -`; - -export const AddLinkButton = styled.button` - background-color: rgba(0, 0, 0, 0); - cursor: pointer; - margin-top: 10px; - align-self: flex-end; - padding: 0 20px; - font-weight: bold; - - color: var(--quaternary); -`; - -export const ImagePreview = styled.img` - //width: 50px; - height: 50px; - border-radius: 10px; -`; - -export const PreviewList = styled.ul` - display: flex; - flex-wrap: wrap; - list-style: none; - max-width: 100%; - - li { - width: 50px; - margin: 10px 30px; - display: flex; - align-items: center; - justify-content: space-between; - } - - button { - position: relative; - background-color: rgba(0, 0, 0, 0); - color: var(--red); - top: 25px; - right: 15px; - cursor: pointer; - } -`; diff --git a/frontend/src/pages/ToDoChallenge/index.js b/frontend/src/pages/ToDoChallenge/index.js deleted file mode 100644 index 510610f..0000000 --- a/frontend/src/pages/ToDoChallenge/index.js +++ /dev/null @@ -1,109 +0,0 @@ -import React, { useState } from 'react'; - -import { HeaderImg, Container, ToDoDiv, AddToDo, Content } from './styled'; -import DashboardDefault from '../../components/DashboardDefault'; - -function ToDoChallenge() { - const [todos, setTodos] = useState([ - { - id: 2, - title: 'teste', - checked: 1, - subtodo: [{ id: 1, title: 'teste', checked: 1, subtodo: [] }], - }, - ]); - - function renameTodo(todo, value) { - return { ...todo, title: value }; - } - - function changeChecked(todo, value) { - const newValue = value === '1' ? 0 : 1; - console.log(newValue); - return { ...todo, checked: newValue }; - } - - function createTodo(todo) { - const newValue = { title: '', id: '', checked: 0, subtodo: [] }; - return { ...todo, newValue }; - } - - const modifiers = { - rename: renameTodo, - check: changeChecked, - add: createTodo, - }; - - function findToDo(toDoList, id, modify, value) { - const newTodoList = toDoList.map((todo) => { - if (`${todo.id}` === id) { - const todoItem = modifiers[modify](todo, value); - return todoItem; - } - if (todo.subtodo.length !== 0) { - const subtodos = findToDo(todo.subtodo, id, modify, value); - return { ...todo, subtodo: subtodos }; - } - return todo; - }); - return newTodoList; - } - - function toggleCheckedStatus(e, modify) { - const { id, value } = e.target; - const newTodoList = findToDo(todos, id, modify, value); - setTodos(newTodoList); - console.log(newTodoList); - } - - function renderToDo(todo) { - return ( - <> - - toggleCheckedStatus(e, 'check')} - value={todo.checked} - /> - - toggleCheckedStatus(e, 'rename')} - /> - - {todo.subtodo.map((newTodo) => renderToDo(newTodo))} - - {todo.subtodo.length === 0 && ( - toggleCheckedStatus(e)} - > - + Add To-Do - - )} - - ); - } - - return ( - - - -

    Titulo

    - - {todos.map((todo) => renderToDo(todo))} - toggleCheckedStatus(e)}> - + Add To-Do - - -
    -
    - ); -} - -export default ToDoChallenge; diff --git a/frontend/src/pages/ToDoChallenge/styled.js b/frontend/src/pages/ToDoChallenge/styled.js deleted file mode 100644 index b1a15bc..0000000 --- a/frontend/src/pages/ToDoChallenge/styled.js +++ /dev/null @@ -1,79 +0,0 @@ -import styled from 'styled-components'; -import media from 'styled-media-query'; - -export const Container = styled.div` - padding: 40px 100px 0 100px; - - ${media.between('medium', 'large')` - padding: 40px 60px 0 60px; - `} -`; - -export const HeaderImg = styled.div` - width: 100%; - height: 200px; - background: ${(props) => `url(${props.img}) no-repeat`}; - background-size: cover; - margin-top: 20px; -`; - -export const Content = styled.div` - padding: 30px; -`; -export const ToDoDiv = styled.div` - display: flex; - padding-left: 30px; - padding-top: 10px; - width: 100%; - display: block; - - input[type='checkbox'] { - display: none; - } - - input[type='text'] { - background: var(--primary); - color: var(--quinary); - font-size: 18px; - width: 80%; - } - - label { - cursor: pointer; - font-size: 0; - } - - input + label::before { - border: 1px solid var(--quinary); - content: '\\00a0'; - display: inline-block; - font: 16px/1em sans-serif; - height: 16px; - margin: 0 10px 0 0; - padding: 0; - vertical-align: top; - width: 16px; - } - - input[type='checkbox']:checked + label:before { - color: var(--quinary); - content: '\\2713'; - text-align: center; - } - - input[type='checkbox']:checked + label:after { - font-weight: bold; - } -`; - -export const AddToDo = styled.button` - background: var(--primary); - color: var(--quinary); - opacity: 0; - transition: 0.3s; - padding-left: 30px; - - &:hover { - opacity: 1; - } -`; diff --git a/frontend/src/routes.js b/frontend/src/routes.js deleted file mode 100644 index 082d594..0000000 --- a/frontend/src/routes.js +++ /dev/null @@ -1,66 +0,0 @@ -import React from 'react'; -import { BrowserRouter, Switch, Route, Redirect } from 'react-router-dom'; - -import { ToastContainer } from 'react-toastify'; -import 'react-toastify/dist/ReactToastify.css'; -import Home from './pages/Home'; -import Challenges from './pages/Challenges'; -import Detail from './pages/Detail'; -import Devs from './pages/Devs'; -import Submit from './pages/Submit'; -import MyChallenges from './pages/MyChallenges'; -import Dashboard from './pages/Dashboard'; -import Ranking from './pages/Ranking'; -import Footer from './components/Footer'; -import ToDoChallenge from './pages/ToDoChallenge'; - -import { Container } from './styles/GlobalStyles'; -import ConstructPage from './pages/ConstructPage'; - -const logged = false; - -const LoggedRoute = ({ component: Component, ...rest }) => ( - - logged ? ( - - ) : ( - - ) - } - /> -); - -function Routes() { - return ( - - - - - - - - - - - - - - - - -