Skip to content

Commit

Permalink
removed react admin
Browse files Browse the repository at this point in the history
Signed-off-by: Abhimanyu <desk.abhimanyu@gmail.com>
  • Loading branch information
abhi1693 committed Sep 29, 2019
1 parent 8225965 commit 1e25ac5
Show file tree
Hide file tree
Showing 11 changed files with 112 additions and 226 deletions.
9 changes: 0 additions & 9 deletions client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,13 @@
"version": "0.0.1",
"private": true,
"dependencies": {
"@material-ui/core": "^4.4.2",
"@material-ui/icons": "^4.4.1",
"axios": "^0.19.0",
"bootstrap": "^4.3.1",
"classnames": "^2.2.6",
"history": "^4.10.1",
"jwt-decode": "^2.2.0",
"prop-types": "^15.7.2",
"query-string": "^6.8.3",
"ra-language-english": "^2.9.3",
"react": "^16.9.0",
"react-admin": "^2.9.6",
"react-bootstrap": "^1.0.0-beta.12",
"react-dom": "^16.9.0",
"react-redux": "^7.1.1",
Expand All @@ -24,12 +19,8 @@
"redux": "^4.0.4",
"redux-form": "^8.2.6",
"redux-logger": "^3.0.6",
"redux-saga": "~0.16.0",
"redux-thunk": "^2.3.0"
},
"devDependencies": {
"ra-data-json-server": "^2.9.6"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
Expand Down
2 changes: 0 additions & 2 deletions client/src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import Landing from "./components/layout/Landing";
import Login from "./components/auth/Login";
import Register from "./components/auth/Register";
import Dashboard from "./components/dashboard/Dashboard";
import Admin from "./components/admin/Admin";
import PrivateRoute from "./components/private-route/PrivateRoute";

class App extends Component {
Expand All @@ -20,7 +19,6 @@ class App extends Component {
<Route exact path="/" component={Landing}/>
<Route exact path="/login/" component={Login}/>
<Route exact path="/register/" component={Register}/>
<Route exact path="/admin/" component={Admin}/>
<Switch>
<PrivateRoute exact path="/dashboard/" component={Dashboard}/>
</Switch>
Expand Down
31 changes: 0 additions & 31 deletions client/src/components/admin/Admin.jsx

This file was deleted.

15 changes: 0 additions & 15 deletions client/src/components/admin/Dashboard.jsx

This file was deleted.

2 changes: 1 addition & 1 deletion client/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import './index.css';
import App from './App';
import * as serviceWorker from './serviceWorker';
import 'bootstrap/dist/css/bootstrap.min.css';
import {store} from "./store";
import store from "./store";
import {Provider} from "react-redux";

ReactDOM.render(
Expand Down
59 changes: 0 additions & 59 deletions client/src/providers/adminAuth.providers.js

This file was deleted.

60 changes: 0 additions & 60 deletions client/src/providers/data.providers.js

This file was deleted.

17 changes: 0 additions & 17 deletions client/src/rootSaga.js

This file was deleted.

46 changes: 16 additions & 30 deletions client/src/store.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,37 +2,23 @@
* Copyright (c) 2019. Abhimanyu Saharan <desk.abhimanyu@gmail.com>
*/

import {applyMiddleware, compose, createStore} from "redux";
import createSagaMiddleware from 'redux-saga';
import {formMiddleware} from 'react-admin';
import {routerMiddleware} from 'react-router-redux';
import {createHashHistory} from 'history';
import rootReducer from "./reducers";
import rootSaga from "./rootSaga";
import {applyMiddleware, compose, createStore} from 'redux';
import thunk from "redux-thunk";
import {logger} from "redux-logger/src";
import rootReducer from './reducers';
import logger from 'redux-logger';

export const adminHistory = createHashHistory();
const appMiddleware = [thunk, logger];
const initialState = {};
const middleware = [thunk, logger];

const configureStore = initialState => {
const sagaMiddleware = createSagaMiddleware();
const store = createStore(
rootReducer,
initialState,
compose(
applyMiddleware(...middleware),
(window.__REDUX_DEVTOOLS_EXTENSION__ &&
window.__REDUX_DEVTOOLS_EXTENSION__()) ||
compose
)
);

const composeEnhancers = (window.__REDUX_DEVTOOLS_EXTENSION__ && window.__REDUX_DEVTOOLS_EXTENSION__()) || compose;

const store = createStore(rootReducer,
initialState,
composeEnhancers(
applyMiddleware(
sagaMiddleware,
formMiddleware,
routerMiddleware(adminHistory),
...appMiddleware
)
)
);
sagaMiddleware.run(rootSaga);
return store;
};

export const store = configureStore();
export default store;
Loading

0 comments on commit 1e25ac5

Please sign in to comment.