mirror of
https://github.com/muerwre/vault-frontend.git
synced 2025-04-25 04:46:40 +07:00
fixed mobile appearance of dialogs
This commit is contained in:
parent
4483d7a0f5
commit
042f238590
8 changed files with 25 additions and 19 deletions
|
@ -1,10 +1,15 @@
|
|||
import { useCallback, useEffect, useState } from 'react';
|
||||
|
||||
export const useWindowSize = () => {
|
||||
const [size, setSize] = useState({ innerWidth: 0, innerHeight: 0 });
|
||||
const [size, setSize] = useState({ innerWidth: 0, innerHeight: 0, isMobile: false });
|
||||
|
||||
const onResize = useCallback(
|
||||
() => setSize({ innerWidth: window.innerWidth, innerHeight: window.innerHeight }),
|
||||
() =>
|
||||
setSize({
|
||||
innerWidth: window.innerWidth,
|
||||
innerHeight: window.innerHeight,
|
||||
isMobile: window.innerWidth < 768,
|
||||
}),
|
||||
[]
|
||||
);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue