Skip to content

Commit 9bafa71

Browse files
#3 Creating the Store
1 parent 471c3a1 commit 9bafa71

File tree

16 files changed

+262
-11
lines changed

16 files changed

+262
-11
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
"dependencies": {
66
"react": "^16.3.2",
77
"react-dom": "^16.3.2",
8+
"react-fontawesome": "^1.6.1",
89
"react-scripts": "1.1.4",
910
"styled-components": "^3.2.6",
1011
"styled-flex-component": "^2.2.2",

public/index.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
-->
1212
<link rel="manifest" href="%PUBLIC_URL%/manifest.json">
1313
<link rel="shortcut icon" href="%PUBLIC_URL%/favicon.ico">
14+
<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet" />
1415
<!--
1516
Notice the use of %PUBLIC_URL% in the tags above.
1617
It will be replaced with the URL of the `public` folder during the build.

src/App.js

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

src/Components/App/AppContainer.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import React, { Component } from "react";
2+
import AppPresenter from "./AppPresenter";
3+
import Store from "store";
4+
5+
class AppContainer extends Component {
6+
render() {
7+
return (
8+
<Store.Provider>
9+
<AppPresenter />
10+
</Store.Provider>
11+
);
12+
}
13+
}
14+
15+
export default AppContainer;

src/Components/App/AppPresenter.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import React, { Fragment } from "react";
2+
import Header from "Components/Header";
3+
import Flex from "styled-flex-component";
4+
import Notification from "Components/Notification";
5+
6+
const AppPresenter = () => (
7+
<Fragment>
8+
<Header />
9+
<Flex alignCenter full column>
10+
<Notification text={"Hello"} seen={false} />
11+
</Flex>
12+
</Fragment>
13+
);
14+
15+
export default AppPresenter;

src/Components/App/index.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
import AppContainer from "./AppContainer";
2+
export default AppContainer;
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import React, { Component } from "react";
2+
import HeaderPresenter from "./HeaderPresenter";
3+
4+
class HeaderContainer extends Component {
5+
static propTypes = {};
6+
state = {};
7+
render() {
8+
return <HeaderPresenter {...this.state} />;
9+
}
10+
}
11+
12+
export default HeaderContainer;
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
import React from "react";
2+
import styled from "styled-components";
3+
import Flex, { FlexItem } from "styled-flex-component";
4+
import FontAwesome from "react-fontawesome";
5+
6+
const Header = styled.header`
7+
height: 100px;
8+
background-color: #ecf0f1;
9+
padding: 0 40px;
10+
margin-bottom: 30px;
11+
`;
12+
13+
const HeaderIcon = styled.span`
14+
width: 40px;
15+
height: 40px;
16+
justify-content: center;
17+
align-items: center;
18+
display: flex;
19+
border-radius: 50%;
20+
color: white;
21+
background-color: #3498db;
22+
margin-right: 30px;
23+
cursor: pointer;
24+
box-shadow: 0 4px 6px rgba(50, 50, 93, 0.11), 0 1px 3px rgba(0, 0, 0, 0.08);
25+
transition: all 0.2s ease-out;
26+
position: relative;
27+
&:hover {
28+
transform: translateY(-1px);
29+
box-shadow: 0 7px 14px rgba(50, 50, 93, 0.1), 0 3px 6px rgba(0, 0, 0, 0.08);
30+
}
31+
`;
32+
33+
const Number = styled.span`
34+
height: 30px;
35+
width: 30px;
36+
border-radius: 50%;
37+
background-color: #8e44ad;
38+
position: absolute;
39+
display: flex;
40+
align-items: center;
41+
justify-content: center;
42+
left: 25px;
43+
top: -10px;
44+
`;
45+
46+
const HeaderPresenter = () => (
47+
<Header>
48+
<Flex full justifyBetween alignCenter>
49+
<FlexItem>
50+
<h3>Antiredux</h3>
51+
</FlexItem>
52+
<FlexItem>
53+
<Flex>
54+
<HeaderIcon>
55+
<FontAwesome name="user" />
56+
</HeaderIcon>
57+
<HeaderIcon>
58+
<FontAwesome name="cog" />
59+
</HeaderIcon>
60+
<HeaderIcon>
61+
<FontAwesome name="bell" />
62+
<Number>10</Number>
63+
</HeaderIcon>
64+
</Flex>
65+
</FlexItem>
66+
</Flex>
67+
</Header>
68+
);
69+
70+
export default HeaderPresenter;

src/Components/Header/index.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
import HeaderContainer from "./HeaderContainer";
2+
export default HeaderContainer;
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import React, { Component } from "react";
2+
import NotificationPresenter from "./NotificationPresenter";
3+
4+
class NotificationContainer extends Component {
5+
static propTypes = {};
6+
state = {};
7+
render() {
8+
return <NotificationPresenter {...this.props} {...this.state} />;
9+
}
10+
}
11+
12+
export default NotificationContainer;

0 commit comments

Comments
 (0)