mirror of
https://github.com/navidrome/navidrome.git
synced 2025-06-19 00:04:15 +03:00
Make player theme configurable from Navidrome's theme
This commit is contained in:
parent
3a54246b15
commit
da45bcf448
@ -5,11 +5,16 @@ import ReactJkMusicPlayer from 'react-jinke-music-player'
|
|||||||
import 'react-jinke-music-player/assets/index.css'
|
import 'react-jinke-music-player/assets/index.css'
|
||||||
import subsonic from '../subsonic'
|
import subsonic from '../subsonic'
|
||||||
import { scrobbled, syncQueue } from './queue'
|
import { scrobbled, syncQueue } from './queue'
|
||||||
|
import themes from '../themes'
|
||||||
|
|
||||||
const Player = () => {
|
const Player = () => {
|
||||||
const translate = useTranslate()
|
const translate = useTranslate()
|
||||||
|
const currentTheme = useSelector((state) => state.theme)
|
||||||
|
const theme = themes[currentTheme] || themes.DarkTheme
|
||||||
|
const playerTheme = (theme.player && theme.player.theme) || 'dark'
|
||||||
|
|
||||||
const defaultOptions = {
|
const defaultOptions = {
|
||||||
|
theme: playerTheme,
|
||||||
bounds: 'body',
|
bounds: 'body',
|
||||||
mode: 'full',
|
mode: 'full',
|
||||||
autoPlay: true,
|
autoPlay: true,
|
||||||
|
@ -15,5 +15,8 @@ export default {
|
|||||||
color: 'white'
|
color: 'white'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
player: {
|
||||||
|
theme: 'dark'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3,8 +3,8 @@ export default {
|
|||||||
palette: {
|
palette: {
|
||||||
secondary: {
|
secondary: {
|
||||||
light: '#5f5fc4',
|
light: '#5f5fc4',
|
||||||
main: '#283593',
|
|
||||||
dark: '#001064',
|
dark: '#001064',
|
||||||
|
main: '#283593',
|
||||||
contrastText: '#fff'
|
contrastText: '#fff'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -17,5 +17,8 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
player: {
|
||||||
|
theme: 'light'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user