Skip to content

Commit b7445e2

Browse files
authored
Add colors to data types (#448)
* Color added to main datatypes * Add tailwind colors to all data types and display them
1 parent 3e54f2a commit b7445e2

File tree

3 files changed

+208
-3
lines changed

3 files changed

+208
-3
lines changed

src/components/EditorCanvas/Table.jsx

+6-2
Original file line numberDiff line numberDiff line change
@@ -373,8 +373,12 @@ export default function Table(props) {
373373
) : settings.showDataTypes ? (
374374
<div className="flex gap-1 items-center">
375375
{fieldData.primary && <IconKeyStroked />}
376-
{!fieldData.notNull && <span>?</span>}
377-
<span>
376+
{!fieldData.notNull && <span className="font-mono">?</span>}
377+
<span
378+
className={
379+
"font-mono " + dbToTypes[database][fieldData.type].color
380+
}
381+
>
378382
{fieldData.type +
379383
((dbToTypes[database][fieldData.type].isSized ||
380384
dbToTypes[database][fieldData.type].hasPrecision) &&

src/data/constants.js

+12
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,18 @@
11
export const defaultBlue = "#175e7a";
22
export const defaultNoteTheme = "#fcf7ac";
33
export const darkBgTheme = "#16161A";
4+
export const stringColor = "text-orange-500";
5+
export const intColor = "text-yellow-500";
6+
export const decimalColor = "text-lime-500";
7+
export const booleanColor = "text-violet-500";
8+
export const binaryColor = "text-emerald-500";
9+
export const enumSetColor = "text-sky-500";
10+
export const documentColor = "text-indigo-500";
11+
export const networkIdColor = "text-rose-500";
12+
export const geometricColor = "text-fuchsia-500";
13+
export const vectorColor = "text-slate-500";
14+
export const otherColor = "text-zinc-500";
15+
export const dateColor = "text-cyan-500";
416
export const tableHeaderHeight = 50;
517
export const tableWidth = 220;
618
export const tableFieldHeight = 36;

0 commit comments

Comments
 (0)