-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5 from manoj-nama/elements-scaffold
Setting up basic routes and scaffold
- Loading branch information
Showing
11 changed files
with
779 additions
and
2,031 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export { default as Header } from './Header'; |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import { createBrowserHistory } from 'history'; | ||
|
||
export default createBrowserHistory({}); |