Files
supabase/apps/ui-library/app/example/base-injector.tsx
Ivan Vasilov 156e8fd9b7 fix: Minor fixes for UI Library (#34535)
* 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.
2025-03-30 09:56:03 +02:00

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
}