Rename TablesContext to DiagramContext

This commit is contained in:
1ilit
2024-07-04 23:18:20 +03:00
parent 3b1af3772e
commit 9b606114df
24 changed files with 52 additions and 52 deletions

View File

@@ -13,7 +13,7 @@ import Note from "./Note";
import {
useSettings,
useTransform,
useTables,
useDiagram,
useUndoRedo,
useSelect,
useAreas,
@@ -25,7 +25,7 @@ import { diagram } from "../../data/heroDiagram";
export default function Canvas() {
const { t } = useTranslation();
const { tables, updateTable, relationships, addRelationship } = useTables();
const { tables, updateTable, relationships, addRelationship } = useDiagram();
const { areas, updateArea } = useAreas();
const { notes, updateNote } = useNotes();
const { layout } = useLayout();

View File

@@ -1,11 +1,11 @@
import { useRef } from "react";
import { Cardinality, ObjectType, Tab } from "../../data/constants";
import { calcPath } from "../../utils/calcPath";
import { useTables, useSettings, useLayout, useSelect } from "../../hooks";
import { useDiagram, useSettings, useLayout, useSelect } from "../../hooks";
export default function Relationship({ data }) {
const { settings } = useSettings();
const { tables } = useTables();
const { tables } = useDiagram();
const { layout } = useLayout();
const { selectedElement, setSelectedElement } = useSelect();
const pathRef = useRef();

View File

@@ -14,7 +14,7 @@ import {
IconKeyStroked,
} from "@douyinfe/semi-icons";
import { Popover, Tag, Button, SideSheet } from "@douyinfe/semi-ui";
import { useLayout, useSettings, useTables, useSelect } from "../../hooks";
import { useLayout, useSettings, useDiagram, useSelect } from "../../hooks";
import TableInfo from "../EditorSidePanel/TablesTab/TableInfo";
import { useTranslation } from "react-i18next";
@@ -28,7 +28,7 @@ export default function Table(props) {
setLinkingLine,
} = props;
const { layout } = useLayout();
const { deleteTable, deleteField } = useTables();
const { deleteTable, deleteField } = useDiagram();
const { settings } = useSettings();
const { t } = useTranslation();
const { selectedElement, setSelectedElement } = useSelect();