From 6071d6a8dfcfe6b793558ffa85a016091c44b441 Mon Sep 17 00:00:00 2001
From: Maximilian Giller <m.giller@tu-bs.de>
Date: Thu, 16 Jun 2022 14:57:16 +0200
Subject: [PATCH] Removed concept of tools

---
 src/editor/js/components/editor.tsx     |  6 +-
 src/editor/js/components/toolbutton.css |  9 ---
 src/editor/js/components/toolbutton.tsx | 26 --------
 src/editor/js/components/toolpool.css   |  5 --
 src/editor/js/components/toolpool.tsx   | 87 -------------------------
 5 files changed, 1 insertion(+), 132 deletions(-)
 delete mode 100644 src/editor/js/components/toolbutton.css
 delete mode 100644 src/editor/js/components/toolbutton.tsx
 delete mode 100644 src/editor/js/components/toolpool.css
 delete mode 100644 src/editor/js/components/toolpool.tsx

diff --git a/src/editor/js/components/editor.tsx b/src/editor/js/components/editor.tsx
index 1501825..912c06d 100644
--- a/src/editor/js/components/editor.tsx
+++ b/src/editor/js/components/editor.tsx
@@ -1,9 +1,8 @@
 import React from "react";
 import { State } from "../state";
 import * as Interactions from "../interactions";
-import { Graph, GraphData } from "../structures/graph/graph";
+import { Graph } from "../structures/graph/graph";
 import { loadGraphJson } from "../../../datasets";
-import { ToolPool } from "./toolpool";
 import { ToolDetails } from "./tooldetails";
 import { SpaceSelect } from "./spaceselect";
 import "./editor.css";
@@ -187,9 +186,6 @@ export class Editor extends React.PureComponent<propTypes, stateTypes> {
                             historyObject={this.state.graph}
                             onChange={this.onHistoryChange}
                         />
-
-                        <hr />
-                        <ToolPool state={this.state.state} />
                         <hr />
                         <ToolDetails />
                     </div>
diff --git a/src/editor/js/components/toolbutton.css b/src/editor/js/components/toolbutton.css
deleted file mode 100644
index 7151b39..0000000
--- a/src/editor/js/components/toolbutton.css
+++ /dev/null
@@ -1,9 +0,0 @@
-div#ks-editor #toolpool > button {
-    margin: 0.25rem;
-}
-
-div#ks-editor #toolpool > button > img {
-    max-height: 20px;
-    height: 20px;
-    width: auto;
-}
\ No newline at end of file
diff --git a/src/editor/js/components/toolbutton.tsx b/src/editor/js/components/toolbutton.tsx
deleted file mode 100644
index d344b48..0000000
--- a/src/editor/js/components/toolbutton.tsx
+++ /dev/null
@@ -1,26 +0,0 @@
-import { InferType } from "prop-types";
-import React from "react";
-import "./toolbutton.css";
-
-type propTypes = {
-    title: string;
-    icon: string;
-};
-
-export class ToolButton extends React.PureComponent<
-    propTypes,
-    InferType<typeof ToolButton.stateTypes>
-> {
-    static stateTypes = {};
-
-    render(): React.ReactNode {
-        return (
-            <button
-                title={this.props.title}
-                // onClick={() => this.props.state.setTool(this.props.tool)}
-            >
-                <img src={this.props.icon} />
-            </button>
-        );
-    }
-}
diff --git a/src/editor/js/components/toolpool.css b/src/editor/js/components/toolpool.css
deleted file mode 100644
index 77dd26a..0000000
--- a/src/editor/js/components/toolpool.css
+++ /dev/null
@@ -1,5 +0,0 @@
-div#ks-editor #toolpool {
-    display: flex;
-    flex-wrap: wrap;
-    justify-content: space-evenly;
-}
\ No newline at end of file
diff --git a/src/editor/js/components/toolpool.tsx b/src/editor/js/components/toolpool.tsx
deleted file mode 100644
index 545f053..0000000
--- a/src/editor/js/components/toolpool.tsx
+++ /dev/null
@@ -1,87 +0,0 @@
-import { InferType } from "prop-types";
-import React from "react";
-import { State } from "../state";
-import { ToolButton } from "./toolbutton";
-import wand from "../../images/tools/wand.png";
-import "./toolpool.css";
-
-type propTypes = {
-    state: State;
-};
-
-export class ToolPool extends React.PureComponent<
-    propTypes,
-    InferType<typeof ToolPool.stateTypes>
-> {
-    static stateTypes = {};
-
-    constructor(props: propTypes) {
-        super(props);
-    }
-
-    render(): React.ReactNode {
-        // Don't render anything if state is not defined
-        // TODO: Reactivate code later. Was commented to work on the proper toolpool render
-        // if (!this.state) {
-        //     return <div id="toolpool"></div>;
-        // }
-
-        return (
-            <div id="toolpool">
-                <ToolButton
-                    icon={wand}
-                    title="Example Tools"
-                    key="1"
-                ></ToolButton>
-                <ToolButton
-                    icon={wand}
-                    title="Example Tool"
-                    key="2"
-                ></ToolButton>
-                <ToolButton
-                    icon={wand}
-                    title="Example Tool"
-                    key="3"
-                ></ToolButton>
-                <ToolButton
-                    icon={wand}
-                    title="Example Tool"
-                    key="4"
-                ></ToolButton>
-                <ToolButton
-                    icon={wand}
-                    title="Example Tool"
-                    key="5"
-                ></ToolButton>
-                <ToolButton
-                    icon={wand}
-                    title="Example Tool"
-                    key="6"
-                ></ToolButton>
-                <ToolButton
-                    icon={wand}
-                    title="Example Tool"
-                    key="7"
-                ></ToolButton>
-                <ToolButton
-                    icon={wand}
-                    title="Example Tool"
-                    key="8"
-                ></ToolButton>
-                <ToolButton
-                    icon={wand}
-                    title="Example Tool"
-                    key="9"
-                ></ToolButton>
-
-                {/* {this.props.state.display.tools.map((t) => (
-                    <ToolButton
-                        tool={t}
-                        state={this.props.state}
-                        key={t.getKey()}
-                    />
-                ))} */}
-            </div>
-        );
-    }
-}
-- 
GitLab