lfortran / lcompilers_frontend

The sources of the web LFortran GUI interface

Home Page:https://dev.lfortran.org/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Improve the layout on a phone

certik opened this issue · comments

On my iPhone, the site works, but I can only see the code window, I have to scroll down to see the output. So people might not realize there is an image output.

useEffect(() => {
const updateMyHeight = () => {
const minHeightWidht = (window.innerWidth < window.innerHeight) ? window.innerWidth - 40 : window.innerHeight - 182;
setMyHeight(minHeightWidht);
}
window.addEventListener("resize", updateMyHeight);
updateMyHeight();
return () => window.removeEventListener("resize", updateMyHeight)
}, [])

It seems we might need a useEffect() to accomplish this. We previous had this useEffect as shown above.

Also, I came across this https://stackoverflow.com/questions/59494037/how-to-detect-the-device-on-react-ssr-app-with-next-js. It seems useful.

This is how it looks like on my iPhone now:

IMG_3411

So I think the issue is fixed. Thanks a lot @Shaikh-Ubaid for fixing it!