From e14980c8948ade6f728050a08d93ca62b46cf1de Mon Sep 17 00:00:00 2001 From: Duc-Quan Do <99700700+ducquando@users.noreply.github.com> Date: Fri, 3 May 2024 15:35:13 +0700 Subject: [PATCH] Modify toolbar (#9) * Allow shape to change text styles --- package.json | 2 +- src/wireframes/components/ToolView.tsx | 98 +++++++++++++++----------- 2 files changed, 56 insertions(+), 44 deletions(-) diff --git a/package.json b/package.json index 3c71b6f..5c7bc7b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "codeslide.net", - "version": "0.4.0", + "version": "0.4.1", "private": true, "dependencies": { "@ant-design/icons": "^4.8.1", diff --git a/src/wireframes/components/ToolView.tsx b/src/wireframes/components/ToolView.tsx index 861d3f1..7b105ec 100644 --- a/src/wireframes/components/ToolView.tsx +++ b/src/wireframes/components/ToolView.tsx @@ -28,49 +28,61 @@ export const ToolView = (props: ToolViewProps) => { const MoreTools = (props: {item: DiagramItem}) => { const renderer = props.item.renderer; - if (renderer == shapes.id.table) { - return ( - <> - - - - - - - - ) - } else if (renderer == shapes.id.image || renderer == shapes.id.graphic) { - return ( - <> - - - - ) - } else if (renderer == shapes.id.textbox || renderer == shapes.id.equation) { - return ( - <> - - - - ) - } else if (renderer == shapes.id.line) { - return ( - <> - - - - - - - - ) - } else { - return ( - <> - - - - ) + switch (renderer) { + case shapes.id.table: + return ( + <> + + + + + + + + ); + case shapes.id.image: + case shapes.id.graphic: + return ( + <> + + + + ); + case shapes.id.textbox: + case shapes.id.equation: + return ( + <> + + + + ); + case shapes.id.line: + return ( + <> + + + + + + + + ); + case shapes.id.shape: + return ( + <> + + + + + + ); + default: + return ( + <> + + + + ); } }