mirror of
https://github.com/drawdb-io/drawdb.git
synced 2025-09-18 12:44:41 +00:00
Migrate to tailwind v4 (#370)
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { useState } from "react";
|
||||
import { useMemo, useState } from "react";
|
||||
import {
|
||||
Tab,
|
||||
ObjectType,
|
||||
@@ -37,8 +37,14 @@ export default function Table(props) {
|
||||
const { t } = useTranslation();
|
||||
const { selectedElement, setSelectedElement } = useSelect();
|
||||
|
||||
const borderColor = useMemo(
|
||||
() => (settings.mode === "light" ? "border-zinc-300" : "border-zinc-600"),
|
||||
[settings.mode],
|
||||
);
|
||||
|
||||
const height =
|
||||
tableData.fields.length * tableFieldHeight + tableHeaderHeight + 7;
|
||||
|
||||
const openEditor = () => {
|
||||
if (!layout.sidebar) {
|
||||
setSelectedElement((prev) => ({
|
||||
@@ -84,7 +90,7 @@ export default function Table(props) {
|
||||
selectedElement.id === tableData.id &&
|
||||
selectedElement.element === ObjectType.TABLE
|
||||
? "border-solid border-blue-500"
|
||||
: "border-zinc-500"
|
||||
: borderColor
|
||||
}`}
|
||||
style={{ direction: "ltr" }}
|
||||
>
|
||||
@@ -313,7 +319,7 @@ export default function Table(props) {
|
||||
} flex items-center gap-2 overflow-hidden`}
|
||||
>
|
||||
<button
|
||||
className="flex-shrink-0 w-[10px] h-[10px] bg-[#2f68adcc] rounded-full"
|
||||
className="shrink-0 w-[10px] h-[10px] bg-[#2f68adcc] rounded-full"
|
||||
onPointerDown={(e) => {
|
||||
if (!e.isPrimary) return;
|
||||
|
||||
@@ -362,14 +368,13 @@ export default function Table(props) {
|
||||
{fieldData.type +
|
||||
((dbToTypes[database][fieldData.type].isSized ||
|
||||
dbToTypes[database][fieldData.type].hasPrecision) &&
|
||||
fieldData.size &&
|
||||
fieldData.size !== ""
|
||||
fieldData.size &&
|
||||
fieldData.size !== ""
|
||||
? `(${fieldData.size})`
|
||||
: "")}
|
||||
</span>
|
||||
</div>
|
||||
) : null
|
||||
}
|
||||
) : null}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
|
Reference in New Issue
Block a user