-
Notifications
You must be signed in to change notification settings - Fork 151
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
sorted the imports and routes according to path length
- Loading branch information
1 parent
b7e9096
commit d9ff68f
Showing
2 changed files
with
111 additions
and
111 deletions.
There are no files selected for viewing
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,71 +1,71 @@ | ||
import React from 'react'; | ||
import { Link } from 'react-router-dom'; | ||
import styled from 'styled-components'; | ||
|
||
const Wrapper = styled.div` | ||
display: flex; | ||
flex-direction: column; | ||
align-items: center; | ||
position: absolute; | ||
top: 0; | ||
right: 0; | ||
bottom: 0; | ||
left: 0; | ||
background: #fefefe; | ||
`; | ||
|
||
const List = styled.ul` | ||
display: flex; | ||
flex-direction: column; | ||
width: 500px; | ||
padding: 15px; | ||
border: 1px solid #d8d8d8; | ||
list-style: none; | ||
text-align: left; | ||
`; | ||
|
||
const ListItem = styled.li` | ||
display: flex; | ||
flex-direction: column; | ||
align-items: center; | ||
width: 100%; | ||
background: #fff; | ||
border-bottom: 1px solid #7f7f7f; | ||
cursor: pointer; | ||
&:last-child { | ||
border-bottom: none; | ||
} | ||
`; | ||
|
||
const StyledLink = styled(Link)` | ||
width: 100%; | ||
padding: 15px 15px 15px 0; | ||
color: #000000; | ||
text-decoration: none; | ||
text-align: center; | ||
`; | ||
|
||
const defaultPath = process.env.REACT_APP_BASE_PATH; | ||
|
||
const Home = () => ( | ||
<Wrapper> | ||
<h1>google-map-react examples</h1> | ||
<List> | ||
<ListItem> | ||
<StyledLink to={`${defaultPath}default`}>Default</StyledLink> | ||
</ListItem> | ||
<ListItem> | ||
<StyledLink to={`${defaultPath}searchbox`}>SearchBox</StyledLink> | ||
</ListItem> | ||
<ListItem> | ||
<StyledLink to={`${defaultPath}autocomplete`}>Autocomplete</StyledLink> | ||
</ListItem> | ||
<ListItem> | ||
<StyledLink to={`${defaultPath}heatmap`}>Heatmap</StyledLink> | ||
</ListItem> | ||
</List> | ||
</Wrapper> | ||
); | ||
|
||
export default Home; | ||
import React from 'react'; | ||
import { Link } from 'react-router-dom'; | ||
import styled from 'styled-components'; | ||
|
||
const Wrapper = styled.div` | ||
display: flex; | ||
flex-direction: column; | ||
align-items: center; | ||
position: absolute; | ||
top: 0; | ||
right: 0; | ||
bottom: 0; | ||
left: 0; | ||
background: #fefefe; | ||
`; | ||
|
||
const List = styled.ul` | ||
display: flex; | ||
flex-direction: column; | ||
width: 500px; | ||
padding: 15px; | ||
border: 1px solid #d8d8d8; | ||
list-style: none; | ||
text-align: left; | ||
`; | ||
|
||
const ListItem = styled.li` | ||
display: flex; | ||
flex-direction: column; | ||
align-items: center; | ||
width: 100%; | ||
background: #fff; | ||
border-bottom: 1px solid #7f7f7f; | ||
cursor: pointer; | ||
&:last-child { | ||
border-bottom: none; | ||
} | ||
`; | ||
|
||
const StyledLink = styled(Link)` | ||
width: 100%; | ||
padding: 15px 15px 15px 0; | ||
color: #000000; | ||
text-decoration: none; | ||
text-align: center; | ||
`; | ||
|
||
const defaultPath = process.env.REACT_APP_BASE_PATH; | ||
|
||
const Home = () => ( | ||
<Wrapper> | ||
<h1>google-map-react examples</h1> | ||
<List> | ||
<ListItem> | ||
<StyledLink to={`${defaultPath}default`}>Default</StyledLink> | ||
</ListItem> | ||
<ListItem> | ||
<StyledLink to={`${defaultPath}heatmap`}>Heatmap</StyledLink> | ||
</ListItem> | ||
<ListItem> | ||
<StyledLink to={`${defaultPath}searchbox`}>SearchBox</StyledLink> | ||
</ListItem> | ||
<ListItem> | ||
<StyledLink to={`${defaultPath}autocomplete`}>Autocomplete</StyledLink> | ||
</ListItem> | ||
</List> | ||
</Wrapper> | ||
); | ||
|
||
export default Home; |
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,40 +1,40 @@ | ||
import React from 'react'; | ||
import ReactDOM from 'react-dom'; | ||
import { Route, Switch, Redirect, BrowserRouter as Router } from 'react-router-dom'; | ||
|
||
// examples: | ||
import Home from './Home'; | ||
import Main from './examples/Main'; | ||
import SearchBox from './examples/Searchbox'; | ||
import Autocomplete from './examples/Autocomplete'; | ||
import Heatmap from './examples/Heatmap'; | ||
|
||
// styles | ||
import './index.css'; | ||
|
||
// components | ||
import App from './App'; | ||
|
||
// utils | ||
import registerServiceWorker from './registerServiceWorker'; | ||
|
||
const defaultPath = process.env.REACT_APP_BASE_PATH; | ||
|
||
ReactDOM.render( | ||
<Router> | ||
<App> | ||
<Switch> | ||
<Route exact path={defaultPath} component={Home} /> | ||
{/* New examples here */} | ||
<Route path={`${defaultPath}default`} component={Main} /> | ||
<Route path={`${defaultPath}searchbox`} component={SearchBox} /> | ||
<Route path={`${defaultPath}autocomplete`} component={Autocomplete} /> | ||
<Route path={`${defaultPath}heatmap`} component={Heatmap} /> | ||
<Redirect exact from="*" to={defaultPath} /> | ||
</Switch> | ||
</App> | ||
</Router>, | ||
document.getElementById('root'), | ||
); | ||
|
||
registerServiceWorker(); | ||
import React from 'react'; | ||
import ReactDOM from 'react-dom'; | ||
import { Route, Switch, Redirect, BrowserRouter as Router } from 'react-router-dom'; | ||
|
||
// examples: | ||
import Home from './Home'; | ||
import Main from './examples/Main'; | ||
import Heatmap from './examples/Heatmap'; | ||
import SearchBox from './examples/Searchbox'; | ||
import Autocomplete from './examples/Autocomplete'; | ||
|
||
// styles | ||
import './index.css'; | ||
|
||
// components | ||
import App from './App'; | ||
|
||
// utils | ||
import registerServiceWorker from './registerServiceWorker'; | ||
|
||
const defaultPath = process.env.REACT_APP_BASE_PATH; | ||
|
||
ReactDOM.render( | ||
<Router> | ||
<App> | ||
<Switch> | ||
<Route exact path={defaultPath} component={Home} /> | ||
{/* New examples here */} | ||
<Route path={`${defaultPath}default`} component={Main} /> | ||
<Route path={`${defaultPath}heatmap`} component={Heatmap} /> | ||
<Route path={`${defaultPath}searchbox`} component={SearchBox} /> | ||
<Route path={`${defaultPath}autocomplete`} component={Autocomplete} /> | ||
<Redirect exact from="*" to={defaultPath} /> | ||
</Switch> | ||
</App> | ||
</Router>, | ||
document.getElementById('root'), | ||
); | ||
|
||
registerServiceWorker(); |