Skip to content

Commit 475087d

Browse files
committed
added images example
1 parent 9ae82d9 commit 475087d

File tree

7 files changed

+50
-12
lines changed

7 files changed

+50
-12
lines changed

config/assets/social-sprite.png

32.1 KB
Loading

src/App.js

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,7 @@ const App = ({
3535
<div>
3636
<GlobalStyles theme={theme} />
3737
<Router>
38-
{/*
39-
Please update the code as your project requirements
40-
*/}
38+
{/* Please update the code below for your project requirements */}
4139
<div>
4240
<ul>
4341
<li>
@@ -50,7 +48,7 @@ const App = ({
5048
<Link to="/topics">Topics</Link>
5149
</li>
5250
<li>
53-
<Link to="/404">404</Link>
51+
<Link to="/link-does-not-exist">404</Link>
5452
</li>
5553
</ul>
5654

@@ -80,6 +78,11 @@ const App = ({
8078
))
8179
}
8280
</ul>
81+
82+
<hr />
83+
84+
<h3>Images from simply from: <code>~./assets/[image]</code></h3>
85+
<img src="/assets/social-sprite.png" alt="social icon sprites" />
8386
</div>
8487
</Router>
8588
</div>

src/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<meta charset="UTF-8">
55
<meta name="viewport" content="width=device-width, initial-scale=1.0">
66
<meta http-equiv="X-UA-Compatible" content="ie=edge">
7-
<title>fluidEx</title>
7+
<title>React base code</title>
88
<style data-styled-components="true"></style>
99
<link href="https://fonts.googleapis.com/css?family=Open+Sans|Roboto+Mono|Slabo+27px" rel="stylesheet">
1010
</head>

src/store/__tests__/session.spec.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import themes from '../data/session';
2+
3+
describe('session reducer', () => {
4+
it('should return the initial state', () => {
5+
expect(themes(undefined, {})).toEqual({});
6+
});
7+
8+
it('should return user session', () => {
9+
expect(themes({}, {
10+
type: 'FILL',
11+
})).toEqual({
12+
uid: 10001,
13+
name: 'user',
14+
});
15+
});
16+
});

src/store/__tests__/themes.spec.js

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import themes, { initalState } from '../data/themes';
2+
3+
describe('theme reducer', () => {
4+
it('should return the initial state', () => {
5+
expect(themes(undefined, {})).toBe(initalState);
6+
});
7+
8+
it('should return with white theme selected', () => {
9+
expect(themes(initalState, {
10+
type: 'CHANGE_THEME',
11+
id: 'white_theme',
12+
}).selected.id).toBe('white_theme');
13+
});
14+
15+
it('should return with black theme selected', () => {
16+
expect(themes(initalState, {
17+
type: 'CHANGE_THEME',
18+
id: 'dark_theme',
19+
}).selected.id).toBe('dark_theme');
20+
});
21+
});

src/store/data/session.js

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
1-
const session = {
2-
uid: 10001,
3-
name: 'user',
4-
};
5-
61
export default (state = {}, action) => {
72
switch (action.type) {
83
case 'FILL':
9-
return { ...session };
4+
return {
5+
uid: 10001,
6+
name: 'user',
7+
};
108

119
default:
1210
return state;

src/store/data/themes.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ const data = [{
66
name: 'Dark',
77
}];
88
const selected = data[0];
9-
const initalState = {
9+
export const initalState = {
1010
data,
1111
selected,
1212
};

0 commit comments

Comments
 (0)