mirror of
https://github.com/navidrome/navidrome.git
synced 2026-11-04 09:18:39 +01:00
14 lines
447 B
JavaScript
14 lines
447 B
JavaScript
|
|
import { useEffect } from 'react'
|
||
|
|
import useCurrentTheme from './themes/useCurrentTheme'
|
||
|
|
|
||
|
|
const useChangeThemeColor = () => {
|
||
|
|
const theme = useCurrentTheme()
|
||
|
|
const color =
|
||
|
|
theme.palette?.primary?.light || theme.palette?.primary?.main || '#ffffff'
|
||
|
|
useEffect(() => {
|
||
|
|
const themeColor = document.querySelector("meta[name='theme-color']")
|
||
|
|
themeColor.setAttribute('content', color)
|
||
|
|
}, [color])
|
||
|
|
}
|
||
|
|
|
||
|
|
export default useChangeThemeColor
|