Skip to content

Commit e40f2f1

Browse files
committed
Refactoring
1 parent cc8fdad commit e40f2f1

File tree

2 files changed

+11
-18
lines changed

2 files changed

+11
-18
lines changed

src/App.tsx

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,20 @@
11
import React from 'react';
2-
import { BrowserRouter as Router } from 'react-router-dom';
3-
import { observer } from 'mobx-react';
2+
import { BrowserRouter } from 'react-router-dom';
43

54
import Main from './screens/Main';
65
import 'antd/dist/antd.less';
76
import './App.global.less';
87

9-
export default observer(() => {
8+
const App = () => {
109
// useEffect(() => {
1110
// Sentry.captureException(new Error(`${process.env.NODE_ENV} exception`));
1211
// }, []);
1312

1413
return (
15-
<Router>
14+
<BrowserRouter>
1615
<Main />
17-
</Router>
16+
</BrowserRouter>
1817
);
19-
});
18+
};
19+
20+
export default App;

src/screens/Main.tsx

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -28,18 +28,10 @@ export default observer(function Main() {
2828
<TaskControl />
2929
</Header>
3030
<Switch>
31-
<Route exact path="/">
32-
<Redirect to="/projects" />
33-
</Route>
34-
<Route path="/hours">
35-
<HoursScreen />
36-
</Route>
37-
<Route path="/projects">
38-
<ProjectsScreen />
39-
</Route>
40-
<Route path="/dashboard">
41-
<Dashboard />
42-
</Route>
31+
<Redirect exact from="/" to="/projects" />
32+
<Route path="/hours" component={HoursScreen} />
33+
<Route path="/projects" component={ProjectsScreen} />
34+
<Route path="/dashboard" component={Dashboard} />
4335
</Switch>
4436
</Layout>
4537
);

0 commit comments

Comments
 (0)