v3: added localization, use global player for uploaded audio/video files
This commit is contained in:
@@ -1,13 +1,7 @@
|
||||
import { useLocation, useNavigate } from "react-router";
|
||||
import { Trans } from "@lingui/react/macro";
|
||||
import { useAuth } from "../hooks/useAuth.ts";
|
||||
|
||||
export type FeedTab = "hot" | "new" | "journal" | "followed";
|
||||
export const VALID_TABS = new Set<string>([
|
||||
"hot",
|
||||
"new",
|
||||
"journal",
|
||||
"followed",
|
||||
]);
|
||||
import { type FeedTab, VALID_TABS } from "../config/feedTabs.ts";
|
||||
|
||||
export function FeedTabBar() {
|
||||
const location = useLocation();
|
||||
@@ -28,21 +22,21 @@ export function FeedTabBar() {
|
||||
className={`feed-sort-btn${tab === "hot" ? " active" : ""}`}
|
||||
onClick={() => setTab("hot")}
|
||||
>
|
||||
Hot
|
||||
<Trans>Hot</Trans>
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
className={`feed-sort-btn${tab === "new" ? " active" : ""}`}
|
||||
onClick={() => setTab("new")}
|
||||
>
|
||||
New
|
||||
<Trans>New</Trans>
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
className={`feed-sort-btn${tab === "journal" ? " active" : ""}`}
|
||||
onClick={() => setTab("journal")}
|
||||
>
|
||||
Journal
|
||||
<Trans>Journal</Trans>
|
||||
</button>
|
||||
{user && (
|
||||
<button
|
||||
@@ -50,7 +44,7 @@ export function FeedTabBar() {
|
||||
className={`feed-sort-btn${tab === "followed" ? " active" : ""}`}
|
||||
onClick={() => setTab("followed")}
|
||||
>
|
||||
Followed
|
||||
<Trans>Followed</Trans>
|
||||
</button>
|
||||
)}
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user