code-share/hooks/usePortrait.ts

9 lines
185 B
TypeScript
Raw Permalink Normal View History

2024-02-21 02:01:35 +07:00
import { useScreen } from "usehooks-ts";
export const usePortrait = () => {
const screen = useScreen();
const isPortrait = screen?.width < screen?.height;
return isPortrait;
};