Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modify toolbar #9

Merged
merged 2 commits into from
May 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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