Adding: themes, predictions, match reporting, ui fixes, sse fixes, badge fixes, match flow, i18n, match edits, perf, auth fix #22
@@ -5,11 +5,13 @@ const eventListerOptions = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const useVisualViewportSize = () => {
|
const useVisualViewportSize = () => {
|
||||||
const windowExists = typeof window !== 'undefined';
|
// Starts at zero on server and client alike, filling in after mount — the
|
||||||
|
// same contract as Mantine's useViewportSize. Reading window during render
|
||||||
|
// makes the client's first render disagree with the SSR markup.
|
||||||
const [windowSize, setWindowSize] = useState({
|
const [windowSize, setWindowSize] = useState({
|
||||||
width: windowExists ? window.visualViewport?.width || 0 : 0,
|
width: 0,
|
||||||
height: windowExists ? window.visualViewport?.height || 0 : 0,
|
height: 0,
|
||||||
top: windowExists ? window.visualViewport?.offsetTop || 0 : 0,
|
top: 0,
|
||||||
});
|
});
|
||||||
const rafRef = useRef<number | null>(null);
|
const rafRef = useRef<number | null>(null);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user