Skip to content

Commit

Permalink
Modify toolbar (#9)
Browse files Browse the repository at this point in the history
* Allow shape to change text styles
  • Loading branch information
ducquando authored May 3, 2024
1 parent 6cc5507 commit e14980c
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 44 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "codeslide.net",
"version": "0.4.0",
"version": "0.4.1",
"private": true,
"dependencies": {
"@ant-design/icons": "^4.8.1",
Expand Down
98 changes: 55 additions & 43 deletions src/wireframes/components/ToolView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
<>
<span className='menu-separator' />
<TextTool />
<span className='menu-separator' />
<VisualTool />
<span className='menu-separator' />
<TableTool />
</>
)
} else if (renderer == shapes.id.image || renderer == shapes.id.graphic) {
return (
<>
<span className='menu-separator' />
<GraphicTool />
</>
)
} else if (renderer == shapes.id.textbox || renderer == shapes.id.equation) {
return (
<>
<span className='menu-separator' />
<TextTool />
</>
)
} else if (renderer == shapes.id.line) {
return (
<>
<span className='menu-separator' />
<TextTool />
<span className='menu-separator' />
<VisualTool />
<span className='menu-separator' />
<LineTool lineType={props.item.appearance.get(shapes.key.lineType)} />
</>
)
} else {
return (
<>
<span className='menu-separator' />
<VisualTool />
</>
)
switch (renderer) {
case shapes.id.table:
return (
<>
<span className='menu-separator' />
<TextTool />
<span className='menu-separator' />
<VisualTool />
<span className='menu-separator' />
<TableTool />
</>
);
case shapes.id.image:
case shapes.id.graphic:
return (
<>
<span className='menu-separator' />
<GraphicTool />
</>
);
case shapes.id.textbox:
case shapes.id.equation:
return (
<>
<span className='menu-separator' />
<TextTool />
</>
);
case shapes.id.line:
return (
<>
<span className='menu-separator' />
<TextTool />
<span className='menu-separator' />
<VisualTool />
<span className='menu-separator' />
<LineTool lineType={props.item.appearance.get(shapes.key.lineType)} />
</>
);
case shapes.id.shape:
return (
<>
<span className='menu-separator' />
<TextTool />
<span className='menu-separator' />
<VisualTool />
</>
);
default:
return (
<>
<span className='menu-separator' />
<VisualTool />
</>
);
}
}

Expand Down

0 comments on commit e14980c

Please sign in to comment.