Skip to content

Commit

Permalink
Make player theme configurable from Navidrome's theme
Browse files Browse the repository at this point in the history
  • Loading branch information
deluan committed Apr 14, 2020
1 parent 3a54246 commit da45bcf
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
5 changes: 5 additions & 0 deletions ui/src/audioplayer/Player.js
Expand Up @@ -5,11 +5,16 @@ import ReactJkMusicPlayer from 'react-jinke-music-player'
import 'react-jinke-music-player/assets/index.css'
import subsonic from '../subsonic'
import { scrobbled, syncQueue } from './queue'
import themes from '../themes'

const Player = () => {
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 = {
theme: playerTheme,
bounds: 'body',
mode: 'full',
autoPlay: true,
Expand Down
3 changes: 3 additions & 0 deletions ui/src/themes/dark.js
Expand Up @@ -15,5 +15,8 @@ export default {
color: 'white'
}
}
},
player: {
theme: 'dark'
}
}
5 changes: 4 additions & 1 deletion ui/src/themes/light.js
Expand Up @@ -3,8 +3,8 @@ export default {
palette: {
secondary: {
light: '#5f5fc4',
main: '#283593',
dark: '#001064',
main: '#283593',
contrastText: '#fff'
}
},
Expand All @@ -17,5 +17,8 @@ export default {
}
}
}
},
player: {
theme: 'light'
}
}

0 comments on commit da45bcf

Please sign in to comment.