Changed story dimensions

Improved logging
This commit is contained in:
2023-07-16 00:18:30 +03:00
parent f4226237ab
commit 3668e8c33f
4 changed files with 9 additions and 13 deletions

View File

@ -54,7 +54,7 @@ function useFetch<R, T>(
useEffect(() => {
doSend().then(
data => { if (data !== undefined) setData(data) }
).catch(
).catch( // must never occur
err => import.meta.env.DEV && console.error('Failed to do fetch request', err)
)
}, [doSend])

View File

@ -1,15 +1,13 @@
import { useState, useEffect } from 'react';
function getWindowDimensions() {
const { innerWidth: width, innerHeight: height } = window;
const getWindowDimensions = () => (
{
width: window.innerWidth,
height: window.innerHeight
}
)
return {
width,
height
};
}
function useStoryDimensions(maxRatio = 16/9) {
function useStoryDimensions(maxRatio = 16 / 9) {
const [windowDimensions, setWindowDimensions] = useState(getWindowDimensions())
useEffect(() => {