feat: topics page
This commit is contained in:
parent
f2a41cb474
commit
c530e4ba72
@ -89,6 +89,17 @@ export function RootTabs({ base }: { base?: string }) {
|
||||
</>
|
||||
),
|
||||
},
|
||||
{
|
||||
tab: "tags",
|
||||
path: `${base}/topics`,
|
||||
show: tags.item.length > 0,
|
||||
element: (
|
||||
<>
|
||||
<Icon name="hash" />
|
||||
<FormattedMessage defaultMessage="Topics" />
|
||||
</>
|
||||
),
|
||||
},
|
||||
] as Array<{
|
||||
tab: RootTab;
|
||||
path: string;
|
||||
@ -141,15 +152,6 @@ export function RootTabs({ base }: { base?: string }) {
|
||||
{a.element}
|
||||
</MenuItem>
|
||||
))}
|
||||
{tags.item.map(v => (
|
||||
<MenuItem
|
||||
onClick={() => {
|
||||
navigate(`${base}/t/${v}`);
|
||||
}}>
|
||||
<Icon name="hash" />
|
||||
{v}
|
||||
</MenuItem>
|
||||
))}
|
||||
</Menu>
|
||||
</div>
|
||||
);
|
||||
|
@ -18,6 +18,7 @@ import { TaskList } from "Tasks/TaskList";
|
||||
import TimelineFollows from "Element/Feed/TimelineFollows";
|
||||
import { RootTabs } from "Element/RootTabs";
|
||||
import { DeckContext } from "Pages/DeckLayout";
|
||||
import { TopicsPage } from "./TopicsPage";
|
||||
|
||||
import messages from "./messages";
|
||||
|
||||
@ -239,6 +240,10 @@ export const RootTabRoutes = [
|
||||
path: "t/:tag",
|
||||
element: <HashTagsPage />,
|
||||
},
|
||||
{
|
||||
path: "topics",
|
||||
element: <TopicsPage />,
|
||||
},
|
||||
];
|
||||
|
||||
export const RootRoutes = [
|
||||
|
20
packages/app/src/Pages/TopicsPage.tsx
Normal file
20
packages/app/src/Pages/TopicsPage.tsx
Normal file
@ -0,0 +1,20 @@
|
||||
import Timeline from "Element/Feed/Timeline";
|
||||
import useLogin from "Hooks/useLogin";
|
||||
|
||||
export function TopicsPage() {
|
||||
const { tags, pubKey } = useLogin(s => ({ tags: s.tags.item, pubKey: s.publicKey }));
|
||||
|
||||
return (
|
||||
<Timeline
|
||||
subject={{
|
||||
type: "hashtag",
|
||||
items: tags,
|
||||
discriminator: pubKey ?? "",
|
||||
}}
|
||||
postsOnly={true}
|
||||
method="TIME_RANGE"
|
||||
loadMore={true}
|
||||
window={60 * 60 * 6}
|
||||
/>
|
||||
);
|
||||
}
|
@ -1168,6 +1168,9 @@
|
||||
"kaaf1E": {
|
||||
"defaultMessage": "now"
|
||||
},
|
||||
"kc79d3": {
|
||||
"defaultMessage": "Topics"
|
||||
},
|
||||
"kuPHYE": {
|
||||
"defaultMessage": "{n,plural,=0{{name} liked} other{{name} & {n} others liked}}"
|
||||
},
|
||||
|
@ -384,6 +384,7 @@
|
||||
"kEZUR8": "Register an Iris username",
|
||||
"kJYo0u": "{n,plural,=0{{name} reposted} other{{name} & {n} others reposted}}",
|
||||
"kaaf1E": "now",
|
||||
"kc79d3": "Topics",
|
||||
"kuPHYE": "{n,plural,=0{{name} liked} other{{name} & {n} others liked}}",
|
||||
"l+ikU1": "Everything in {plan}",
|
||||
"lCILNz": "Buy Now",
|
||||
|
Loading…
Reference in New Issue
Block a user