summaryrefslogtreecommitdiffstats
path: root/examples/with-script-in-browser/components/MobileFooter.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'examples/with-script-in-browser/components/MobileFooter.tsx')
-rw-r--r--examples/with-script-in-browser/components/MobileFooter.tsx28
1 files changed, 28 insertions, 0 deletions
diff --git a/examples/with-script-in-browser/components/MobileFooter.tsx b/examples/with-script-in-browser/components/MobileFooter.tsx
new file mode 100644
index 0000000..c8fc0f1
--- /dev/null
+++ b/examples/with-script-in-browser/components/MobileFooter.tsx
@@ -0,0 +1,28 @@
+import React from "react";
+import type { ExcalidrawImperativeAPI } from "@excalidraw/excalidraw/types";
+import CustomFooter from "./CustomFooter";
+import type * as TExcalidraw from "@excalidraw/excalidraw";
+
+const MobileFooter = ({
+ excalidrawAPI,
+ excalidrawLib,
+}: {
+ excalidrawAPI: ExcalidrawImperativeAPI;
+ excalidrawLib: typeof TExcalidraw;
+}) => {
+ const { useDevice, Footer } = excalidrawLib;
+
+ const device = useDevice();
+ if (device.editor.isMobile) {
+ return (
+ <Footer>
+ <CustomFooter
+ excalidrawAPI={excalidrawAPI}
+ excalidrawLib={excalidrawLib}
+ />
+ </Footer>
+ );
+ }
+ return null;
+};
+export default MobileFooter;