diff --git a/src/components/LayerUI.tsx b/src/components/LayerUI.tsx index b7fb596c0..70232d117 100644 --- a/src/components/LayerUI.tsx +++ b/src/components/LayerUI.tsx @@ -547,7 +547,9 @@ const LayerUI = ({ onImageAction={onImageAction} renderTopRightUI={renderTopRightUI} renderStats={renderStats} - /> + > + {children} + ) : ( <> diff --git a/src/components/MobileMenu.tsx b/src/components/MobileMenu.tsx index ea45b393e..c99a40521 100644 --- a/src/components/MobileMenu.tsx +++ b/src/components/MobileMenu.tsx @@ -32,10 +32,7 @@ type MobileMenuProps = { onPenModeToggle: () => void; canvas: HTMLCanvasElement | null; isCollaborating: boolean; - renderCustomFooter?: ( - isMobile: boolean, - appState: AppState, - ) => JSX.Element | null; + viewModeEnabled: boolean; showThemeBtn: boolean; onImageAction: (data: { insertOnCanvasDirectly: boolean }) => void; @@ -44,6 +41,7 @@ type MobileMenuProps = { appState: AppState, ) => JSX.Element | null; renderStats: () => JSX.Element | null; + children?: React.ReactNode; }; export const MobileMenu = ({ @@ -59,12 +57,12 @@ export const MobileMenu = ({ onPenModeToggle, canvas, isCollaborating, - renderCustomFooter, viewModeEnabled, showThemeBtn, onImageAction, renderTopRightUI, renderStats, + children, }: MobileMenuProps) => { const renderToolbar = () => { return ( @@ -201,7 +199,7 @@ export const MobileMenu = ({
{renderCanvasActions()} - {renderCustomFooter?.(true, appState)} + {children} {appState.collaborators.size > 0 && (
{t("labels.collaborators")} diff --git a/src/excalidraw-app/components/Footer.tsx b/src/excalidraw-app/components/Footer.tsx index d25242a70..b2aadc363 100644 --- a/src/excalidraw-app/components/Footer.tsx +++ b/src/excalidraw-app/components/Footer.tsx @@ -1,4 +1,5 @@ import { isExcalidrawPlusSignedUser, PlusAppLinkJSX, PlusLPLinkJSX } from ".."; +import { useDevice } from "../../components/App"; import { shield } from "../../components/icons"; import { Tooltip } from "../../components/Tooltip"; import { t } from "../../i18n"; @@ -20,15 +21,14 @@ const EncryptedIcon = () => ( ); const Footer = ({ - isMobile, langCode, onLangChange, }: { - isMobile: boolean; langCode: string; onLangChange: (langCode: string) => void; }) => { - if (isMobile) { + const device = useDevice(); + if (device.isMobile) { const isTinyDevice = window.innerWidth < 362; return (
{ autoFocus={true} >