refactor: move new users page to task
This commit is contained in:
@ -1,7 +1,6 @@
|
||||
import { useState } from "react";
|
||||
import { useIntl } from "react-intl";
|
||||
|
||||
import SuggestedProfiles from "@/Components/SuggestedProfiles";
|
||||
import { Tab, TabSelector } from "@/Components/TabSelectors/TabSelectors";
|
||||
import TrendingNotes from "@/Components/Trending/TrendingPosts";
|
||||
import TrendingUsers from "@/Components/Trending/TrendingUsers";
|
||||
@ -10,20 +9,21 @@ export default function Discover() {
|
||||
const { formatMessage } = useIntl();
|
||||
// tabs
|
||||
const Tabs = {
|
||||
Follows: { text: formatMessage({ defaultMessage: "Suggested Follows", id: "C8HhVE" }), value: 0 },
|
||||
Posts: { text: formatMessage({ defaultMessage: "Trending Notes", id: "Ix8l+B" }), value: 1 },
|
||||
Profiles: { text: formatMessage({ defaultMessage: "Trending People", id: "CVWeJ6" }), value: 2 },
|
||||
Profiles: { text: formatMessage({ defaultMessage: "Trending People", id: "CVWeJ6" }), value: 0 },
|
||||
};
|
||||
const [tab, setTab] = useState<Tab>(Tabs.Follows);
|
||||
const [tab, setTab] = useState<Tab>(Tabs.Profiles);
|
||||
|
||||
function renderTab() {
|
||||
switch (tab.value) {
|
||||
case 0:
|
||||
return <SuggestedProfiles />;
|
||||
case 1:
|
||||
return <TrendingNotes />;
|
||||
case 2:
|
||||
return <TrendingUsers />;
|
||||
case 0:
|
||||
return (
|
||||
<div className="p">
|
||||
<TrendingUsers />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
@ -31,7 +31,7 @@ export default function Discover() {
|
||||
return (
|
||||
<>
|
||||
<div className="tabs p">
|
||||
{[Tabs.Follows, Tabs.Posts, Tabs.Profiles].map(a => (
|
||||
{[Tabs.Profiles, Tabs.Posts].map(a => (
|
||||
<TabSelector key={a.value} tab={tab} setTab={setTab} t={a} />
|
||||
))}
|
||||
</div>
|
||||
|
Reference in New Issue
Block a user