Skip to content

Commit

Permalink
add dark mode setting
Browse files Browse the repository at this point in the history
  • Loading branch information
pixeldesu committed Feb 6, 2020
1 parent 788d329 commit e5bdc41
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
7 changes: 7 additions & 0 deletions src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ export default {
},
computed: mapState([
'config',
'errorMessages',
'loading',
'videos',
Expand All @@ -48,6 +49,12 @@ export default {
this.$store.dispatch('getChannels').then(() => {
this.$store.dispatch('getVideos');
});
this.$vuetify.theme.dark = this.$store.state.config.darkTheme;
this.$store.watch(
(state) => state.config.darkTheme,
(value) => { this.$vuetify.theme.dark = value; },
);
},
};
</script>
Expand Down
1 change: 0 additions & 1 deletion src/components/AppBar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
<v-app-bar
app
clipped-left
color="primary"
class="safe-area-ios vl-header"
:height="(isIos ? 'auto' : undefined)"
dark
Expand Down
10 changes: 10 additions & 0 deletions src/components/SettingsDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
</v-card-title>

<v-card-text>
<v-switch v-model="darkTheme" label="Dark Theme"></v-switch>
Video Link Provider:
<v-radio-group class="mt-0" v-model="videoLinkProvider">
<v-radio label="YouTube" value="https://youtube.com/watch?v="/>
Expand Down Expand Up @@ -71,6 +72,15 @@ export default {
}),
computed: {
darkTheme: {
get() {
return this.$store.state.config.darkTheme;
},
set(value) {
this.$store.dispatch('updateConfig', { darkTheme: value });
},
},
corsProxyUrl: {
get() {
return this.$store.state.config.corsProxyUrl;
Expand Down

0 comments on commit e5bdc41

Please sign in to comment.