v3: added index default tab selection setting, fixed notification pages not loading, reduced invite token length, global player state survives page reloads, many visual fixes
All checks were successful
Build and Publish Docker Image / build-and-push (push) Successful in 44s
All checks were successful
Build and Publish Docker Image / build-and-push (push) Successful in 44s
This commit is contained in:
@@ -13,6 +13,7 @@ import { PresenceRow } from "../components/PresenceRow.tsx";
|
||||
import { FeedTabBar } from "../components/FeedTabBar.tsx";
|
||||
import { FEED_TABS, type FeedTab } from "../config/feedTabs.ts";
|
||||
import { useTabParam } from "../hooks/useTabParam.ts";
|
||||
import { useDefaultFeedTab } from "../hooks/useDefaultFeedTab.ts";
|
||||
|
||||
import { API_URL, DEFAULT_PAGE_SIZE } from "../config/api.ts";
|
||||
|
||||
@@ -83,7 +84,13 @@ export function Index() {
|
||||
);
|
||||
const mainFetchDone = useRef(false);
|
||||
|
||||
const [tab] = useTabParam<FeedTab>(FEED_TABS, "hot");
|
||||
// The preferred default tab decides which feed `/` opens on. "followed"
|
||||
// requires a session, so fall back to "hot" for guests.
|
||||
const [preferredTab] = useDefaultFeedTab();
|
||||
const defaultTab: FeedTab = preferredTab === "followed" && !user
|
||||
? "hot"
|
||||
: preferredTab;
|
||||
const [tab] = useTabParam<FeedTab>(FEED_TABS, defaultTab);
|
||||
|
||||
// Web Share Target: Android share sheet navigates to /?share_url=...
|
||||
const searchParams = new URLSearchParams(location.search);
|
||||
|
||||
@@ -38,6 +38,7 @@ import { PageShell } from "../components/PageShell.tsx";
|
||||
import { PageError } from "../components/PageError.tsx";
|
||||
import { useAuth } from "../hooks/useAuth.ts";
|
||||
import { useTheme } from "../hooks/useTheme.ts";
|
||||
import { useDefaultFeedTab } from "../hooks/useDefaultFeedTab.ts";
|
||||
import { useWS } from "../hooks/useWS.ts";
|
||||
import { useDumpListSync } from "../hooks/useDumpListSync.ts";
|
||||
import { useFading } from "../hooks/useFading.ts";
|
||||
@@ -178,6 +179,7 @@ export function UserPublicProfile() {
|
||||
const navigate = useNavigate();
|
||||
const { user: me, authFetch, login, logout, token } = useAuth();
|
||||
const { style, colorScheme, setStyle, setColorScheme } = useTheme();
|
||||
const [defaultFeedTab, setDefaultFeedTab] = useDefaultFeedTab();
|
||||
const {
|
||||
voteCounts,
|
||||
myVotes,
|
||||
@@ -1177,6 +1179,48 @@ export function UserPublicProfile() {
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
<section className="profile-section">
|
||||
<h2 className="profile-section-title">
|
||||
<Trans>Feeds</Trans>
|
||||
</h2>
|
||||
<div className="profile-appearance-grid">
|
||||
<div className="profile-appearance-row">
|
||||
<span className="profile-appearance-label">
|
||||
<Trans>Default tab</Trans>
|
||||
</span>
|
||||
<div className="visibility-toggle">
|
||||
<button
|
||||
type="button"
|
||||
className={defaultFeedTab === "hot" ? "active" : ""}
|
||||
onClick={() => setDefaultFeedTab("hot")}
|
||||
>
|
||||
<Trans>Hot</Trans>
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
className={defaultFeedTab === "new" ? "active" : ""}
|
||||
onClick={() => setDefaultFeedTab("new")}
|
||||
>
|
||||
<Trans>New</Trans>
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
className={defaultFeedTab === "journal" ? "active" : ""}
|
||||
onClick={() => setDefaultFeedTab("journal")}
|
||||
>
|
||||
<Trans>Journal</Trans>
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
className={defaultFeedTab === "followed" ? "active" : ""}
|
||||
onClick={() => setDefaultFeedTab("followed")}
|
||||
>
|
||||
<Trans>Followed</Trans>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</>
|
||||
)}
|
||||
</PageShell>
|
||||
|
||||
Reference in New Issue
Block a user