diff --git a/public/index.html b/public/index.html
index 36434bf3..562a2683 100644
--- a/public/index.html
+++ b/public/index.html
@@ -81,7 +81,7 @@
-
+
Excalidraw
diff --git a/src/actions/actionCanvas.tsx b/src/actions/actionCanvas.tsx
index c1c31a0d..aa912cb9 100644
--- a/src/actions/actionCanvas.tsx
+++ b/src/actions/actionCanvas.tsx
@@ -3,7 +3,7 @@ import { Action } from "./types";
import { ColorPicker } from "../components/ColorPicker";
import { getDefaultAppState } from "../appState";
import { trash } from "../components/icons";
-import { ToolIcon } from "../components/ToolIcon";
+import { ToolButton } from "../components/ToolButton";
export const actionChangeViewBackgroundColor: Action = {
name: "changeViewBackgroundColor",
@@ -14,6 +14,7 @@ export const actionChangeViewBackgroundColor: Action = {
return (
updateData(color)}
@@ -32,7 +33,7 @@ export const actionClearCanvas: Action = {
};
},
PanelComponent: ({ updateData, t }) => (
- (
- (
- (
<>
- {t("labels.stroke")}
+ {t("labels.stroke")}
(
<>
- {t("labels.background")}
+ {t("labels.background")}
(
- <>
- {t("labels.fill")}
+
),
};
@@ -136,9 +139,10 @@ export const actionChangeStrokeWidth: Action = {
};
},
PanelComponent: ({ elements, appState, updateData, t }) => (
- <>
- {t("labels.strokeWidth")}
+
),
};
@@ -167,9 +171,10 @@ export const actionChangeSloppiness: Action = {
};
},
PanelComponent: ({ elements, appState, updateData, t }) => (
- <>
- {t("labels.sloppiness")}
+
),
};
@@ -198,8 +203,8 @@ export const actionChangeOpacity: Action = {
};
},
PanelComponent: ({ elements, appState, updateData, t }) => (
- <>
- {t("labels.opacity")}
+
),
};
@@ -238,9 +243,10 @@ export const actionChangeFontSize: Action = {
};
},
PanelComponent: ({ elements, appState, updateData, t }) => (
- <>
- {t("labels.fontSize")}
+
),
};
@@ -278,9 +284,10 @@ export const actionChangeFontFamily: Action = {
};
},
PanelComponent: ({ elements, appState, updateData, t }) => (
- <>
- {t("labels.fontFamily")}
+
),
};
diff --git a/src/components/ButtonSelect.tsx b/src/components/ButtonSelect.tsx
index a345b8b0..0177c4b3 100644
--- a/src/components/ButtonSelect.tsx
+++ b/src/components/ButtonSelect.tsx
@@ -4,21 +4,28 @@ export function ButtonSelect({
options,
value,
onChange,
+ group,
}: {
options: { value: T; text: string }[];
value: T | null;
onChange: (value: T) => void;
+ group: string;
}) {
return (
{options.map(option => (
-
+
))}
);
diff --git a/src/components/ColorPicker.tsx b/src/components/ColorPicker.tsx
index 2885203c..956a215c 100644
--- a/src/components/ColorPicker.tsx
+++ b/src/components/ColorPicker.tsx
@@ -10,10 +10,12 @@ const Picker = function({
colors,
color,
onChange,
+ label,
}: {
colors: string[];
color: string | null;
onChange: (color: string) => void;
+ label: string;
}) {
return (
@@ -42,6 +44,7 @@ const Picker = function({
{
onChange(color);
}}
@@ -54,9 +57,11 @@ const Picker = function({
function ColorInput({
color,
onChange,
+ label,
}: {
color: string | null;
onChange: (color: string) => void;
+ label: string;
}) {
const colorRegex = /^([0-9a-f]{3}|[0-9a-f]{6}|[0-9a-f]{8}|transparent)$/;
const [innerValue, setInnerValue] = React.useState(color);
@@ -71,7 +76,7 @@ function ColorInput({
{
const value = e.target.value;
if (value.match(colorRegex)) {
@@ -91,10 +96,12 @@ export function ColorPicker({
type,
color,
onChange,
+ label,
}: {
type: "canvasBackground" | "elementBackground" | "elementStroke";
color: string | null;
onChange: (color: string) => void;
+ label: string;
}) {
const [isActive, setActive] = React.useState(false);
@@ -103,12 +110,13 @@ export function ColorPicker({