Skip to content

Commit 71e5196

Browse files
authored
Merge pull request #16 from deriv-com/shafin/ChampionTrader/feat-responsive-height-adjustment-real-device
chore: responsive height adjustment in real device
2 parents 5338480 + f8e5091 commit 71e5196

File tree

3 files changed

+5
-6
lines changed

3 files changed

+5
-6
lines changed

src/layouts/MainLayout/MainLayout.tsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@ export const MainLayout: React.FC<MainLayoutProps> = ({ children }) => {
1212
const { isLoggedIn } = useClientStore();
1313

1414
return (
15-
<div className="flex min-h-screen">
15+
<div className="flex min-h-[100dvh] h-[100dvh]">
1616
<SideNav />
17-
<div className="flex flex-col flex-1 relative">
17+
<div className="flex flex-col flex-1 relative overflow-hidden">
1818
<Header className="sticky top-0 z-50" />
19-
<main className="flex-1 flex flex-col overflow-y-auto">
19+
<main className="flex-1 flex flex-col overflow-y-auto overflow-x-hidden">
2020
{children}
2121
</main>
2222
{isLoggedIn && <Footer className="sticky bottom-0 z-50" />}

src/layouts/MainLayout/__tests__/MainLayout.test.tsx

-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ describe('MainLayout', () => {
3636
);
3737
// Check for base layout classes.
3838
expect(container.firstChild).toHaveClass('flex');
39-
expect(container.firstChild).toHaveClass('min-h-screen');
4039
});
4140

4241
it('does not render footer when user is logged out', () => {

src/screens/TradePage/TradePage.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ export const TradePage: React.FC = () => {
3636
};
3737

3838
return (
39-
<div className="flex flex-col flex-1 landscape:flex-row landscape:h-[100dvh] landscape:relative">
39+
<div className="flex flex-col flex-1 landscape:flex-row landscape:h-[100dvh] h-[100dvh] landscape:relative">
4040
<div
4141
className="hidden landscape:block landscape:absolute landscape:top-0 landscape:left-0 landscape:right-0 landscape:bg-white landscape:z-10 border-b border-opacity-10"
4242
id="instrument-tab-bar"
@@ -65,7 +65,7 @@ export const TradePage: React.FC = () => {
6565
</div>
6666
</div>
6767

68-
<div className="flex flex-col flex-1 landscape:mt-[72px] h-[calc(100vh-200px)] landscape:h-[calc(100vh-72px)]">
68+
<div className="flex flex-col flex-1 landscape:mt-[72px] h-[calc(100dvh-200px)] landscape:h-[calc(100dvh-72px)]">
6969
<Suspense fallback={<div>Loading...</div>}>
7070
<Chart className="flex-1" />
7171
</Suspense>

0 commit comments

Comments
 (0)