From ac91ea48e71ac43ab2ab37e20ca92fc21c56b632 Mon Sep 17 00:00:00 2001
From: Leo Hong <5917188+low-earth-orbit@users.noreply.github.com>
Date: Mon, 30 Sep 2024 20:24:40 -0300
Subject: [PATCH] Add GitHub link
---
components/Canvas.tsx | 21 +++++++++++++++++++
components/{toolbar => }/icons/DeleteIcon.tsx | 0
components/{toolbar => }/icons/DrawIcon.tsx | 0
components/{toolbar => }/icons/EraserIcon.tsx | 0
components/icons/GitHubIcon.tsx | 16 ++++++++++++++
components/{toolbar => }/icons/SelectIcon.tsx | 0
components/{toolbar => }/icons/ShapesIcon.tsx | 0
components/toolbar/Toolbar.tsx | 10 ++++-----
8 files changed, 42 insertions(+), 5 deletions(-)
rename components/{toolbar => }/icons/DeleteIcon.tsx (100%)
rename components/{toolbar => }/icons/DrawIcon.tsx (100%)
rename components/{toolbar => }/icons/EraserIcon.tsx (100%)
create mode 100644 components/icons/GitHubIcon.tsx
rename components/{toolbar => }/icons/SelectIcon.tsx (100%)
rename components/{toolbar => }/icons/ShapesIcon.tsx (100%)
diff --git a/components/Canvas.tsx b/components/Canvas.tsx
index 2aea8a9..7db934c 100644
--- a/components/Canvas.tsx
+++ b/components/Canvas.tsx
@@ -29,6 +29,8 @@ import {
import ShapePanel from "./toolbar/ShapePanel";
import TextPanel from "./toolbar/TextPanel";
import { setStrokeColor, setStrokeWidth } from "@/redux/shapeSlice";
+import { Fab } from "@mui/material";
+import GitHubIcon from "./icons/GitHubIcon";
export interface StageSizeType {
width: number;
@@ -522,6 +524,25 @@ export default function Canvas() {
onClose={() => setTextPanelVisible(false)}
selectedObjectId={selectedObjectId}
/>
+
+ window.open(
+ "https://github.com/low-earth-orbit/konva-whiteboard",
+ "_blank",
+ )
+ }
+ >
+
+ View Source
+
>
);
}
diff --git a/components/toolbar/icons/DeleteIcon.tsx b/components/icons/DeleteIcon.tsx
similarity index 100%
rename from components/toolbar/icons/DeleteIcon.tsx
rename to components/icons/DeleteIcon.tsx
diff --git a/components/toolbar/icons/DrawIcon.tsx b/components/icons/DrawIcon.tsx
similarity index 100%
rename from components/toolbar/icons/DrawIcon.tsx
rename to components/icons/DrawIcon.tsx
diff --git a/components/toolbar/icons/EraserIcon.tsx b/components/icons/EraserIcon.tsx
similarity index 100%
rename from components/toolbar/icons/EraserIcon.tsx
rename to components/icons/EraserIcon.tsx
diff --git a/components/icons/GitHubIcon.tsx b/components/icons/GitHubIcon.tsx
new file mode 100644
index 0000000..e0b8341
--- /dev/null
+++ b/components/icons/GitHubIcon.tsx
@@ -0,0 +1,16 @@
+import { SvgIcon } from "@mui/material";
+
+export default function GitHubIcon({ ...props }) {
+ return (
+
+
+
+ );
+}
diff --git a/components/toolbar/icons/SelectIcon.tsx b/components/icons/SelectIcon.tsx
similarity index 100%
rename from components/toolbar/icons/SelectIcon.tsx
rename to components/icons/SelectIcon.tsx
diff --git a/components/toolbar/icons/ShapesIcon.tsx b/components/icons/ShapesIcon.tsx
similarity index 100%
rename from components/toolbar/icons/ShapesIcon.tsx
rename to components/icons/ShapesIcon.tsx
diff --git a/components/toolbar/Toolbar.tsx b/components/toolbar/Toolbar.tsx
index 3bc4706..0406b47 100644
--- a/components/toolbar/Toolbar.tsx
+++ b/components/toolbar/Toolbar.tsx
@@ -10,10 +10,10 @@ import {
} from "@mui/material";
import { HexColorPicker } from "react-colorful";
-import EraserIcon from "./icons/EraserIcon";
-import DrawIcon from "./icons/DrawIcon";
-import DeleteIcon from "./icons/DeleteIcon";
-import ShapesIcon from "./icons/ShapesIcon";
+import EraserIcon from "../icons/EraserIcon";
+import DrawIcon from "../icons/DrawIcon";
+import DeleteIcon from "../icons/DeleteIcon";
+import ShapesIcon from "../icons/ShapesIcon";
import {
Palette,
LineWeightRounded,
@@ -36,7 +36,7 @@ import {
undo,
updateSelectedTool,
} from "@/redux/canvasSlice";
-import SelectIcon from "./icons/SelectIcon";
+import SelectIcon from "../icons/SelectIcon";
export function LineWeightSliderValueLabel(props: SliderValueLabelProps) {
const { children, value } = props;