Skip to content

Commit 110d2ae

Browse files
authored
Merge pull request #1 from rhove/feature/add-styled-components
Added Styled-Components to Code Challenge
2 parents 98e7324 + dc029e0 commit 110d2ae

8 files changed

Lines changed: 134 additions & 20 deletions

File tree

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ The requirements for your application are as follows:
2424
4) Comics are sorted by date with the most recent comics first.
2525
5) Includes a checkbox that, when checked, sorts the comic strips by date so the least recent comics are first.
2626
6) When the checkbox is unchecked, the comics revert to most recent first.
27+
7) Styling for the page is done using using the [styled-components](https://www.styled-components.com/) library.
2728

2829

2930
## Evaluation Criteria
@@ -34,6 +35,7 @@ The requirements for your application are as follows:
3435
* `npm i` downloads all dependencies.
3536
* `npm start` runs the application.
3637
* React components are organized into separate files.
38+
* Styling is used to enhance the page, and done so in reusable components.
3739
* No console errors.
3840
* Meets the challenge requirements.
3941

package-lock.json

Lines changed: 102 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
"dependencies": {
66
"react": "^16.9.0",
77
"react-dom": "^16.9.0",
8-
"react-scripts": "3.1.1"
8+
"react-scripts": "3.1.1",
9+
"styled-components": "^4.4.0"
910
},
1011
"scripts": {
1112
"start": "react-scripts start",

src/App.css

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

src/App.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
11
import React from 'react';
2-
import './App.css';
2+
import GlobalStyle from './style'
33

44
function App() {
5-
return <p>Your code goes here!</p>;
5+
return (
6+
<div>
7+
<GlobalStyle />
8+
<p>Your code goes here!</p>
9+
</div>
10+
);
611
}
712

813
export default App;

src/index.css

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

src/index.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import React from 'react';
22
import ReactDOM from 'react-dom';
3-
import './index.css';
43
import App from './App';
54

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

src/style.js

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import { createGlobalStyle } from 'styled-components';
2+
3+
const GlobalStyle = createGlobalStyle`
4+
body {
5+
margin: 0;
6+
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
7+
'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
8+
sans-serif;
9+
-webkit-font-smoothing: antialiased;
10+
-moz-osx-font-smoothing: grayscale;
11+
}
12+
code {
13+
font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',
14+
monospace;
15+
}
16+
p {
17+
font-weight: bold;
18+
}
19+
`;
20+
21+
export default GlobalStyle;

0 commit comments

Comments
 (0)