aboutsummaryrefslogtreecommitdiff
path: root/vnext/src/App.js
diff options
context:
space:
mode:
Diffstat (limited to 'vnext/src/App.js')
-rw-r--r--vnext/src/App.js58
1 files changed, 16 insertions, 42 deletions
diff --git a/vnext/src/App.js b/vnext/src/App.js
index b56e0300..79fde2d1 100644
--- a/vnext/src/App.js
+++ b/vnext/src/App.js
@@ -1,5 +1,5 @@
import { useState, useEffect, useRef } from 'react';
-import { Route, Link, Switch } from 'react-router-dom';
+import { Route, Link, Routes } from 'react-router-dom';
import { useScroll, useRafState } from 'react-use';
import qs from 'qs';
@@ -183,47 +183,21 @@ export default function App({ footer }) {
</aside>
}
<section id="content" ref={contentRef} className={scrollState.top ? elClassTop : ''}>
- <Switch>
- <Route exact path="/">
- <Discussions visitor={visitor} />
- </Route>
- <Route exact path="/home">
- <Home visitor={visitor} />
- </Route>
- <Route exact path="/discover">
- <Discover visitor={visitor} />
- </Route>
- <Route exact path="/settings">
- <Settings visitor={visitor} onChange={auth} />
- </Route>
- <Route exact path="/login">
- <Login visitor={visitor} onAuth={auth} />
- </Route>
- <Route exact path="/post">
- <Post visitor={visitor} />
- </Route>
- <Route exact path="/pm">
- <Contacts visitor={visitor} />
- </Route>
- <Route exact path="/pm/:user">
- <Chat connection={eventSource} visitor={visitor} />
- </Route>
- <Route exact path="/:user/friends">
- <Friends />
- </Route>
- <Route exact path="/:user/readers">
- <Readers />
- </Route>
- <Route exact path="/:user">
- <Blog visitor={visitor} />
- </Route>
- <Route exact path="/tag/:tag">
- <Tag visitor={visitor} />
- </Route>
- <Route exact path="/:user/:mid">
- <Thread connection={eventSource} visitor={visitor} />
- </Route>
- </Switch>
+ <Routes>
+ <Route exact path="/" element={<Discussions visitor={visitor} />} />
+ <Route exact path="/home" element={<Home visitor={visitor} />} />
+ <Route exact path="/discover" element={<Discover visitor={visitor} />} />
+ <Route exact path="/settings" element={<Settings visitor={visitor} onChange={auth} />} />
+ <Route exact path="/login" element={<Login visitor={visitor} onAuth={auth} />} />
+ <Route exact path="/post" element={<Post visitor={visitor} />} />
+ <Route exact path="/pm" element={<Contacts visitor={visitor} />} />
+ <Route exact path="/pm/:user" element={<Chat connection={eventSource} visitor={visitor} />} />
+ <Route exact path="/:user/friends" element={<Friends />} />
+ <Route exact path="/:user/readers" element={<Readers />} />
+ <Route exact path="/:user" element={<Blog visitor={visitor} />} />
+ <Route exact path="/tag/:tag" element={<Tag visitor={visitor} />} />
+ <Route exact path="/:user/:mid" element={<Thread connection={eventSource} visitor={visitor} />} />
+ </Routes>
</section>
</div>
</>