Skip to content

Commit 824c546

Browse files
authored
Fix chat box sizing on mobile, remove navigation on mobile (#5)
1 parent 84222b6 commit 824c546

File tree

2 files changed

+11
-13
lines changed

2 files changed

+11
-13
lines changed

frontend/src/components/Chat.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ export default function Chat({ username }: { username: string }) {
9292
<LiaCommentsDollarSolid size={40} />
9393
</button>
9494
{isChatOpen && (
95-
<div className="fixed bottom-32 right-4 bg-gray-800 text-white rounded-lg shadow-lg flex flex-col w-1/3">
95+
<div className="fixed bottom-32 right-4 bg-gray-800 text-white rounded-lg shadow-lg flex flex-col w-11/12 md:w-1/3">
9696
<div className="flex justify-between items-center p-4 bg-blue-500 rounded-t-lg">
9797
<h1 className="text-xl font-bold">Big Friendly Bank</h1>
9898
<button onClick={toggleChat} className="text-white">

frontend/src/components/Dashboard.tsx

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,11 @@ import {
1313
} from "react-icons/fa";
1414

1515
export default function Dashboard({ username }: { username: string }) {
16-
1716
return (
1817
<>
1918
<div className="min-h-screen bg-gray-100">
2019
<section className="flex">
21-
<nav className="bg-white w-64 p-5 border-r border-gray-200">
20+
<nav className="bg-white w-64 p-5 border-r border-gray-200 hidden md:block">
2221
<ul className="flex flex-col gap-1">
2322
<li>
2423
<a
@@ -95,7 +94,6 @@ export default function Dashboard({ username }: { username: string }) {
9594
</ul>
9695
</nav>
9796

98-
{/* Main Content */}
9997
<div className="flex-grow p-6 space-y-6">
10098
{/* Cards */}
10199
<div className="grid grid-cols-1 md:grid-cols-3 gap-6">
@@ -141,7 +139,7 @@ export default function Dashboard({ username }: { username: string }) {
141139
</div>
142140
<div className="space-y-1">
143141
<p className="text-sm text-white/80">VALID THRU</p>
144-
<p className="text-xl">12/22</p>
142+
<p className="text-xl">12/25</p>
145143
</div>
146144
</div>
147145
</div>
@@ -170,7 +168,7 @@ export default function Dashboard({ username }: { username: string }) {
170168
</div>
171169
<div className="space-y-1">
172170
<p className="text-sm text-white/80">VALID THRU</p>
173-
<p className="text-xl">08/23</p>
171+
<p className="text-xl">08/25</p>
174172
</div>
175173
</div>
176174
</div>
@@ -232,10 +230,10 @@ export default function Dashboard({ username }: { username: string }) {
232230
</div>
233231
</div>
234232
<div className="space-y-6">
235-
<div className="flex justify-between items-center p-6 bg-slate-200 rounded-md">
233+
<div className="flex flex-col md:flex-row justify-between items-center p-6 bg-slate-200 rounded-md">
236234
<div className="flex items-center flex-1 gap-6">
237235
<FaApple className="w-12 h-12 text-black" />
238-
<dl className="grid grid-cols-3 gap-8 w-full">
236+
<dl className="grid grid-cols-1 md:grid-cols-3 gap-8 w-full">
239237
<div className="flex flex-col items-start">
240238
<dt className="font-semibold text-gray-800">
241239
Apple Inc.
@@ -259,10 +257,10 @@ export default function Dashboard({ username }: { username: string }) {
259257
<div className="text-red-600 font-semibold ml-6">- $550</div>
260258
</div>
261259

262-
<div className="flex justify-between items-center p-6 bg-slate-200 rounded-md">
260+
<div className="flex flex-col md:flex-row justify-between items-center p-6 bg-slate-200 rounded-md">
263261
<div className="flex items-center flex-1 gap-6">
264262
<FaPinterest className="w-12 h-12 text-red-500" />
265-
<dl className="grid grid-cols-3 gap-8 w-full">
263+
<dl className="grid grid-cols-1 md:grid-cols-3 gap-8 w-full">
266264
<div className="flex flex-col items-start">
267265
<dt className="font-semibold text-gray-800">
268266
Pinterest
@@ -285,10 +283,10 @@ export default function Dashboard({ username }: { username: string }) {
285283
</div>
286284
<div className="text-red-600 font-semibold ml-6">- $120</div>
287285
</div>
288-
<div className="flex justify-between items-center p-6 bg-slate-200 rounded-md">
286+
<div className="flex flex-col md:flex-row justify-between items-center p-6 bg-slate-200 rounded-md">
289287
<div className="flex items-center flex-1 gap-6">
290288
<FaFilm className="w-12 h-12 text-yellow-500" />
291-
<dl className="grid grid-cols-3 gap-8 w-full">
289+
<dl className="grid grid-cols-1 md:grid-cols-3 gap-8 w-full">
292290
<div className="flex flex-col items-start">
293291
<dt className="font-semibold text-gray-800">
294292
Warner Bros.
@@ -314,7 +312,7 @@ export default function Dashboard({ username }: { username: string }) {
314312
</div>
315313
</section>
316314
</div>
317-
<Chat username={username} />
315+
<Chat username={username} />
318316
</>
319317
);
320318
}

0 commit comments

Comments
 (0)