Browse Source

refactor: move view icons to iconmap

Signed-off-by: Pranav C <pranavxc@gmail.com>
pull/5343/head
Pranav C 2 years ago
parent
commit
4ed577834c
  1. 16
      packages/nc-gui/utils/iconUtils.ts
  2. 22
      packages/nc-gui/utils/viewUtils.ts

16
packages/nc-gui/utils/iconUtils.ts

@ -80,8 +80,11 @@ import MMIcon from '~icons/mdi/table-network'
import PhShareThin from '~icons/ph/share-thin'
import PhReloadThin from '~icons/ph/arrow-clockwise-thin'
import PhCodeThin from '~icons/ph/code-thin'
import PhGridNineThinThin from '~icons/ph/grid-nine-thin'
import PhGridNineThin from '~icons/ph/grid-nine-thin'
import PhGridThin from '~icons/ph/grid-four-thin'
import PhComputerTowerThin from '~icons/ph/ComputerTowerThin'
import PhSquareHalfBottomThin from '~icons/ph/SquareHalfBottomThin'
import MdiMapIcon from '~icons/mdi/map-outline'
export const iconMap = {
lock: PhLockIcon,
@ -146,8 +149,13 @@ export const iconMap = {
share: PhShareThin,
reload: PhReloadThin,
xml: PhCodeThin,
airtable:PhGridNineThinThin,
airtable: PhGridNineThin,
grid: PhGridThin,
gallery: PhImageThin,
form: PhComputerTowerThin,
map: MdiMapIcon,
kanban: PhSquareHalfBottomThin,
view: PhEyeThin,
mm: MMIcon,
hm: HMIcon,
bt: BTIcon,

22
packages/nc-gui/utils/viewUtils.ts

@ -1,23 +1,17 @@
import { ViewTypes } from 'nocodb-sdk'
import { themeV2Colors } from '#imports'
import { iconMap } from '~/utils/iconUtils'
import MdiCalendarIcon from '~icons/mdi/calendar'
import MdiMapIcon from '~icons/mdi/map-outline'
import type { Language } from '~/lib'
import PhTableThin from '~icons/ph/TableThin'
import PhImageThin from '~icons/ph/ImageThin'
import PhComputerTowerThin from '~icons/ph/ComputerTowerThin'
import PhSquareHalfBottomThin from '~icons/ph/SquareHalfBottomThin'
import PhEyeThin from '~icons/ph/EyeThin'
export const viewIcons: Record<number | string, { icon: any; color: string }> = {
[ViewTypes.GRID]: { icon: PhTableThin, color: '#8f96f2' },
[ViewTypes.FORM]: { icon: PhComputerTowerThin, color: themeV2Colors.pink['500'] },
calendar: { icon: MdiCalendarIcon, color: 'purple' },
[ViewTypes.GALLERY]: { icon: PhImageThin, color: 'orange' },
[ViewTypes.MAP]: { icon: MdiMapIcon, color: 'blue' },
[ViewTypes.KANBAN]: { icon: PhSquareHalfBottomThin, color: 'green' },
view: { icon: PhEyeThin, color: 'blue' },
[ViewTypes.GRID]: { icon: iconMap.grid, color: '#8f96f2' },
[ViewTypes.FORM]: { icon: iconMap.form, color: themeV2Colors.pink['500'] },
calendar: { icon: iconMap.calendar, color: 'purple' },
[ViewTypes.GALLERY]: { icon: iconMap.gallery, color: 'orange' },
[ViewTypes.MAP]: { icon: iconMap.map, color: 'blue' },
[ViewTypes.KANBAN]: { icon: iconMap.kanban, color: 'green' },
view: { icon: iconMap.view, color: 'blue' },
}
export const viewTypeAlias: Record<number, string> = {

Loading…
Cancel
Save