diff options
| author | Sebastien Castiel <sebastien@castiel.me> | 2024-01-19 12:03:16 -0500 |
|---|---|---|
| committer | Sebastien Castiel <sebastien@castiel.me> | 2024-01-19 12:03:16 -0500 |
| commit | 4d86c8c72714879e8e6c060479b02c553d35bb0f (patch) | |
| tree | 22459eb419318b9530710402c64a78a9ac0b142f /src/lib/hooks.ts | |
| parent | 23524cb94314fd50476ccffe654841d980c713d7 (diff) | |
Remove varianle NEXT_PUBLIC_BASE_URL
Diffstat (limited to 'src/lib/hooks.ts')
| -rw-r--r-- | src/lib/hooks.ts | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/lib/hooks.ts b/src/lib/hooks.ts index 02e2543..4d3ad08 100644 --- a/src/lib/hooks.ts +++ b/src/lib/hooks.ts @@ -40,3 +40,11 @@ export function useMediaQuery(query: string): boolean { return matches } + +export function useBaseUrl() { + const [baseUrl, setBaseUrl] = useState<string | null>(null) + useEffect(() => { + setBaseUrl(window.location.origin) + }, []) + return baseUrl +} |
