add toggle pen mode to MobileMenu

This commit is contained in:
zsviczian
2025-11-06 18:51:40 +00:00
parent c99e81678b
commit a112b135bf

View File

@@ -13,6 +13,8 @@ import { FixedSideContainer } from "./FixedSideContainer";
import { Island } from "./Island"; import { Island } from "./Island";
import { PenModeButton } from "./PenModeButton";
import type { ActionManager } from "../actions/manager"; import type { ActionManager } from "../actions/manager";
import type { import type {
AppClassProperties, AppClassProperties,
@@ -58,6 +60,7 @@ export const MobileMenu = ({
renderWelcomeScreen, renderWelcomeScreen,
UIOptions, UIOptions,
app, app,
onPenModeToggle,
}: MobileMenuProps) => { }: MobileMenuProps) => {
const { const {
WelcomeScreenCenterTunnel, WelcomeScreenCenterTunnel,
@@ -72,7 +75,18 @@ export const MobileMenu = ({
const topRightUI = ( const topRightUI = (
<div className="excalidraw-ui-top-right"> <div className="excalidraw-ui-top-right">
{renderTopRightUI?.(true, appState) ?? {renderTopRightUI?.(true, appState) ??
(!appState.viewModeEnabled && <DefaultSidebarTriggerTunnel.Out />)} (!appState.viewModeEnabled && (
<>
<DefaultSidebarTriggerTunnel.Out />
<PenModeButton
checked={appState.penMode}
onChange={() => onPenModeToggle(null)}
title={t("toolBar.penMode")}
isMobile
penDetected={appState.penDetected}
/>
</>
))}
{appState.viewModeEnabled && ( {appState.viewModeEnabled && (
<ExitViewModeButton actionManager={actionManager} /> <ExitViewModeButton actionManager={actionManager} />
)} )}