Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 31 additions & 33 deletions src/components/Workspace.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@

export const IdContext = createContext({
gistId: "",
setGistId: () => {},
setGistId: () => { },
version: "",
setVersion: () => {},
setVersion: () => { },
});

const SIDEPANEL_MIN_WIDTH = 384;
Expand Down Expand Up @@ -203,12 +203,12 @@
t.id
? t
: {
...t,
id: nanoid(),
fields: t.fields.map((f) =>
f.id ? f : { ...f, id: nanoid() },
),
},
...t,
id: nanoid(),
fields: t.fields.map((f) =>
f.id ? f : { ...f, id: nanoid() },
),
},
),
);
} else {
Expand Down Expand Up @@ -263,12 +263,12 @@
t.id
? t
: {
...t,
id: nanoid(),
fields: t.fields.map((f) =>
f.id ? f : { ...f, id: nanoid() },
),
},
...t,
id: nanoid(),
fields: t.fields.map((f) =>
f.id ? f : { ...f, id: nanoid() },
),
},
),
);
} else {
Expand Down Expand Up @@ -322,12 +322,12 @@
t.id
? t
: {
...t,
id: nanoid(),
fields: t.fields.map((f) =>
f.id ? f : { ...f, id: nanoid() },
),
},
...t,
id: nanoid(),
fields: t.fields.map((f) =>
f.id ? f : { ...f, id: nanoid() },
),
},
),
);
} else {
Expand Down Expand Up @@ -373,12 +373,12 @@
t.id
? t
: {
...t,
id: nanoid(),
fields: t.fields.map((f) =>
f.id ? f : { ...f, id: nanoid() },
),
},
...t,
id: nanoid(),
fields: t.fields.map((f) =>
f.id ? f : { ...f, id: nanoid() },
),
},
),
);
} else {
Expand Down Expand Up @@ -498,9 +498,8 @@

useEffect(() => {
document.title = "Editor | drawDB";

load();
}, [load]);
}, []);

Check warning on line 502 in src/components/Workspace.jsx

View workflow job for this annotation

GitHub Actions / build (18.x)

React Hook useEffect has a missing dependency: 'load'. Either include it or remove the dependency array

Check warning on line 502 in src/components/Workspace.jsx

View workflow job for this annotation

GitHub Actions / build (20.x)

React Hook useEffect has a missing dependency: 'load'. Either include it or remove the dependency array

return (
<div className="h-full flex flex-col overflow-hidden theme">
Expand Down Expand Up @@ -577,11 +576,10 @@
<div
key={x.name}
onClick={() => setSelectedDb(x.label)}
className={`space-y-3 p-3 rounded-md border-2 select-none ${
settings.mode === "dark"
? "bg-zinc-700 hover:bg-zinc-600"
: "bg-zinc-100 hover:bg-zinc-200"
} ${selectedDb === x.label ? "border-zinc-400" : "border-transparent"}`}
className={`space-y-3 p-3 rounded-md border-2 select-none ${settings.mode === "dark"
? "bg-zinc-700 hover:bg-zinc-600"
: "bg-zinc-100 hover:bg-zinc-200"
} ${selectedDb === x.label ? "border-zinc-400" : "border-transparent"}`}
>
<div className="flex items-center justify-between">
<div className="font-semibold">{x.name}</div>
Expand Down
Loading