Skip to content

Commit

Permalink
feat(responsive-layout): sidemenu on desktop and bottom navigation on…
Browse files Browse the repository at this point in the history
… mobile
  • Loading branch information
ruddenchaux committed Apr 12, 2021
1 parent 5398329 commit e741bad
Show file tree
Hide file tree
Showing 44 changed files with 15,730 additions and 0 deletions.
37 changes: 37 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
module.exports = {
extends: [
'airbnb-typescript',
'airbnb/hooks',
'plugin:@typescript-eslint/recommended',
'plugin:prettier/recommended'
],
plugins: ['react', '@typescript-eslint'],
env: {
browser: true,
es6: true
},
globals: {
Atomics: 'readonly',
SharedArrayBuffer: 'readonly'
},
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaFeatures: {
jsx: true
},
ecmaVersion: 2018,
sourceType: 'module',
project: './tsconfig.json'
},
ignorePatterns: ['build/**', 'cypress/**'],
rules: {
'@typescript-eslint/explicit-module-boundary-types': 'off',
'linebreak-style': 'off',
'prettier/prettier': [
'error',
{
endOfLine: 'auto'
}
]
}
};
104 changes: 104 additions & 0 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions

name: Node.js CI

on:
push:
branches:
- master
pull_request:
branches:
- master

jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v1

- uses: c-hive/gha-yarn-cache@v1

- name: Install dependencies
if: steps.yarn-cache.outputs.cache-hit != 'true'
run: yarn --prefer-offline --frozen-lockfile --silent

- name: Lint
run: yarn lint

cypress:
runs-on: ubuntu-latest
needs: [lint]
steps:
- name: Checkout
uses: actions/checkout@v1

- uses: c-hive/gha-yarn-cache@v1

- name: Cypress run
uses: cypress-io/github-action@v2
with:
install-command: yarn --prefer-offline --frozen-lockfile --silent
build: yarn build
start: yarn serve
wait-on: http://localhost:3000
record: true
env:
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COMMIT_INFO_MESSAGE: ${{ github.event.pull_request.title }}

deploy:
needs: [cypress]
name: 'Deploy on Netlify'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- uses: c-hive/gha-yarn-cache@v1

- name: Install dependencies
if: steps.yarn-cache.outputs.cache-hit != 'true'
run: yarn --prefer-offline --frozen-lockfile --silent

- name: Build
run: yarn build

- name: Deploy to Netlify
uses: nwtgck/actions-netlify@v1.1
with:
publish-dir: './build'
production-branch: master
deploy-message: 'Deploy from GitHub Actions'
enable-pull-request-comment: false
enable-commit-comment: true
overwrites-pull-request-comment: true
env:
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
timeout-minutes: 1

release:
needs: [deploy]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0

- uses: c-hive/gha-yarn-cache@v1

- name: git config
run: |
git config user.name "${GITHUB_ACTOR}"
git config user.email "${GITHUB_ACTOR}@users.noreply.github.com"
- name: Install dependencies
if: steps.yarn-cache.outputs.cache-hit != 'true'
run: yarn --prefer-offline --frozen-lockfile --silent

- name: Release
run: yarn release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
23 changes: 23 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
/.pnp
.pnp.js

# testing
/coverage

# production
/build

# misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local

npm-debug.log*
yarn-debug.log*
yarn-error.log*
1 change: 1 addition & 0 deletions .husky/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
_
4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

yarn lint
9 changes: 9 additions & 0 deletions .husky/prepare-commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

if [ "$OSTYPE" = "win32" ] || [ "$OSTYPE" = "msys" ];
then
yarn prepare-commit-msg-win
else
yarn prepare-commit-msg-unix
fi
6 changes: 6 additions & 0 deletions .prettierrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module.exports = {
trailingComma: 'none',
singleQuote: true,
printWidth: 120,
tabWidth: 2
};
14 changes: 14 additions & 0 deletions .release-it.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
module.exports = {
github: {
release: true
},
npm: {
publish: false
},
plugins: {
'@release-it/conventional-changelog': {
preset: 'angular',
infile: 'CHANGELOG.md'
}
}
};
8 changes: 8 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"editor.defaultFormatter": "dbaeumer.vscode-eslint",
"editor.formatOnSave": true,
"eslint.alwaysShowStatus": true,
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
}
}
Empty file added CHANGELOG.md
Empty file.
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2021 Federico Dainelli

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
7 changes: 7 additions & 0 deletions cypress.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"projectId": "s5vyfx",
"baseUrl": "http://localhost:3000",
"fixturesFolder": false,
"pluginsFile": false,
"video": false
}
11 changes: 11 additions & 0 deletions cypress/integration/sample_spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
context('Home page', () => {
before(() => {
cy.visit('/');
});

describe('Layout', () => {
it('renders Characters', () => {
cy.contains('Characters').should('exist');
});
});
});
22 changes: 22 additions & 0 deletions cypress/plugins/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/// <reference types="cypress" />
// ***********************************************************
// This example plugins/index.js can be used to load plugins
//
// You can change the location of this file or turn off loading
// the plugins file with the 'pluginsFile' configuration option.
//
// You can read more here:
// https://on.cypress.io/plugins-guide
// ***********************************************************

// This function is called when a project is opened or re-opened (e.g. due to
// the project's config changing)

/**
* @type {Cypress.PluginConfig}
*/
// eslint-disable-next-line no-unused-vars
module.exports = (on, config) => {
// `on` is used to hook into various events Cypress emits
// `config` is the resolved Cypress config
}
25 changes: 25 additions & 0 deletions cypress/support/commands.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// ***********************************************
// This example commands.js shows you how to
// create various custom commands and overwrite
// existing commands.
//
// For more comprehensive examples of custom
// commands please read more here:
// https://on.cypress.io/custom-commands
// ***********************************************
//
//
// -- This is a parent command --
// Cypress.Commands.add('login', (email, password) => { ... })
//
//
// -- This is a child command --
// Cypress.Commands.add('drag', { prevSubject: 'element'}, (subject, options) => { ... })
//
//
// -- This is a dual command --
// Cypress.Commands.add('dismiss', { prevSubject: 'optional'}, (subject, options) => { ... })
//
//
// -- This will overwrite an existing command --
// Cypress.Commands.overwrite('visit', (originalFn, url, options) => { ... })
20 changes: 20 additions & 0 deletions cypress/support/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// ***********************************************************
// This example support/index.js is processed and
// loaded automatically before your test files.
//
// This is a great place to put global configuration and
// behavior that modifies Cypress.
//
// You can change the location of this file or turn off
// automatically serving support files with the
// 'supportFile' configuration option.
//
// You can read more here:
// https://on.cypress.io/configuration
// ***********************************************************

// Import commands.js using ES2015 syntax:
import './commands'

// Alternatively you can use CommonJS syntax:
// require('./commands')
8 changes: 8 additions & 0 deletions cypress/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"compilerOptions": {
"target": "es5",
"lib": ["es5", "dom"],
"types": ["cypress"]
},
"include": ["**/*.ts"]
}
19 changes: 19 additions & 0 deletions exec-git-cz.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
@ECHO off
SETLOCAL

CALL :find_dp0
set "_prog=%dp0%node_modules\.bin\git-cz.cmd"
IF NOT EXIST "%_prog%" (
ECHO "%_prog% does not exist, please install commitizen"
ENDLOCAL
EXIT /b 1
)

call "%_prog%" %*

ENDLOCAL
EXIT %errorlevel%

:find_dp0
SET dp0=%~dp0
EXIT /b
Loading

0 comments on commit e741bad

Please sign in to comment.