Migrate to tailwind v4 (#370)

This commit is contained in:
1ilit
2025-03-21 01:25:36 +04:00
committed by GitHub
parent a358b56d7e
commit f95841f0e7
20 changed files with 631 additions and 743 deletions

View File

@@ -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>
);