mirror of https://github.com/usememos/memos
chore: add use reponsive width
parent
9227ca5b5b
commit
0ea0645258
@ -0,0 +1,18 @@
|
||||
import useWindowSize from "react-use/lib/useWindowSize";
|
||||
|
||||
enum TailwindResponsiveWidth {
|
||||
sm = 640,
|
||||
md = 768,
|
||||
lg = 1024,
|
||||
}
|
||||
|
||||
const useResponsiveWidth = () => {
|
||||
const { width } = useWindowSize();
|
||||
return {
|
||||
sm: width >= TailwindResponsiveWidth.sm,
|
||||
md: width >= TailwindResponsiveWidth.md,
|
||||
lg: width >= TailwindResponsiveWidth.lg,
|
||||
};
|
||||
};
|
||||
|
||||
export default useResponsiveWidth;
|
Loading…
Reference in New Issue