From c4b986d832147692426ce702ae6996fc6528d9d9 Mon Sep 17 00:00:00 2001 From: Kostya Cholak Date: Mon, 8 Jul 2024 21:06:39 +0400 Subject: [PATCH] chore: refactor --- src/components/canvas/DictWidget.tsx | 2 +- src/components/canvas/ListWidget.tsx | 2 +- src/components/canvas/NumberWidget.tsx | 1 - src/components/canvas/VListWidget.tsx | 3 +-- 4 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/components/canvas/DictWidget.tsx b/src/components/canvas/DictWidget.tsx index a3e7b3b..29ab7bd 100644 --- a/src/components/canvas/DictWidget.tsx +++ b/src/components/canvas/DictWidget.tsx @@ -1,4 +1,4 @@ -import { getStructureFromSource, RefSource, Representation, Source } from "@/sources"; +import { getStructureFromSource, Representation, Source } from "@/sources"; import getSize, { type Size } from "@/structures/size"; import { BaseStructure, DictStructure } from "@/structures/types"; import React, { useMemo } from "react"; diff --git a/src/components/canvas/ListWidget.tsx b/src/components/canvas/ListWidget.tsx index e4ccc1c..db05cf0 100644 --- a/src/components/canvas/ListWidget.tsx +++ b/src/components/canvas/ListWidget.tsx @@ -110,7 +110,7 @@ function ListCanvasComponent(props: WidgetProps) { "data": source.map(source => getStructureFromSource(props.structure, source)), } } else { - structure = getStructureFromSource(props.structure, source as RefSource) as ListStructure; + structure = getStructureFromSource(props.structure, source) as ListStructure; } const size = getSize(props.structure, representation); diff --git a/src/components/canvas/NumberWidget.tsx b/src/components/canvas/NumberWidget.tsx index 4542a01..010b64c 100644 --- a/src/components/canvas/NumberWidget.tsx +++ b/src/components/canvas/NumberWidget.tsx @@ -1,5 +1,4 @@ import { getStructureFromSource, Representation, Source } from "@/sources"; -import getByPath from "@/structures/path_ref"; import getSize, { Size } from "@/structures/size"; import { Rect, Text } from "react-konva"; import { Widget } from "../registry"; diff --git a/src/components/canvas/VListWidget.tsx b/src/components/canvas/VListWidget.tsx index 4ec2af3..952fa25 100644 --- a/src/components/canvas/VListWidget.tsx +++ b/src/components/canvas/VListWidget.tsx @@ -1,4 +1,4 @@ -import { getStructureFromSource, RefSource, Representation, Source } from "@/sources"; +import { getStructureFromSource, Representation, Source } from "@/sources"; import getSize, { type Size } from "@/structures/size"; import { BaseStructure, ListStructure } from "@/structures/types"; import { Group, Rect } from "react-konva"; @@ -106,7 +106,6 @@ function ListCanvasComponent(props: WidgetProps) { "data": source.map(source => getStructureFromSource(props.structure, source)), } } else { - const source = source as RefSource; structure = getStructureFromSource(props.structure, source) as ListStructure; }