diff --git a/packages/nc-gui-v2/components/general/ChromeWrapper.vue b/packages/nc-gui-v2/components/general/ChromeWrapper.vue new file mode 100644 index 0000000000..43028707a5 --- /dev/null +++ b/packages/nc-gui-v2/components/general/ChromeWrapper.vue @@ -0,0 +1,30 @@ + + + + + diff --git a/packages/nc-gui-v2/components/general/ColorPicker.vue b/packages/nc-gui-v2/components/general/ColorPicker.vue index e5bb3bdc1d..5302c398ab 100644 --- a/packages/nc-gui-v2/components/general/ColorPicker.vue +++ b/packages/nc-gui-v2/components/general/ColorPicker.vue @@ -1,5 +1,4 @@ @@ -50,11 +50,11 @@ watch(picked, (n, _o) => { v-for="(color, i) of colors.slice((colId - 1) * rowSize, colId * rowSize)" :key="`color-${colId}-${i}`" class="color-selector" - :class="compare(typeof picked === 'string' ? picked : picked.hex8, color) ? 'selected' : ''" + :class="compare(picked, color) ? 'selected' : ''" :style="{ 'background-color': `${color}` }" @click="selectColor(color)" > - {{ compare(typeof picked === 'string' ? picked : picked.hex8, color) ? '✓' : '' }} + {{ compare(picked, color) ? '✓' : '' }} @@ -64,7 +64,7 @@ watch(picked, (n, _o) => { Pick Color
- +
diff --git a/packages/nc-gui-v2/composables/useProject.ts b/packages/nc-gui-v2/composables/useProject.ts index da9f6d1b92..57bcbb0302 100644 --- a/packages/nc-gui-v2/composables/useProject.ts +++ b/packages/nc-gui-v2/composables/useProject.ts @@ -10,7 +10,7 @@ const [setup, use] = useInjectionState((_projectId?: MaybeRef) => { const { $api } = useNuxtApp() const route = useRoute() const { includeM2M } = useGlobal() - const { setTheme } = useTheme() + const { setTheme, theme } = useTheme() const projectId = computed(() => (_projectId ? unref(_projectId) : (route.params.projectId as string))) const project = ref({}) @@ -99,15 +99,21 @@ const [setup, use] = useInjectionState((_projectId?: MaybeRef) => { } } - async function saveTheme(theme: Partial) { + async function saveTheme(_theme: Partial) { + const fullTheme = { + primaryColor: theme.value.primaryColor, + accentColor: theme.value.accentColor, + ..._theme, + } + await updateProject({ - color: theme.primaryColor, + color: fullTheme.primaryColor, meta: { ...projectMeta.value, - theme, + theme: fullTheme, }, }) - setTheme(theme) + setTheme(fullTheme) } watch( diff --git a/packages/nc-gui-v2/pages/[projectType]/[projectId]/index.vue b/packages/nc-gui-v2/pages/[projectType]/[projectId]/index.vue index d6954d9c05..f8714b8781 100644 --- a/packages/nc-gui-v2/pages/[projectType]/[projectId]/index.vue +++ b/packages/nc-gui-v2/pages/[projectType]/[projectId]/index.vue @@ -1,6 +1,5 @@