fix: Positioning of editing toolbar on mobile devices (#6279)
This commit is contained in:
21
app/components/MobileScrollWrapper.tsx
Normal file
21
app/components/MobileScrollWrapper.tsx
Normal file
@@ -0,0 +1,21 @@
|
||||
import * as React from "react";
|
||||
import styled from "styled-components";
|
||||
import useMobile from "~/hooks/useMobile";
|
||||
|
||||
type Props = {
|
||||
children: React.ReactNode;
|
||||
};
|
||||
|
||||
const MobileWrapper = styled.div`
|
||||
width: 100vw;
|
||||
height: 100vh;
|
||||
overflow: auto;
|
||||
-webkit-overflow-scrolling: touch;
|
||||
`;
|
||||
|
||||
const MobileScrollWrapper = ({ children }: Props) => {
|
||||
const isMobile = useMobile();
|
||||
return isMobile ? <MobileWrapper>{children}</MobileWrapper> : <>{children}</>;
|
||||
};
|
||||
|
||||
export default MobileScrollWrapper;
|
||||
Reference in New Issue
Block a user