Skip to content

Commit bf9cdab

Browse files
committed
refactor: new structure
Signed-off-by: Vitor Hugo Salgado <[email protected]>
1 parent b7aec2c commit bf9cdab

File tree

39 files changed

+181
-272
lines changed

39 files changed

+181
-272
lines changed

README.md

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -132,8 +132,3 @@ Mix of tools used to ensure code and commit style and best practices:
132132

133133
Check the [Makefile](Makefile) for some useful commands.
134134
Execute `make` to show the _help_.
135-
136-
## To Do
137-
138-
- [ ] Basic workflow with React and Redux
139-
- [ ] StyleLint seems to be not working properly

build/webpack/webpack-plugins.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,11 @@ module.exports = ({ start = [], end = [] }) =>
2626
})
2727
)
2828
}
29+
},
30+
{
31+
force: true,
32+
from: resolvePath('src/favicon.ico'),
33+
to: Config.paths.buildDestination
2934
}
3035
]
3136
}),

jest.config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ const config: JestConfig.InitialOptions = {
2323
displayName: 'Unit',
2424
rootDir: './src',
2525
testEnvironment: 'jsdom',
26+
setupFilesAfterEnv: [Path.resolve('./src/test-setup.config.ts')],
2627
moduleNameMapper: {
2728
'\\.(jpg|jpeg|png|gif|ico|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$': Path.resolve(
2829
'./test/setup/mocks/files/index.js'

src/app.spec.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import '@testing-library/jest-dom/extend-expect'
21
import * as React from 'react'
32
import { render, screen } from '@testing-library/react'
43
import App from '@app/app'
@@ -7,6 +6,6 @@ describe('App', () => {
76
it('should render correctly', () => {
87
render(<App />)
98

10-
expect(screen.getByRole('heading')).toHaveTextContent('Home!')
9+
expect(screen.getByText(/React Web Starter Demo/i)).toBeTruthy()
1110
})
1211
})

src/app.tsx

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,20 @@
1-
import '@app/core/assets/global.scss'
2-
import '@app/core/assets/favicon.ico'
1+
import 'react-app-polyfill/stable'
2+
3+
import './utils/locales/i18n'
4+
import './base.scss'
35

46
import * as React from 'react'
57
import { BrowserRouter, Route, Switch } from 'react-router-dom'
68

7-
import About from '@app/core/features/About'
8-
import Home from '@app/core/features/Home'
9-
import Header from '@app/core/components/Header'
10-
import LoginPage from '@app/core/features/Login'
9+
import Home from '@app/features/Home'
10+
import Header from '@app/components/Header'
1111

1212
export default function App(): JSX.Element {
1313
return (
1414
<BrowserRouter>
1515
<Header />
1616
<Switch>
1717
<Route exact path="/" component={Home} />
18-
<Route exact path="/about" component={About} />
19-
<Route exact path="/login" component={LoginPage} />
2018
</Switch>
2119
</BrowserRouter>
2220
)

src/base.scss

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
/**
2+
Variables
3+
*/
4+
5+
:root {
6+
--color-primary: #20133a;
7+
--color-highlight: #0360df;
8+
--color-accent: #573eb7;
9+
10+
--text-primary: #fff;
11+
12+
--border: 1px solid #ededf0;
13+
--border-accent: 1px solid var(--color-accent);
14+
--border-radius: 5px;
15+
--box-shadow: 0 0 0 2px #ededf0;
16+
}
17+
18+
/**
19+
Reset
20+
*/
21+
22+
* {
23+
box-sizing: border-box;
24+
}
25+
26+
html {
27+
padding: 0;
28+
margin: 0;
29+
font-family: 'Roboto', sans-serif;
30+
text-rendering: optimizeLegibility;
31+
scroll-behavior: smooth;
32+
-webkit-font-smoothing: antialiased;
33+
font-size: 16px;
34+
}
35+
36+
html,
37+
body {
38+
line-height: 22px;
39+
background: #f3f2f2;
40+
color: #232323;
41+
margin: 0;
42+
height: 100%;
43+
}
44+
45+
h1,
46+
h2,
47+
h3,
48+
h4,
49+
h5 {
50+
margin: 0;
51+
padding: 0;
52+
font-weight: normal;
53+
}
54+
55+
ul,
56+
ol {
57+
list-style: none;
58+
padding: 0;
59+
margin: 0;
60+
}
61+
62+
a {
63+
color: inherit;
64+
text-decoration: none;
65+
}
66+
67+
input,
68+
button {
69+
outline: none;
70+
border: 0 none;
71+
}
72+
73+
/**
74+
Default Styles
75+
*/
76+
77+
.icon {
78+
font-family: 'Material Icons', serif;
79+
vertical-align: middle;
80+
}

src/components/Header/index.tsx

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import * as React from 'react'
2+
import styled from 'styled-components'
3+
4+
const Wrapper = styled.header`
5+
display: flex;
6+
align-items: center;
7+
text-align: center;
8+
justify-content: center;
9+
background: var(--color-primary);
10+
color: var(--text-primary);
11+
font-size: 22px;
12+
padding: 15px;
13+
`
14+
15+
export default function Header(): JSX.Element {
16+
return (
17+
<Wrapper>
18+
<span>React Web Starter</span>
19+
</Wrapper>
20+
)
21+
}

src/core/assets/colors.scss

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

src/core/assets/global.scss

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

src/core/components/Header/index.tsx

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

0 commit comments

Comments
 (0)