Skip to content

Commit

Permalink
Project Base
Browse files Browse the repository at this point in the history
  • Loading branch information
claudiolcastro committed May 11, 2020
1 parent 08bd9de commit f978d9e
Show file tree
Hide file tree
Showing 28 changed files with 787 additions and 184 deletions.
2 changes: 2 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
serviceWorker.js
node_modules
27 changes: 27 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
module.exports = {
env: {
browser: true,
es6: true,
},
extends: [
'plugin:react/recommended',
'airbnb',
],
globals: {
Atomics: 'readonly',
SharedArrayBuffer: 'readonly',
},
parserOptions: {
ecmaFeatures: {
jsx: true,
},
ecmaVersion: 11,
sourceType: 'module',
},
plugins: [
'react',
],
rules: {
"react/prop-types": "off",
},
};
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v12.16.1
17 changes: 16 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,28 @@
"@testing-library/jest-dom": "^4.2.4",
"@testing-library/react": "^9.3.2",
"@testing-library/user-event": "^7.1.2",
"node-sass": "^4.14.1",
"react": "^16.13.1",
"react-dom": "^16.13.1",
"react-scripts": "3.4.1"
"react-redux": "^7.2.0",
"react-scripts": "3.4.1",
"redux": "^4.0.5",
"redux-thunk": "^2.3.0",
"sass-loader": "^8.0.2",
"styled-components": "^5.1.0"
},
"devDependencies": {
"eslint": "^6.8.0",
"eslint-config-airbnb": "^18.1.0",
"eslint-plugin-import": "^2.20.2",
"eslint-plugin-jsx-a11y": "^6.2.3",
"eslint-plugin-react": "^7.19.0",
"eslint-plugin-react-hooks": "^2.5.1"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"lint": "eslint . --fix",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
Expand Down
46 changes: 15 additions & 31 deletions public/index.html
Original file line number Diff line number Diff line change
@@ -1,35 +1,18 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000000" />
<meta
name="description"
content="Web site created using create-react-app"
/>
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
<!--
manifest.json provides metadata used when your web app is installed on a
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
-->
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
<!--
Notice the use of %PUBLIC_URL% in the tags above.
It will be replaced with the URL of the `public` folder during the build.
Only files inside the `public` folder can be referenced from the HTML.

Unlike "/favicon.ico" or "favicon.ico", "%PUBLIC_URL%/favicon.ico" will
work correctly both with client-side routing and a non-root public URL.
Learn how to configure a non-root public URL by running `npm run build`.
-->
<title>React App</title>
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div>
<!--
<head>
<meta charset="utf-8" />
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000000" />
<title>Be The Hero</title>
</head>

<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div>
<!--
This HTML file is a template.
If you open it directly in the browser, you will see an empty page.
Expand All @@ -39,5 +22,6 @@
To begin the development, run `npm start` or `yarn start`.
To create a production bundle, use `npm run build` or `yarn build`.
-->
</body>
</html>
</body>

</html>
Binary file removed public/logo192.png
Binary file not shown.
Binary file removed public/logo512.png
Binary file not shown.
3 changes: 0 additions & 3 deletions public/robots.txt

This file was deleted.

38 changes: 0 additions & 38 deletions src/App.css

This file was deleted.

26 changes: 0 additions & 26 deletions src/App.js

This file was deleted.

23 changes: 23 additions & 0 deletions src/App.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import React from 'react';
import { Provider } from 'react-redux';

import store from './store';

import Header from './components/Header';
import Login from './pages/Login';

import './assets/scss/main.scss';

function App() {
return (
<Provider store={store}>
<Header title="Be The Hero!" />
<main>
<Login />
</main>
</Provider>
);
}


export default App;
9 changes: 0 additions & 9 deletions src/App.test.js

This file was deleted.

20 changes: 20 additions & 0 deletions src/Test.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import React from 'react';
import { bindActionCreators } from 'redux';
import { connect } from 'react-redux';

import { addName } from './store/profile';

function Test({ name, addMyName }) {
return (
<div>
<h2>{name}</h2>
<button type="button" onClick={() => addMyName('Claudio')}>Change name</button>
</div>
);
}

const mapStateToProps = (state) => ({ name: state.profile.name });

const mapDispathToProps = (dispatch) => bindActionCreators({ addMyName: addName }, dispatch);

export default connect(mapStateToProps, mapDispathToProps)(Test);
Binary file added src/assets/images/heroes.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 11 additions & 0 deletions src/assets/images/logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
42 changes: 42 additions & 0 deletions src/assets/scss/main.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
@import url('https://fonts.googleapis.com/css?family=Roboto:400,500,700&display=swap');

* {
margin: 0;
padding: 0;
outline: 0;
box-sizing: border-box;
}

body {
font: 400 14px Roboto, sans-serif;
background: #f0f0f5;
-webkit-font-smoothing: antialiased;
}

input, button, textarea {
font: 400 18px Roboto, sans-serif;
}

button {
cursor: pointer;
}

form input {
width: 100%;
height: 60px;
color: #333;
border: 1px solid #dcdce6;
border-radius: 8px;
padding: 0 24px;
}

form textarea {
width: 100%;
resize: vertical;
min-height: 140px;
color: #333;
border: 1px solid #dcdce6;
border-radius: 8px;
padding: 16px 24px;
line-height: 24px;
}
9 changes: 9 additions & 0 deletions src/components/Header.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import React from 'react';

export default function Header({ title }) {
return (
<header>
<h1>{title}</h1>
</header>
);
}
13 changes: 0 additions & 13 deletions src/index.css

This file was deleted.

3 changes: 1 addition & 2 deletions src/index.js → src/index.jsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
import React from 'react';
import ReactDOM from 'react-dom';
import './index.css';
import App from './App';
import * as serviceWorker from './serviceWorker';

ReactDOM.render(
<React.StrictMode>
<App />
</React.StrictMode>,
document.getElementById('root')
document.getElementById('root'),
);

// If you want your app to work offline and load faster, you can change
Expand Down
7 changes: 0 additions & 7 deletions src/logo.svg

This file was deleted.

11 changes: 11 additions & 0 deletions src/pages/Login/index.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import React from 'react';

import { Wrapper } from './styles';

export default function Login() {
return (
<Wrapper>
<h2>Login</h2>
</Wrapper>
);
}
5 changes: 5 additions & 0 deletions src/pages/Login/styles.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import styled from 'styled-components';

export const Wrapper = styled.div`
color: red;
`;
Loading

0 comments on commit f978d9e

Please sign in to comment.