MobileFooter.tsx 685 B

123456789101112131415161718192021222324252627282930
  1. import React from "react";
  2. import type * as TExcalidraw from "@excalidraw/excalidraw";
  3. import type { ExcalidrawImperativeAPI } from "@excalidraw/excalidraw/types";
  4. import CustomFooter from "./CustomFooter";
  5. const MobileFooter = ({
  6. excalidrawAPI,
  7. excalidrawLib,
  8. }: {
  9. excalidrawAPI: ExcalidrawImperativeAPI;
  10. excalidrawLib: typeof TExcalidraw;
  11. }) => {
  12. const { useDevice, Footer } = excalidrawLib;
  13. const device = useDevice();
  14. if (device.editor.isMobile) {
  15. return (
  16. <Footer>
  17. <CustomFooter
  18. excalidrawAPI={excalidrawAPI}
  19. excalidrawLib={excalidrawLib}
  20. />
  21. </Footer>
  22. );
  23. }
  24. return null;
  25. };
  26. export default MobileFooter;