Skip to content

Commit ad9f203

Browse files
authored
Merge pull request #11 from raulghm/refactor
Refactor
2 parents 14605e7 + 1e1c483 commit ad9f203

File tree

19 files changed

+5879
-3520
lines changed

19 files changed

+5879
-3520
lines changed

.babelrc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"presets": ["@babel/env", "@babel/react"],
3+
"plugins": [
4+
"@babel/plugin-proposal-class-properties"
5+
]
6+
}

.env

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
SKIP_PREFLIGHT_CHECK=true

.eslintrc.js

Lines changed: 0 additions & 42 deletions
This file was deleted.

.gitignore

100644100755
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1-
# See https://help.github.com/ignore-files/ for more about ignoring files.
1+
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
22

33
# dependencies
44
/node_modules
5+
/.pnp
6+
.pnp.js
57

68
# testing
79
/coverage

__mocks__/fileMock.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
module.exports = 'test-file-stub'

__mocks__/styleMock.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
module.exports = {}

package.json

Lines changed: 46 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,59 @@
11
{
22
"name": "react-asado",
3-
"version": "0.2.3",
3+
"version": "0.2.4",
44
"license": "MIT",
55
"dependencies": {
6-
"react": "^16.5.0",
7-
"react-dom": "^16.5.0",
8-
"react-scripts": "1.1.5"
6+
"react": "^16.8.1",
7+
"react-dom": "^16.8.1",
8+
"react-scripts": "2.1.3"
99
},
1010
"scripts": {
1111
"start": "react-scripts start",
1212
"build": "react-scripts build",
13-
"test": "react-scripts test --env=jsdom",
13+
"test": "jest",
1414
"eject": "react-scripts eject"
1515
},
16+
"eslintConfig": {
17+
"extends": [
18+
"standard",
19+
"standard-react"
20+
],
21+
"plugins": [
22+
"jest"
23+
],
24+
"env": {
25+
"jest": true
26+
}
27+
},
28+
"jest": {
29+
"moduleNameMapper": {
30+
"\\.(css|jpg|png)$": "<rootDir>/__mocks__/styleMock.js"
31+
}
32+
},
33+
"browserslist": [
34+
">0.2%",
35+
"not dead",
36+
"not ie <= 11",
37+
"not op_mini all"
38+
],
1639
"devDependencies": {
17-
"eslint": "^4.19.1",
18-
"eslint-plugin-react": "^7.11.1",
19-
"eslint-config-airbnb": "^17.1.0",
20-
"eslint-plugin-import": "^2.14.0",
21-
"eslint-plugin-jsx-a11y": "^6.1.1"
40+
"@babel/core": "^7.2.2",
41+
"@babel/plugin-proposal-class-properties": "^7.3.0",
42+
"@babel/preset-env": "^7.3.1",
43+
"@babel/preset-react": "^7.0.0",
44+
"babel-jest": "^24.1.0",
45+
"enzyme": "^3.8.0",
46+
"enzyme-adapter-react-16": "^1.9.1",
47+
"enzyme-to-json": "^3.3.5",
48+
"eslint-config-standard": "^12.0.0",
49+
"eslint-config-standard-react": "^7.0.2",
50+
"eslint-plugin-import": "^2.16.0",
51+
"eslint-plugin-jest": "^22.2.2",
52+
"eslint-plugin-node": "^8.0.1",
53+
"eslint-plugin-promise": "^4.0.1",
54+
"eslint-plugin-react": "^7.12.4",
55+
"eslint-plugin-standard": "^4.0.0",
56+
"jest": "^24.1.0",
57+
"jsdom": "^13.2.0"
2258
}
2359
}

src/components/Footer/Footer.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
import React, { Component } from 'react';
1+
import React, { Component } from 'react'
22
import './Footer.css'
33

44
class Footer extends Component {
5-
render() {
5+
render () {
66
return (
7-
<div className="Footer">
8-
raulghm <span role="img" aria-label="ok_hand">👌</span> <a href="https://github.com/raulghm/react-asado">github.com/raulghm/react-asado</a>
7+
<div className='Footer'>
8+
raulghm <span role='img' aria-label='ok_hand'>👌</span> <a href='https://github.com/raulghm/react-asado'>github.com/raulghm/react-asado</a>
99
</div>
10-
);
10+
)
1111
}
1212
}
1313

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import React from 'react'
2+
import Footer from './Footer'
3+
import { configure, shallow } from 'enzyme'
4+
import Adapter from 'enzyme-adapter-react-16'
5+
6+
configure({ adapter: new Adapter() })
7+
8+
describe('<Footer />', () => {
9+
it('should render Footer', () => {
10+
shallow(<Footer />)
11+
})
12+
})

src/index.css

100644100755
Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,21 @@ body {
77
padding: 0;
88
font-family: 'Cutive Mono', sans-serif;
99
background-color: #252525;
10-
background-image: url(./assets/img/photo-1466220549276-aef9ce186540.jpg);
11-
background-size: cover;
12-
background-position: 50%;
1310
font-weight: lighter;
1411
}
1512

16-
#root {
17-
display: grid;
18-
align-items: center;
19-
justify-content: center;
20-
min-height: 100vh;
21-
padding: 20px 0;
13+
@media (min-width: 30em) {
14+
body {
15+
background-image: url(./assets/img/photo-1466220549276-aef9ce186540.jpg);
16+
background-size: cover;
17+
background-position: 50%;
18+
}
19+
20+
#root {
21+
display: grid;
22+
align-items: center;
23+
justify-content: center;
24+
min-height: 100vh;
25+
padding: 20px 0;
26+
}
2227
}

0 commit comments

Comments
 (0)