Browse Source

fix(nc-gui): show selected theme color

pull/3669/head
braks 2 years ago committed by Raju Udava
parent
commit
ecab29558c
  1. 4
      packages/nc-gui/composables/useTheme/index.ts
  2. 4
      packages/nc-gui/pages/[projectType]/[projectId]/index.vue

4
packages/nc-gui/composables/useTheme/index.ts

@ -28,8 +28,8 @@ export const useTheme = createGlobalState((config?: Partial<ThemeConfig>) => {
accentColor.value = themeAccent.isValid() ? hexToRGB(themeAccent.toHex8String()) : hexToRGB(themeV2Colors.pink['500']) accentColor.value = themeAccent.isValid() ? hexToRGB(themeAccent.toHex8String()) : hexToRGB(themeV2Colors.pink['500'])
currentTheme.value = { currentTheme.value = {
primaryColor: themePrimary.toHex8String().toUpperCase(), primaryColor: themePrimary.toHex8String().toUpperCase().slice(0, -2),
accentColor: themeAccent.toHex8String().toUpperCase(), accentColor: themeAccent.toHex8String().toUpperCase().slice(0, -2),
} }
ConfigProvider.config({ ConfigProvider.config({

4
packages/nc-gui/pages/[projectType]/[projectId]/index.vue

@ -21,6 +21,7 @@ import {
useRouter, useRouter,
useSidebar, useSidebar,
useTabs, useTabs,
useTheme,
useUIPermission, useUIPermission,
} from '#imports' } from '#imports'
import { TabType } from '~/lib' import { TabType } from '~/lib'
@ -29,6 +30,8 @@ definePageMeta({
hideHeader: true, hideHeader: true,
}) })
const { theme } = useTheme()
const { t } = useI18n() const { t } = useI18n()
const route = useRoute() const route = useRoute()
@ -336,6 +339,7 @@ onBeforeUnmount(reset)
<template #expandIcon></template> <template #expandIcon></template>
<LazyGeneralColorPicker <LazyGeneralColorPicker
:model-value="theme.primaryColor"
:colors="projectThemeColors" :colors="projectThemeColors"
:row-size="9" :row-size="9"
:advanced="false" :advanced="false"

Loading…
Cancel
Save