Browse Source

Merge pull request #2758 from nocodb/refactor/dark-mode

pull/2796/head
Braks 2 years ago committed by GitHub
parent
commit
812772d456
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      packages/nc-gui-v2/app.vue
  2. 8
      packages/nc-gui-v2/composables/useGlobalState.ts

2
packages/nc-gui-v2/app.vue

@ -55,8 +55,6 @@ const sidebarOpen = computed({
<div class="flex-1" /> <div class="flex-1" />
<div class="flex justify-end gap-4"> <div class="flex justify-end gap-4">
<general-color-mode-switcher v-model="$state.darkMode.value" />
<general-language class="mr-3" /> <general-language class="mr-3" />
<template v-if="$state.signedIn.value"> <template v-if="$state.signedIn.value">

8
packages/nc-gui-v2/composables/useGlobalState.ts

@ -1,4 +1,4 @@
import { breakpointsTailwind, usePreferredDark, usePreferredLanguages, useStorage } from '@vueuse/core' import { breakpointsTailwind, usePreferredLanguages, useStorage } from '@vueuse/core'
import { useJwt } from '@vueuse/integrations/useJwt' import { useJwt } from '@vueuse/integrations/useJwt'
import type { JwtPayload } from 'jwt-decode' import type { JwtPayload } from 'jwt-decode'
import { computed, ref, toRefs, useBreakpoints, useNuxtApp, useTimestamp, watch } from '#imports' import { computed, ref, toRefs, useBreakpoints, useNuxtApp, useTimestamp, watch } from '#imports'
@ -25,8 +25,10 @@ const storageKey = 'nocodb-gui-v2'
export const useGlobalState = (): GlobalState => { export const useGlobalState = (): GlobalState => {
/** get the preferred languages of a user, according to browser settings */ /** get the preferred languages of a user, according to browser settings */
const preferredLanguages = $(usePreferredLanguages()) const preferredLanguages = $(usePreferredLanguages())
/** get the preferred dark mode setting, according to browser settings */ /** todo: reimplement; get the preferred dark mode setting, according to browser settings */
const prefersDarkMode = $(usePreferredDark()) // const prefersDarkMode = $(usePreferredDark())
const prefersDarkMode = false
/** get current breakpoints (for enabling sidebar) */ /** get current breakpoints (for enabling sidebar) */
const breakpoints = useBreakpoints(breakpointsTailwind) const breakpoints = useBreakpoints(breakpointsTailwind)

Loading…
Cancel
Save