mirror of
https://github.com/plebbit/seedit.git
synced 2026-02-15 08:21:19 -05:00
feat(app): update routes
This commit is contained in:
26
src/app.tsx
26
src/app.tsx
@@ -58,29 +58,39 @@ function App() {
|
||||
<Route element={feedLayout}>
|
||||
<Route path='/:sortType?' element={<Home />} />
|
||||
<Route path='/:sortType?/:timeFilterName?' element={<Home />} />
|
||||
|
||||
<Route path='/p/all/:sortType?' element={<All />} />
|
||||
<Route path='/p/all/:sortType?/:timeFilterName?' element={<All />} />
|
||||
|
||||
<Route path='/p/:subplebbitAddress/:sortType?' element={<Subplebbit />} />
|
||||
<Route path='/p/:subplebbitAddress/:sortType?/:timeFilterName?' element={<Subplebbit />} />
|
||||
<Route path='/profile' element={<Profile />} />
|
||||
<Route path='/profile/:sortType?' element={<Profile />} />
|
||||
<Route path='/profile/upvoted/:sortType?' element={<Profile />} />
|
||||
<Route path='/profile/downvoted/:sortType?' element={<Profile />} />
|
||||
<Route path='/profile/comments/:sortType?' element={<Profile />} />
|
||||
<Route path='/profile/submitted/:sortType?' element={<Profile />} />
|
||||
<Route path='u/:authorAddress/c/:commentCid?' element={<Author />} />
|
||||
<Route path='u/:authorAddress/c/:commentCid?/:sortType?' element={<Author />} />
|
||||
|
||||
<Route path='/profile/:sortType?/:timeFilterName?' element={<Profile />} />
|
||||
<Route path='/profile/upvoted/:sortType?/:timeFilterName?' element={<Profile />} />
|
||||
<Route path='/profile/downvoted/:sortType?/:timeFilterName?' element={<Profile />} />
|
||||
<Route path='/profile/comments/:sortType?/:timeFilterName?' element={<Profile />} />
|
||||
<Route path='/profile/submitted/:sortType?/:timeFilterName?' element={<Profile />} />
|
||||
|
||||
<Route path='u/:authorAddress/c/:commentCid?/:sortType?/:timeFilterName?' element={<Author />} />
|
||||
<Route path='u/:authorAddress/c/:commentCid?/comments/:sortType?/:timeFilterName?' element={<Author />} />
|
||||
<Route path='u/:authorAddress/c/:commentCid?/submitted/:sortType?/:timeFilterName?' element={<Author />} />
|
||||
</Route>
|
||||
<Route element={pagesLayout}>
|
||||
<Route path='/submit' element={<Submit />} />
|
||||
|
||||
<Route path='/p/:subplebbitAddress/c/:commentCid' element={<Post />} />
|
||||
<Route path='/p/:subplebbitAddress/c/:commentCid/about' element={<About />} />
|
||||
|
||||
<Route path='/p/:subplebbitAddress/submit' element={<Submit />} />
|
||||
<Route path='/p/:subplebbitAddress/about' element={<About />} />
|
||||
|
||||
<Route path='/settings' element={<Settings />} />
|
||||
|
||||
<Route path='/profile/:accountCommentIndex' element={<PendingPost />} />
|
||||
<Route path='/profile/about' element={<About />} />
|
||||
|
||||
<Route path='/u/:authorAddress/c/:commentCid/about' element={<About />} />
|
||||
|
||||
<Route path='/inbox' element={<Inbox />} />
|
||||
</Route>
|
||||
</Route>
|
||||
|
||||
@@ -37,10 +37,7 @@ const ReplyAuthor = ({ address, authorRole, cid, displayName, shortAuthorAddress
|
||||
return (
|
||||
<>
|
||||
{displayName && <span className={`${styles.author} ${moderatorClass}`}>{displayName}</span>}
|
||||
<Link
|
||||
to={`/u/${address}/c/${cid}`}
|
||||
className={`${styles.author} ${moderatorClass}`}
|
||||
>
|
||||
<Link to={`/u/${address}/c/${cid}`} className={`${styles.author} ${moderatorClass}`}>
|
||||
{displayName ? `u/${shortAuthorAddress}` : shortAuthorAddress}
|
||||
</Link>
|
||||
{authorRole && (
|
||||
@@ -131,21 +128,7 @@ const ParentLink = ({ reply }: { reply: Comment }) => {
|
||||
};
|
||||
|
||||
const Reply = ({ depth = 0, isSingle, reply = {} }: ReplyProps) => {
|
||||
const {
|
||||
author,
|
||||
cid,
|
||||
content,
|
||||
downvoteCount,
|
||||
flair,
|
||||
link,
|
||||
linkHeight,
|
||||
linkWidth,
|
||||
removed,
|
||||
spoiler,
|
||||
subplebbitAddress,
|
||||
timestamp,
|
||||
upvoteCount,
|
||||
} = reply || {};
|
||||
const { author, cid, content, downvoteCount, flair, link, linkHeight, linkWidth, removed, spoiler, subplebbitAddress, timestamp, upvoteCount } = reply || {};
|
||||
const subplebbit = useSubplebbit({ subplebbitAddress });
|
||||
|
||||
const authorRole = subplebbit?.roles?.[reply.author.address]?.role;
|
||||
|
||||
@@ -92,7 +92,7 @@ const Sidebar = ({ address, cid, createdAt, description, downvoteCount = 0, role
|
||||
|
||||
const alertAnonymousCreator = () => {
|
||||
alert('This community has no owner role set.');
|
||||
}
|
||||
};
|
||||
|
||||
return (
|
||||
<div className={`${isAbout ? styles.about : styles.sidebar}`}>
|
||||
|
||||
@@ -26,7 +26,7 @@ const Author = () => {
|
||||
|
||||
const Footer = () => {
|
||||
return hasMore ? <LoadingEllipsis string={'loading'} /> : null;
|
||||
}
|
||||
};
|
||||
|
||||
const virtuosoRef = useRef<VirtuosoHandle | null>(null);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user