Fix PWA notification toolbar color (#1083)
* Fix PWA notification color * Add React hook * Convert component into a hook Co-authored-by: Deluan <deluan@navidrome.org>
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
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
|
||||
Reference in New Issue
Block a user