diff --git a/net/web/src/App.styled.js b/net/web/src/App.styled.js index 25b48106..73f4ddb4 100644 --- a/net/web/src/App.styled.js +++ b/net/web/src/App.styled.js @@ -3,5 +3,5 @@ import styled from 'styled-components'; export const AppWrapper = styled.div` position: absolute; width: 100vw; - height: 100vh; + height: calc(100vh - calc(100vh - 100%)); `; diff --git a/net/web/src/context/useViewportContext.hook.js b/net/web/src/context/useViewportContext.hook.js index c0d1fe4c..883fb1fc 100644 --- a/net/web/src/context/useViewportContext.hook.js +++ b/net/web/src/context/useViewportContext.hook.js @@ -13,23 +13,27 @@ export function useViewportContext() { const handleResize = () => { if (window.innerWidth < SMALL_MEDIUM) { - updateState({ display: 'small' }); + updateState({ display: 'small', width: window.innerWidth, height: window.innerHeight }); } else if (window.innerWidth < MEDIUM_LARGE) { - updateState({ display: 'medium' }); + updateState({ display: 'medium', width: window.innerWidth, height: window.innerHeight }); } else if (window.innerWidth < LARGE_XLARGE) { - updateState({ display: 'large' }); + updateState({ display: 'large', width: window.innerWidth, height: window.innerHeight }); } else { - updateState({ display: 'xlarge' }); + updateState({ display: 'xlarge', width: window.innerWidth, height: window.innerHeight }); } }; useEffect(() => { handleResize(); - window.addEventListener('resize', handleResize) - return () => window.removeEventListener('resize', handleResize) + window.addEventListener('resize', handleResize); + window.addEventListener('orientationchange', handleResize); + return () => { + window.removeEventListener('resize', handleResize); + window.removeEventListener('orientationchange', handleResize); + } }, []); return { state, actions: {} } diff --git a/net/web/src/session/profile/Profile.jsx b/net/web/src/session/profile/Profile.jsx index 43a48bfb..ac444665 100644 --- a/net/web/src/session/profile/Profile.jsx +++ b/net/web/src/session/profile/Profile.jsx @@ -1,4 +1,18 @@ +import { useContext } from 'react'; +import { Button } from 'antd'; +import { AppContext } from 'context/AppContext'; +import { ViewportContext } from 'context/ViewportContext'; + export function Profile() { - return <> + + const app = useContext(AppContext); + const viewport = useContext(ViewportContext); + + return ( +
+ +
{ JSON.stringify(viewport.state) }
+
+ ); }