Skip to content

Commit

Permalink
fix: small height on mobile screen
Browse files Browse the repository at this point in the history
  • Loading branch information
Dun-sin committed Dec 23, 2022
1 parent 819da2e commit ae270bf
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 18 deletions.
17 changes: 1 addition & 16 deletions client/src/App.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { useState, useEffect } from 'react';
import { Navigate, Route, Routes } from 'react-router-dom';

// Store
Expand All @@ -17,23 +16,9 @@ import Settings from 'pages/Settings';

function App() {
const { isLoggedIn } = useAuth();
const [correctViewHeight, setCorrectViewHeight] = useState(
window.innerHeight * 0.01
);

// Set height for mobile so it doesn't get hidden in some browsers
useEffect(() => {
function setNewViewHeight() {
setCorrectViewHeight(window.innerHeight * 0.01)
}

window.addEventListener('resize', setNewViewHeight)

return () => window.removeEventListener('resize', setNewViewHeight)
}, []);

return (
<div className={`flex flex-col-reverse md:flex-row max-h-[${correctViewHeight}px]`}>
<div className={`flex flex-col-reverse md:flex-row h-screen`}>
{/* TODO: Create layouts */}
{isLoggedIn && <NavBar />}
<Routes>
Expand Down
2 changes: 1 addition & 1 deletion client/src/pages/Settings.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ const Searching = () => {

return (
<div
className="md:flex md:justify-center md:items-center flex-col min-w-[calc(100%-120px)] p-2 gap-5 bg-primary md:min-h-screen min-h-full"
className="flex justify-center items-center flex-col min-w-[calc(100%-120px)] p-2 gap-5 bg-primary min-h-full"
>
<Form onSubmit={handleSubmit} onChange={handleChange}>
<Divider className="text-white">Notifications</Divider>
Expand Down
1 change: 0 additions & 1 deletion client/src/pages/Start.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ const Start = () => {
'min-w-[calc(100%-120px)]',
'text-white',
'min-h-full',
'md:min-h-screen'
])}
>
<RiUserSearchLine
Expand Down

1 comment on commit ae270bf

@vercel
Copy link

@vercel vercel bot commented on ae270bf Dec 23, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.