Skip to content

Commit 7d3325b

Browse files
authored
Merge pull request #21 from coder-mind-project/develop
Master integration - Articles list, generic components refactor, added styled-components, update to Node.js 15.5.0
2 parents 1034059 + 14562d0 commit 7d3325b

31 files changed

+646
-629
lines changed

Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM node:latest as node
1+
FROM node:15.5.0-alpine3.10 as node
22
WORKDIR /app
33
ENV PATH /app/node_modules/.bin:$PATH
44
COPY package.json ./

src/App.js

+3-4
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ import React from 'react';
33
import {BrowserRouter as Router, Route, Switch} from 'react-router-dom';
44
import {Box} from '@material-ui/core';
55

6-
import Menu from './components/Menu.jsx';
7-
import Footer from './components/Footer.jsx';
6+
import Menu from './components/Menu/Menu.jsx';
7+
import Footer from './components/Footer/Footer.jsx';
88
import Home from './pages/Home/Home.jsx';
99
import ArticlesList from './pages/Articles/ArticlesList.jsx';
1010
import Article from './pages/Articles/Article.jsx';
@@ -20,13 +20,12 @@ import {standard} from './config/themes';
2020
import './index.css';
2121
import './config/axios';
2222

23-
2423
const App = () => {
2524
const theme = standard();
2625

2726
return (
2827
<MuiThemeProvider theme={theme}>
29-
<Box className="App">
28+
<Box>
3029
<Router>
3130
<Menu />
3231
<ScrollToTop>

src/components/Footer/FakeLink.jsx

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
import React from 'react';
2+
import PropTypes from 'prop-types';
3+
import {makeStyles} from '@material-ui/core';
4+
5+
import {styles} from './styles/Footer';
6+
7+
const useStyles = makeStyles(styles);
8+
9+
const FakeLink = (props) => {
10+
const {
11+
children,
12+
href,
13+
target,
14+
rel,
15+
} = props;
16+
17+
const classes = useStyles();
18+
19+
return (
20+
<a
21+
href={href}
22+
target={target}
23+
rel={rel}
24+
className={classes.fakeLink}
25+
>
26+
{children}
27+
</a>);
28+
};
29+
30+
FakeLink.propTypes =
31+
{
32+
children: PropTypes.node,
33+
href: PropTypes.string.isRequired,
34+
target: PropTypes.string,
35+
rel: PropTypes.string,
36+
};
37+
38+
FakeLink.defaultProps = {
39+
children: null,
40+
target: '_self',
41+
rel: null,
42+
};
43+
44+
export default FakeLink;

src/components/Footer.jsx renamed to src/components/Footer/Footer.jsx

+10-13
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,21 @@
11
import React from 'react';
22
import {Grid, Box, Typography} from '@material-ui/core';
3-
import {makeStyles} from '@material-ui/core/styles';
4-
import {Link} from 'react-router-dom';
53
import {FontAwesomeIcon} from '@fortawesome/react-fontawesome';
64
import {faGithub} from '@fortawesome/free-brands-svg-icons';
75

8-
import {styles} from './styles/Footer';
6+
import {fakeLink} from './styles/Footer';
7+
import FakeLink from './FakeLink';
8+
99
import {
1010
FooterContainer,
1111
FooterIconArea,
1212
FooterIconDescription,
1313
FooterIcon,
1414
FooterBox,
15-
} from './styles';
16-
17-
const useStyles = makeStyles(styles);
15+
FooterFakeLink,
16+
} from '../styles';
1817

1918
const Footer = () => {
20-
const classes = useStyles();
21-
2219
return (
2320
<Grid item xs={12}>
2421
<FooterContainer component="footer">
@@ -43,15 +40,15 @@ const Footer = () => {
4340
</FooterIconDescription>
4441
</FooterBox>
4542
<FooterBox>
46-
<a href="https://github.com/coder-mind-project" rel="noopener noreferrer" target="_blank" className={classes.fakeLink}>
43+
<FakeLink href="https://github.com/coder-mind-project" target="_blank" rel="noopener noreferrer" styles={fakeLink}>
4744
<FontAwesomeIcon icon={faGithub} size="2x"/>
48-
</a>
49-
<Link to="/privacidade" className={classes.fakeLink}>
45+
</FakeLink>
46+
<FooterFakeLink to="/privacidade">
5047
<Typography component="span" variant="body1">
5148
Políticas de Uso
5249
</Typography>
53-
</Link>
54-
<Link to="/sobre" className={classes.fakeLink}> Sobre </Link>
50+
</FooterFakeLink>
51+
<FooterFakeLink to="/sobre"> Sobre </FooterFakeLink>
5552
</FooterBox>
5653
</Box>
5754
</FooterContainer>
+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
export const styles = () => ({
2+
fakeLink,
3+
});
4+
5+
export const fakeLink = {
6+
'display': 'flex',
7+
'alignItems': 'center',
8+
'justifyContent': 'center',
9+
'color': '#fff',
10+
'marginTop': 2,
11+
'marginBottom': 2,
12+
'cursor': 'pointer',
13+
'&:hover': {
14+
color: 'rgba(255,255,255,.8)',
15+
},
16+
};

0 commit comments

Comments
 (0)