Browse Source

enhancement(gui-v2): provide new set of project theme colors

Signed-off-by: Pranav C <pranavxc@gmail.com>
pull/3440/head
Pranav C 2 years ago
parent
commit
59ddb24983
  1. 4
      packages/nc-gui-v2/components/general/ColorPicker.vue
  2. 6
      packages/nc-gui-v2/pages/[projectType]/[projectId]/index.vue
  3. 2
      packages/nc-gui-v2/pages/[projectType]/[projectId]/index/index/index.vue
  4. 5
      packages/nc-gui-v2/pages/index/index/index.vue
  5. 21
      packages/nc-gui-v2/utils/colorsUtils.ts

4
packages/nc-gui-v2/components/general/ColorPicker.vue

@ -87,8 +87,8 @@ watch(picked, (n, _o) => {
} }
.color-selector { .color-selector {
position: relative; position: relative;
height: 32px; height: 25px;
width: 32px; width: 25px;
margin: 10px 5px; margin: 10px 5px;
border-radius: 5px; border-radius: 5px;
-webkit-text-stroke-width: 1px; -webkit-text-stroke-width: 1px;

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

@ -5,10 +5,10 @@ import tinycolor from 'tinycolor2'
import { import {
computed, computed,
definePageMeta, definePageMeta,
enumColor,
navigateTo, navigateTo,
onKeyStroke, onKeyStroke,
openLink, openLink,
projectThemeColors,
provide, provide,
provideSidebar, provideSidebar,
ref, ref,
@ -279,8 +279,8 @@ const copyAuthToken = async () => {
<GeneralColorPicker <GeneralColorPicker
v-model="themePrimaryColor" v-model="themePrimaryColor"
:colors="enumColor.dark" :colors="projectThemeColors"
:row-size="5" :row-size="9"
:advanced="false" :advanced="false"
/> />
<a-sub-menu key="theme-2"> <a-sub-menu key="theme-2">

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

@ -61,7 +61,7 @@ function onDrop(droppedFiles: File[] | null) {
if (isAllowed) { if (isAllowed) {
const ext = droppedFiles[0].name.split('.').pop() const ext = droppedFiles[0].name.split('.').pop()
fileType = (ext === 'csv' || ext === 'json') ? ext : 'excel' as QuickImportTypes fileType = ext === 'csv' || ext === 'json' ? ext : ('excel' as QuickImportTypes)
} }
return isAllowed return isAllowed

5
packages/nc-gui-v2/pages/index/index/index.vue

@ -8,6 +8,7 @@ import {
definePageMeta, definePageMeta,
extractSdkResponseErrorMsg, extractSdkResponseErrorMsg,
navigateTo, navigateTo,
projectThemeColors,
ref, ref,
useApi, useApi,
useNuxtApp, useNuxtApp,
@ -226,8 +227,8 @@ watch(themePrimaryColors, async (nextColors) => {
<GeneralColorPicker <GeneralColorPicker
v-model="themePrimaryColors[record.id]" v-model="themePrimaryColors[record.id]"
:colors="enumColor.dark" :colors="projectThemeColors"
:row-size="5" :row-size="9"
:advanced="false" :advanced="false"
/> />
<a-sub-menu key="pick-primary"> <a-sub-menu key="pick-primary">

21
packages/nc-gui-v2/utils/colorsUtils.ts

@ -83,3 +83,24 @@ export const hexToRGB = (hex: string) => {
return `${r}, ${g}, ${b}` return `${r}, ${g}, ${b}`
} }
export const projectThemeColors = [
'#2D7FF9',
'#18BFFF',
'#60DAD5',
'#EC2CBD',
'#F82B60',
'#F57134',
'#1BAF2C',
'#8B46FF',
'#666666',
'#1B51A2',
'#146C8E',
'#24716E',
'#8A2170',
'#941737',
'#B94915',
'#0E4C15',
'#381475',
'#333333',
]

Loading…
Cancel
Save