mirror of
https://github.com/supabase/supabase.git
synced 2026-10-06 18:05:11 +03:00
* Regenerate the registry. * Fix the paths of the ai editor rules. * Fix headings on clients and auth blocks. * Fix realtime chat and avatar demos. * Setup mdx-lint for the ui-library. Fix some obvious wordings. * Fix the tooltips for the examples. Reorder the example pages.
29 lines
691 B
TypeScript
29 lines
691 B
TypeScript
'use client'
|
|
|
|
import { useEffect } from 'react'
|
|
|
|
export function BaseInjector() {
|
|
useEffect(() => {
|
|
// Remove any existing base tag
|
|
const existingBase = document.querySelector('base')
|
|
if (existingBase) existingBase.remove()
|
|
|
|
// Add new base tag
|
|
const base = document.createElement('base')
|
|
base.href = `${process.env.NEXT_PUBLIC_BASE_PATH ?? ''}/example/password-based-auth/`
|
|
document.head.prepend(base)
|
|
|
|
// Add preview class to body to use shadcn theme vars
|
|
const bodyElement = document.querySelector('body')
|
|
if (bodyElement) {
|
|
bodyElement.classList.add('preview')
|
|
}
|
|
|
|
return () => {
|
|
base.remove()
|
|
}
|
|
}, [])
|
|
|
|
return null
|
|
}
|