put text before image

This commit is contained in:
dwelle
2025-10-07 23:02:28 +02:00
parent 257be7b48b
commit 50098dcc21

View File

@@ -153,8 +153,8 @@ export const MobileToolBar = ({
const MIN_WIDTH = MIN_TOOLS * WIDTH + (MIN_TOOLS - 1) * GAP; const MIN_WIDTH = MIN_TOOLS * WIDTH + (MIN_TOOLS - 1) * GAP;
const ADDITIONAL_WIDTH = WIDTH + GAP; const ADDITIONAL_WIDTH = WIDTH + GAP;
const showImageToolOutside = toolbarWidth >= MIN_WIDTH + 1 * ADDITIONAL_WIDTH; const showTextToolOutside = toolbarWidth >= MIN_WIDTH + 1 * ADDITIONAL_WIDTH;
const showTextToolOutside = toolbarWidth >= MIN_WIDTH + 2 * ADDITIONAL_WIDTH; const showImageToolOutside = toolbarWidth >= MIN_WIDTH + 2 * ADDITIONAL_WIDTH;
const showFrameToolOutside = toolbarWidth >= MIN_WIDTH + 3 * ADDITIONAL_WIDTH; const showFrameToolOutside = toolbarWidth >= MIN_WIDTH + 3 * ADDITIONAL_WIDTH;
const extraTools = [ const extraTools = [
@@ -164,7 +164,7 @@ export const MobileToolBar = ({
"laser", "laser",
"magicframe", "magicframe",
].filter((tool) => { ].filter((tool) => {
if (showTextToolOutside && tool === "text") { if (showImageToolOutside && tool === "image") {
return false; return false;
} }
if (showFrameToolOutside && tool === "frame") { if (showFrameToolOutside && tool === "frame") {
@@ -315,23 +315,6 @@ export const MobileToolBar = ({
} }
/> />
{/* Image */}
{showImageToolOutside && (
<ToolButton
className={clsx({
active: activeTool.type === "image",
})}
type="radio"
icon={ImageIcon}
checked={activeTool.type === "image"}
name="editor-current-shape"
title={`${capitalizeString(t("toolBar.image"))}`}
aria-label={capitalizeString(t("toolBar.image"))}
data-testid="toolbar-image"
onChange={() => handleToolChange("image")}
/>
)}
{/* Text Tool */} {/* Text Tool */}
{showTextToolOutside && ( {showTextToolOutside && (
<ToolButton <ToolButton
@@ -349,6 +332,23 @@ export const MobileToolBar = ({
/> />
)} )}
{/* Image */}
{showImageToolOutside && (
<ToolButton
className={clsx({
active: activeTool.type === "image",
})}
type="radio"
icon={ImageIcon}
checked={activeTool.type === "image"}
name="editor-current-shape"
title={`${capitalizeString(t("toolBar.image"))}`}
aria-label={capitalizeString(t("toolBar.image"))}
data-testid="toolbar-image"
onChange={() => handleToolChange("image")}
/>
)}
{/* Frame Tool */} {/* Frame Tool */}
{showFrameToolOutside && ( {showFrameToolOutside && (
<ToolButton <ToolButton
@@ -402,6 +402,17 @@ export const MobileToolBar = ({
{t("toolBar.text")} {t("toolBar.text")}
</DropdownMenu.Item> </DropdownMenu.Item>
)} )}
{!showImageToolOutside && (
<DropdownMenu.Item
onSelect={() => app.setActiveTool({ type: "image" })}
icon={ImageIcon}
data-testid="toolbar-image"
selected={activeTool.type === "image"}
>
{t("toolBar.image")}
</DropdownMenu.Item>
)}
{!showFrameToolOutside && ( {!showFrameToolOutside && (
<DropdownMenu.Item <DropdownMenu.Item
onSelect={() => app.setActiveTool({ type: "frame" })} onSelect={() => app.setActiveTool({ type: "frame" })}