Skip to content

Commit

Permalink
refactor: Split BlockGroupField as a file
Browse files Browse the repository at this point in the history
  • Loading branch information
miyanokomiya committed Sep 24, 2024
1 parent c145d1d commit 86ac604
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 11 deletions.
9 changes: 0 additions & 9 deletions src/components/atoms/BlockField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,3 @@ export const BlockField: React.FC<Props> = ({ label, children }) => {
</div>
);
};

export const BlockGroupField: React.FC<Props> = ({ label, children }) => {
return (
<div className="flex flex-col gap-1">
<span>{label}:</span>
<div className="ml-2 pl-2 border-l border-gray-400 flex flex-col gap-1">{children}</div>
</div>
);
};
13 changes: 13 additions & 0 deletions src/components/atoms/BlockGroupField.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
interface Props {
label: string;
children?: React.ReactNode;
}

export const BlockGroupField: React.FC<Props> = ({ label, children }) => {
return (
<div className="flex flex-col gap-1">
<span>{label}:</span>
<div className="ml-2 pl-2 border-l border-gray-400 flex flex-col gap-1">{children}</div>
</div>
);
};
2 changes: 1 addition & 1 deletion src/components/shapeInspectorPanel/ClipInspector.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { useCallback } from "react";
import { ClipRule, Shape } from "../../models";
import { BlockGroupField } from "../atoms/BlockField";
import { BlockGroupField } from "../atoms/BlockGroupField";
import iconClipIn from "../../assets/icons/clip_rule_in.svg";
import iconClipOut from "../../assets/icons/clip_rule_out.svg";
import { GroupShape, isGroupShape } from "../../shapes/group";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { useCallback } from "react";
import { GroupConstraint, Shape } from "../../models";
import { BlockField, BlockGroupField } from "../atoms/BlockField";
import { BlockField } from "../atoms/BlockField";
import { BlockGroupField } from "../atoms/BlockGroupField";
import gcIcon0 from "../../assets/icons/group_constraints_0.svg";
import gcIcon1 from "../../assets/icons/group_constraints_1.svg";
import gcIcon2 from "../../assets/icons/group_constraints_2.svg";
Expand Down

0 comments on commit 86ac604

Please sign in to comment.