mirror of
https://github.com/Frooodle/Stirling-PDF.git
synced 2025-09-26 17:52:59 +02:00
Refactor base URL access to use hook in HomePage
Replaced direct usage of getBaseUrl with the useBaseUrl hook in HomePage.tsx for improved React integration. Updated app constants to clarify usage and added a newline for readability.
This commit is contained in:
parent
38d10e7c06
commit
dc0b812214
@ -5,6 +5,7 @@ export const DEFAULT_BASE_URL = 'https://stirling.com';
|
||||
|
||||
export const getBaseUrlFromConfig = (config?: AppConfig | null): string =>
|
||||
config?.baseUrl || DEFAULT_BASE_URL;
|
||||
|
||||
// Hook to access the base URL within React components
|
||||
export const useBaseUrl = (): string => {
|
||||
const { config } = useAppConfig();
|
||||
|
@ -3,7 +3,7 @@ import { useToolWorkflow } from "../contexts/ToolWorkflowContext";
|
||||
import { Group } from "@mantine/core";
|
||||
import { useSidebarContext } from "../contexts/SidebarContext";
|
||||
import { useDocumentMeta } from "../hooks/useDocumentMeta";
|
||||
import { getBaseUrl } from "../constants/app";
|
||||
import { useBaseUrl } from "../constants/app";
|
||||
|
||||
import ToolPanel from "../components/tools/ToolPanel";
|
||||
import Workbench from "../components/layout/Workbench";
|
||||
@ -22,7 +22,7 @@ export default function HomePage() {
|
||||
|
||||
const { selectedTool, selectedToolKey } = useToolWorkflow();
|
||||
|
||||
const baseUrl = getBaseUrl();
|
||||
const baseUrl = useBaseUrl();
|
||||
|
||||
// Update document meta when tool changes
|
||||
useDocumentMeta({
|
||||
|
Loading…
Reference in New Issue
Block a user