Skip to content

Commit

Permalink
Merge branch 'master' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
invisal committed Mar 16, 2024
2 parents 02e3593 + 21cbb9e commit 3f517c1
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions src/components/schema-sidebar-list.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@ export default function SchemaList({ search }: Readonly<SchemaListProps>) {

const prepareContextMenu = useCallback(
(tableName?: string) => {
console.log(tableName);

return [
{
title: "Copy Name",
Expand Down Expand Up @@ -114,15 +116,24 @@ export default function SchemaList({ search }: Readonly<SchemaListProps>) {
return (
<ScrollArea
className="flex-grow select-none"
onContextMenu={openContextMenuFromEvent(prepareContextMenu())}
onContextMenu={(e) =>
openContextMenuFromEvent(
prepareContextMenu(
selectedIndex && schema[selectedIndex]
? schema[selectedIndex].name
: undefined
)
)(e)
}
>
<div className="flex flex-col p-2 pr-4">
{filteredSchema.map((item, schemaIndex) => {
return (
<SchemaViewItem
onContextMenu={openContextMenuFromEvent(
prepareContextMenu(item.name)
)}
onContextMenu={(e) => {
openContextMenuFromEvent(prepareContextMenu(item.name))(e);
e.stopPropagation();
}}
key={item.name}
title={item.name}
icon={Table2}
Expand Down

0 comments on commit 3f517c1

Please sign in to comment.