Skip to content

Commit 5a8d8a3

Browse files
Dependecies updated, removed signin page, removed redux-form
1 parent 6b95562 commit 5a8d8a3

File tree

10 files changed

+87
-220
lines changed

10 files changed

+87
-220
lines changed

client/package.json

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,24 +3,28 @@
33
"version": "0.1.0",
44
"private": true,
55
"dependencies": {
6-
"@material-ui/core": "^1.4.1",
7-
"@material-ui/icons": "^2.0.0",
8-
"react": "16.4.1",
9-
"react-dom": "16.4.1",
10-
"react-redux": "5.0.7",
11-
"react-router": "4.3.1",
12-
"react-router-dom": "4.3.1",
13-
"react-scripts": "1.1.4",
14-
"recharts": "^1.1.0",
15-
"redux": "4.0.0",
16-
"redux-form": "^7.4.2",
17-
"redux-logger": "^3.0.6",
6+
"@material-ui/core": "3.9.3",
7+
"@material-ui/icons": "3.0.2",
8+
"react": "16.8.6",
9+
"react-dom": "16.8.6",
10+
"react-redux": "6.0.1",
11+
"react-router": "5.0.0",
12+
"react-router-dom": "5.0.0",
13+
"react-scripts": "2.1.8",
14+
"redux": "4.0.1",
15+
"redux-logger": "3.0.6",
1816
"redux-thunk": "2.3.0"
1917
},
2018
"scripts": {
2119
"start": "react-scripts start",
2220
"build": "react-scripts build",
2321
"test": "react-scripts test --env=jsdom",
2422
"eject": "react-scripts eject"
25-
}
23+
},
24+
"browserslist": [
25+
">0.2%",
26+
"not dead",
27+
"not ie <= 11",
28+
"not op_mini all"
29+
]
2630
}

client/src/App.js

Lines changed: 8 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,15 @@
11
import React, { Component } from "react";
2-
import PropTypes from "prop-types";
32
import {
43
BrowserRouter as Router,
54
Route,
6-
Switch,
7-
Redirect
5+
Switch
86
} from "react-router-dom";
97
import CssBaseline from "@material-ui/core/CssBaseline";
108
import { MuiThemeProvider } from "@material-ui/core/styles";
119
import { connect } from "react-redux";
1210

1311
import Home from "./containers/Home";
1412
import Setting from "./containers/Setting";
15-
import Signin from "./containers/Signin";
1613

1714
import MainLayout from "./layouts/MainLayout";
1815
import EmptyLayout from "./layouts/EmptyLayout";
@@ -48,45 +45,30 @@ const EmptyRoute = ({ component: Component, ...rest }) => {
4845
};
4946

5047
class App extends Component {
51-
state = {
52-
auth: false
53-
};
54-
5548
render() {
56-
const { settings, auth } = this.props;
49+
const { settings } = this.props;
5750

5851
return (
5952
<MuiThemeProvider theme={settings.theme}>
6053
<CssBaseline />
6154
<div style={{ height: "100vh" }}>
6255
<Router>
63-
{auth.authenticate ? (
64-
<Switch>
65-
<DashboardRoute path="/dashboard" component={Home} />
66-
<DashboardRoute path="/setting" component={Setting} />
67-
<Route path="/signin" render={() => <Redirect to="/" />} />
68-
<DashboardRoute exact path="/" component={Home} />
69-
<EmptyRoute component={NotFound} />
70-
</Switch>
71-
) : (
72-
<Switch>
73-
<EmptyRoute path="/signin" component={Signin} />
74-
<Redirect to="/signin" />
75-
</Switch>
76-
)}
56+
<Switch>
57+
<DashboardRoute path="/dashboard" component={Home} />
58+
<DashboardRoute path="/setting" component={Setting} />
59+
<DashboardRoute exact path="/" component={Home} />
60+
<EmptyRoute component={NotFound} />
61+
</Switch>
7762
</Router>
7863
</div>
7964
</MuiThemeProvider>
8065
);
8166
}
8267
}
8368

84-
App.propTypes = {};
85-
8669
const mapStateToProps = state => {
8770
return {
8871
settings: state.settings,
89-
auth: state.auth
9072
};
9173
};
9274

client/src/components/Header/Header.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ const Header = props => {
4848
<NotificationsIcon />
4949
</Badge>
5050
</IconButton>
51-
<IconButton onClick={props.logout} color="inherit">
51+
<IconButton color="inherit">
5252
<PersonIcon />
5353
</IconButton>
5454
</Toolbar>

client/src/components/Signin/form.js

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

client/src/components/Signin/index.js

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

client/src/containers/Signin.js

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

client/src/layouts/MainLayout.js

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,9 @@
11
import React, { Fragment, Component } from "react";
22
import { withStyles } from "@material-ui/core/styles";
33
import classNames from "classnames";
4-
import { connect } from "react-redux";
5-
import { bindActionCreators } from "redux";
64

75
import Header from "../components/Header";
86
import Sidebar from "../components/Sidebar";
9-
import { logout } from "../store/reducers/authenticate";
107

118
const drawerWidth = 240;
129

@@ -48,7 +45,6 @@ class MainLayout extends Component {
4845
<Fragment>
4946
<div className={classes.root}>
5047
<Header
51-
logout={this.props.logout}
5248
handleToggleDrawer={this.handleToggleDrawer}
5349
/>
5450
<main
@@ -65,16 +61,4 @@ class MainLayout extends Component {
6561
}
6662
}
6763

68-
const mapDispatchToProps = dispatch => {
69-
return bindActionCreators(
70-
{
71-
logout: () => logout()
72-
},
73-
dispatch
74-
);
75-
};
76-
77-
export default connect(
78-
null,
79-
mapDispatchToProps
80-
)(withStyles(styles)(MainLayout));
64+
export default withStyles(styles)(MainLayout);

client/src/store/reducers/authenticate.js

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

client/src/store/reducers/index.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,10 @@
11
import stepCounter from "./stepCounter";
22
import settings from "./settings";
3-
import auth from "./authenticate";
43
import { combineReducers } from "redux";
5-
import { reducer as formReducer } from "redux-form";
64

75
const reducers = combineReducers({
86
stepCounter,
9-
settings,
10-
auth,
11-
form: formReducer
7+
settings
128
});
139

1410
export default reducers;

0 commit comments

Comments
 (0)