-
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.
- Loading branch information
1 parent
314564c
commit 7e0eed1
Showing
47 changed files
with
3,101 additions
and
102 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
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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
root = true | ||
|
||
[*] | ||
indent_style = space | ||
indent_size = 2 | ||
end_of_line = lf | ||
charset = utf-8 | ||
trim_trailing_whitespace = true | ||
insert_final_newline = false |
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 @@ | ||
ANALYZER=false | ||
REACT_APP_BASENAME= |
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 @@ | ||
ANALYZER=true | ||
PUBLICR_URL= | ||
REACT_APP_BASENAME= |
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file was deleted.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,62 @@ | ||
import React from 'react'; | ||
import logo from './logo.svg'; | ||
import './App.css'; | ||
import { Suspense } from 'react' | ||
import { Route, Switch } from 'react-router-dom' | ||
import { Layout } from 'antd' | ||
import ErrorBoundary from '@components/ErrorBoundary' | ||
import Exception from '@components/Exception' | ||
import Sider from '@components/Sider' | ||
import Loading from '@components/Loading' | ||
import Home from '@pages/Home' | ||
import { routes, RouteProps } from '@lib/routes' | ||
|
||
function App() { | ||
const renderRoute = (route: RouteProps) => { | ||
if (!route.Component || !route.url) { | ||
return null | ||
} | ||
|
||
return ( | ||
<Route | ||
key={route.key} | ||
exact={route.exact} | ||
component={route.Component} | ||
path={route.url} | ||
/> | ||
) | ||
} | ||
|
||
const _routes = routes | ||
.map(r => (r.children ? r.children.map(renderRoute) : renderRoute(r))) | ||
.reduce((result: any[], route) => { | ||
if (!route) { | ||
return result | ||
} | ||
if (Array.isArray(route)) { | ||
return [...result, ...route.filter(Boolean)] | ||
} | ||
|
||
result.push(route) | ||
|
||
return result | ||
}, []) | ||
|
||
return ( | ||
<div className="App"> | ||
<header className="App-header"> | ||
<img src={logo} className="App-logo" alt="logo" /> | ||
<p> | ||
Edit <code>src/App.tsx</code> and save to reload. | ||
</p> | ||
<a | ||
className="App-link" | ||
href="https://reactjs.org" | ||
target="_blank" | ||
rel="noopener noreferrer" | ||
> | ||
Learn React | ||
</a> | ||
</header> | ||
</div> | ||
); | ||
<ErrorBoundary> | ||
<Layout> | ||
<Sider /> | ||
<Layout className="ml-200"> | ||
<Layout.Content> | ||
<Suspense fallback={<Loading />}> | ||
<Switch> | ||
<Route exact path="/" component={Home} /> | ||
{_routes} | ||
<Route component={Exception} /> | ||
</Switch> | ||
</Suspense> | ||
</Layout.Content> | ||
</Layout> | ||
</Layout> | ||
</ErrorBoundary> | ||
) | ||
} | ||
|
||
export default App; | ||
export default App |
Oops, something went wrong.