feat: keyboard shortcuts for themes

This commit is contained in:
liyasthomas
2022-01-01 19:32:34 +05:30
parent 1baf73a710
commit bb5acf97c6
35 changed files with 359 additions and 98 deletions

View File

@@ -52,7 +52,7 @@ import { setupLocalPersistence } from "~/newstore/localpersistence"
import { performMigrations } from "~/helpers/migrations"
import { initUserInfo } from "~/helpers/teams/BackendUserInfo"
import { registerApolloAuthUpdate } from "~/helpers/apollo"
import { useSetting } from "~/newstore/settings"
import { applySetting, useSetting } from "~/newstore/settings"
import { logPageView } from "~/helpers/fb/analytics"
import { hookKeybindingsListener } from "~/helpers/keybindings"
import { defineActionHandler } from "~/helpers/actions"
@@ -146,6 +146,18 @@ function defineJumpActions() {
defineActionHandler("navigation.jump.profile", () => {
router.push({ path: localePath("/profile") })
})
defineActionHandler("settings.theme.system", () => {
applySetting("BG_COLOR", "system")
})
defineActionHandler("settings.theme.light", () => {
applySetting("BG_COLOR", "light")
})
defineActionHandler("settings.theme.dark", () => {
applySetting("BG_COLOR", "dark")
})
defineActionHandler("settings.theme.black", () => {
applySetting("BG_COLOR", "black")
})
}
export default defineComponent({