Skip to content

Commit a0dd99d

Browse files
committed
deleted a lot of fluff
1 parent 7c8f1f9 commit a0dd99d

14 files changed

Lines changed: 28 additions & 239 deletions

File tree

app/templates/_package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@
4646
"normalizr": "^1.3.1",
4747
"react": "^0.14.0-rc1",
4848
"react-dom": "0.14.0-rc1",
49-
"react-highcharts": "^4.0.0",
5049
"react-redux": "^4.0.0",
5150
"react-router": "^1.0.0-rc1",
5251
"redux": "^3.0.4",

app/templates/src/common/components/Footer/Footer.js

Lines changed: 12 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,33 +2,28 @@ import React, { PropTypes, Component } from 'react';
22
import styles from './Footer.scss';
33
import withStyles from '../../../common/decorators/withStyles';
44
import withViewport from '../../../common/decorators/withViewport';
5-
import {Link} from 'react-router';
65

7-
// @withViewport
6+
@withViewport
87
class Footer extends Component {
98

10-
// static propTypes = {
11-
// viewport: PropTypes.shape({
12-
// width: PropTypes.number.isRequired,
13-
// height: PropTypes.number.isRequired
14-
// }).isRequired
15-
// };
9+
static propTypes = {
10+
viewport: PropTypes.shape({
11+
width: PropTypes.number.isRequired,
12+
height: PropTypes.number.isRequired
13+
}).isRequired
14+
};
1615

1716
render() {
1817
// This is just an example how one can render CSS
19-
// let { width, height } = this.props.viewport;x
20-
// this.renderCss(`.Footer-viewport:after {content:' ${width}x${height}';}`);
21-
// <span className="Footer-spacer"> | </span>
22-
// <span ref="viewport" className="Footer-viewport Footer-text Footer-text--muted">Viewport:</span>
18+
let { width, height } = this.props.viewport;
19+
this.renderCss(`.Footer-viewport:after {content:' ${width}x${height}';}`);
2320

2421
return (
2522
<div className="Footer">
2623
<div className="Footer-container">
27-
<span className="Footer-text">© Inform, Inc. 2015</span>
28-
<span className="Footer-spacer">·</span>
29-
<Link className="Footer-link" to="/">
30-
<span>Home</span>
31-
</Link>
24+
<span className="Footer-text">React & Redux Generator, 2015</span>
25+
<span className="Footer-spacer"> | </span>
26+
<span ref="viewport" className="Footer-viewport Footer-text Footer-text--muted">Viewport:</span>
3227
</div>
3328
</div>
3429
);

app/templates/src/common/components/Header/Header.js

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,36 +7,23 @@ class Header extends Component {
77

88
static propTypes = {
99
username: PropTypes.string,
10-
logoutUser: PropTypes.func.isRequired,
1110
};
1211

1312
constructor(props) {
1413
super(props);
15-
this._logout = this._logout.bind(this);
16-
}
17-
18-
_logout(event) {
19-
event.preventDefault();
20-
this.props.logoutUser();
2114
}
2215

2316
render() {
2417
return (
2518
<div className="Header">
2619
<div className="Header-brand">
2720
<Link to="/">
28-
<span className="Header-brandTxt" id="header-brand-text">INFORM&#8482;</span>
21+
<span className="Header-brandTxt" id="header-brand-text">Logo</span>
2922
</Link>
3023
</div>
3124
<div className='Navigation' role='navigation'>
3225
<Link className='Navigation-link' to='/about' >About</Link>
3326
<span className='Navigation-spacer'> | </span>
34-
<div className='Navigation-user'>
35-
<span>Welcome, </span>
36-
<span className='Navigation-user--username'>{this.props.username}</span>
37-
<span className='Navigation-spacer'> | </span>
38-
<a className='Navigation-link Navigation-user--logout' onClick={this._logout}>Logout</a>
39-
</div>
4027
</div>
4128
<div className="clear-float"></div>
4229
</div>

app/templates/src/common/components/LineChart/LineChart.js

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

app/templates/src/common/components/LineChart/LineChart.scss

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

app/templates/src/common/components/LineChart/package.json

Lines changed: 0 additions & 6 deletions
This file was deleted.
Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
import { combineReducers } from 'redux';
22
import { routerStateReducer as router } from 'redux-router';
3-
import auth from '../../auth/reducers/auth';
43

54
const rootReducer = combineReducers({
6-
router,
7-
auth
5+
router
86
});
97

108
export default rootReducer;

app/templates/src/containers/AboutPage/AboutPage.js

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import React, { PropTypes, Component } from 'react';
22
import styles from './AboutPage.scss';
3-
import LineChart from '../../common/components/LineChart';
43

54
class AboutPage extends Component {
65

@@ -11,26 +10,6 @@ class AboutPage extends Component {
1110
render() {
1211
let title = 'About Us';
1312
this.context.onSetTitle(title);
14-
const data = [
15-
[Date.UTC(2014, 9, 21), 0],
16-
[Date.UTC(2014, 10, 4), 0.28],
17-
[Date.UTC(2014, 10, 9), 0.25],
18-
[Date.UTC(2014, 10, 27), 0.2],
19-
[Date.UTC(2014, 11, 2), 0.28],
20-
[Date.UTC(2014, 11, 26), 0.28],
21-
[Date.UTC(2014, 11, 29), 0.47],
22-
[Date.UTC(2015, 0, 11), 0.79],
23-
[Date.UTC(2015, 0, 26), 0.72],
24-
[Date.UTC(2015, 1, 3), 1.02],
25-
[Date.UTC(2015, 1, 11), 1.12],
26-
[Date.UTC(2015, 1, 25), 1.2],
27-
[Date.UTC(2015, 2, 11), 1.18],
28-
[Date.UTC(2015, 3, 11), 1.19],
29-
[Date.UTC(2015, 4, 1), 1.85],
30-
[Date.UTC(2015, 4, 5), 2.22],
31-
[Date.UTC(2015, 4, 19), 1.15],
32-
[Date.UTC(2015, 5, 3), 0]
33-
];
3413

3514
return (
3615
<div className="AboutPage">
@@ -39,8 +18,6 @@ class AboutPage extends Component {
3918
<p>
4019
"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."
4120
</p>
42-
<h2 className='LineChart-Title'>Annual Revenue over Time</h2>
43-
<LineChart series={data} yAxisTitle='Revenue' />
4421
</div>
4522
</div>
4623
);

app/templates/src/containers/App/App.js

Lines changed: 6 additions & 82 deletions
Original file line numberDiff line numberDiff line change
@@ -3,109 +3,33 @@ import { bindActionCreators } from 'redux';
33
import { connect } from 'react-redux';
44
import styles from './App.scss';
55
import withContext from '../../common/decorators/withContext';
6-
import { pushState } from 'redux-router';
76
import Header from '../../common/components/Header';
87
import Footer from '../../common/components/Footer';
9-
import * as LoginActions from '../../auth/actions/LoginActions';
108

119
@withContext
12-
class App extends Component {
10+
export default class App extends Component {
1311

1412
static propTypes = {
1513
children: PropTypes.element.isRequired,
1614
error: PropTypes.object,
1715
history: PropTypes.object.isRequired,
1816
routes: PropTypes.array,
1917
params: PropTypes.object,
20-
auth: PropTypes.object.isRequired,
21-
authActions: React.PropTypes.object.isRequired,
22-
pushState: PropTypes.func.isRequired,
2318
};
2419

2520
constructor() {
2621
super();
2722
}
2823

29-
componentWillMount() {
30-
this.initializeAuthentication();
31-
}
32-
33-
componentWillUpdate(nextProps) {
34-
const routeName = nextProps.routes[this.props.routes.length - 1].name;
35-
36-
if (!nextProps.auth.authStatus.authenticated && routeName !== 'reset_password') {
37-
this.goToLogin();
38-
}
39-
}
40-
41-
initializeAuthentication() {
42-
const token = localStorage.getItem('jwt');
43-
const routeName = this.props.routes[this.props.routes.length - 1].name;
44-
const resetToken = this.props.params.token;
45-
46-
if (this.props.auth.authStatus.authenticated) {
47-
// Don't have to do anything here
48-
} else if (token) {
49-
// CASE: Local storage token found
50-
console.info(token);
51-
} else if (routeName === 'reset_password' && resetToken) {
52-
// CASE: Reset password
53-
this.goToResetPassword(resetToken);
54-
} else {
55-
// CASE: no authentication
56-
this.goToLogin();
57-
}
58-
}
59-
60-
goToLogin() {
61-
this.props.pushState(null, '/login');
62-
}
63-
64-
goToResetPassword(token) {
65-
this.props.pushState(null, '/reset_password/' + token);
66-
}
67-
6824
render() {
69-
const { authActions } = this.props;
70-
71-
let page;
72-
if (!this.props.auth.authStatus.authenticated) {
73-
page = (
74-
<div>
75-
{this.props.children}
76-
</div>
77-
);
78-
} else {
79-
page = (
80-
<div>
81-
<Header username={this.props.auth.user.username} logoutUser={authActions.logoutUser} />
82-
<div className='content'>
83-
{this.props.children}
84-
</div>
85-
<Footer />
86-
</div>
87-
)
88-
}
8925
return (
9026
<div className='wrapper'>
91-
{page}
27+
<Header />
28+
<div className='content'>
29+
{this.props.children}
30+
</div>
31+
<Footer />
9232
</div>
9333
);
9434
}
95-
9635
}
97-
98-
function mapState(state) {
99-
return {
100-
auth: state.auth
101-
};
102-
}
103-
104-
function mapDispatch(dispatch) {
105-
return {
106-
authActions: bindActionCreators(LoginActions, dispatch),
107-
pushState: bindActionCreators(pushState, dispatch),
108-
};
109-
}
110-
111-
export default connect(mapState, mapDispatch)(App);

app/templates/src/containers/Dashboard/package.json

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

0 commit comments

Comments
 (0)