MobileFooter.tsx 683 B

12345678910111213141516171819202122232425262728
  1. import React from "react";
  2. import type { ExcalidrawImperativeAPI } from "@excalidraw/excalidraw/types";
  3. import CustomFooter from "./CustomFooter";
  4. import type * as TExcalidraw from "@excalidraw/excalidraw";
  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;