refactor(ux): consolidate BMAD skills, update design system, and clean up Prisma generated client
This commit is contained in:
23
keep-notes/components/direction-initializer.tsx
Normal file
23
keep-notes/components/direction-initializer.tsx
Normal file
@@ -0,0 +1,23 @@
|
||||
'use client'
|
||||
|
||||
import { useEffect } from 'react'
|
||||
|
||||
/**
|
||||
* Sets document direction (RTL/LTR) on mount based on saved language.
|
||||
* Runs before paint to prevent visual flash.
|
||||
*/
|
||||
export function DirectionInitializer() {
|
||||
useEffect(() => {
|
||||
try {
|
||||
const lang = localStorage.getItem('user-language')
|
||||
if (lang === 'fa' || lang === 'ar') {
|
||||
document.documentElement.dir = 'rtl'
|
||||
document.documentElement.lang = lang
|
||||
} else {
|
||||
document.documentElement.dir = 'ltr'
|
||||
}
|
||||
} catch {}
|
||||
}, [])
|
||||
|
||||
return null
|
||||
}
|
||||
Reference in New Issue
Block a user