Skip to content

Commit

Permalink
Merge pull request #5 from manoj-nama/elements-scaffold
Browse files Browse the repository at this point in the history
Setting up basic routes and scaffold
  • Loading branch information
manoj-nama committed May 28, 2020
2 parents 316d057 + e194d08 commit 8b62813
Show file tree
Hide file tree
Showing 11 changed files with 779 additions and 2,031 deletions.
1,310 changes: 702 additions & 608 deletions package-lock.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"react-dom": "^16.13.1",
"react-redux": "^7.2.0",
"react-router": "^5.2.0",
"react-router-dom": "^5.2.0",
"react-scripts": "3.4.1",
"redux": "^4.0.5"
},
Expand Down
27 changes: 23 additions & 4 deletions src/app/Main.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,30 @@
import React from 'react';
import { Router, Route, Redirect, Switch } from "react-router-dom";
import history from './utils/history';

import {
ElementsCreatePage,
ElementsListPage,
} from './elements';

import {
Header,
} from './components';

const MainApp = () => {
return (
<div className="app">
<p>Hello Main App</p>
</div>
)
<Router history={history}>
<Header />
<Switch>
<Route exact path="/" component={ElementsListPage} />
<Route path="/elements/create" component={ElementsCreatePage} />
<Route path="/elements" component={ElementsListPage} />

{/* No Match */}
<Route render={() => <Redirect to='/elements' />} />
</Switch>
</Router>
);
};

export default MainApp;
12 changes: 12 additions & 0 deletions src/app/components/Header/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import React from 'react';

const Header = () => {
return (
<div>
<h1>EasyAPI</h1>
<p>This is the header</p>
</div>
)
};

export default Header;
1 change: 1 addition & 0 deletions src/app/components/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default as Header } from './Header';
Empty file added src/app/design/index.js
Empty file.
11 changes: 11 additions & 0 deletions src/app/elements/create/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import React from 'react';

const ElementsCreate = () => {
return (
<div>
<p>This is Elements Create page</p>
</div>
)
};

export default ElementsCreate;
2 changes: 2 additions & 0 deletions src/app/elements/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export { default as ElementsCreatePage } from './create';
export { default as ElementsListPage } from './list';
11 changes: 11 additions & 0 deletions src/app/elements/list/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import React from 'react';

const ElementsList = () => {
return (
<div>
<p>This is Elements List page</p>
</div>
)
};

export default ElementsList;
3 changes: 3 additions & 0 deletions src/app/utils/history.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import { createBrowserHistory } from 'history';

export default createBrowserHistory({});
1,432 changes: 13 additions & 1,419 deletions yarn.lock

Large diffs are not rendered by default.

0 comments on commit 8b62813

Please sign in to comment.