Skip to content

refactor: derive docs URL from server release channel - #1476

Merged
harshithmohan merged 1 commit into
masterfrom
feat/configurable-docs-url
Oct 3, 2026
Merged

harshithmohan merged 1 commit into
masterfrom
feat/configurable-docs-url

Conversation

@harshithmohan

Copy link
Copy Markdown
Member

Summary

Replace hardcoded docs URLs with a useDocsUrl() hook that routes
based on the server's release channel:

  • Stable channel → https://docs.shokoanime.com/
  • Dev/Auto channel → https://docs.shokoanime.com/daily/

Changes

  • New hook src/hooks/useDocsUrl.ts — reads Server.ReleaseChannel
    from useVersionQuery() and returns the appropriate docs base URL
  • Updated all 7 docs link references across 5 components:
    • LoginPage.tsx
    • TopNav.tsx
    • AniDBBanDetectionItem.tsx
    • WelcomeModal.tsx
    • FirstRunPage.tsx
  • Removed getDocsUrl() from src/core/util.ts

Design

The hook reads the server version via useVersionQuery() internally,
so no props need to be threaded. Each component stores the returned
URL in a const before the JSX return.

Add useDocsUrl() hook in src/hooks/useDocsUrl.ts that reads the
server release channel from useVersionQuery() and returns the
appropriate docs base URL.

- Stable channel → https://docs.shokoanime.com/
- Non-stable (Dev/Auto) → https://docs.shokoanime.com/daily/

Replace all 7 hardcoded docs.shokoanime.com references across 5
components to use the hook, storing the returned URL in a const
before the JSX return.
@harshithmohan
harshithmohan merged commit 910e016 into master Oct 3, 2026
3 checks passed
@harshithmohan
harshithmohan deleted the feat/configurable-docs-url branch October 3, 2026 14:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant