Skip to content

Commit

Permalink
Fix/125-chat-reload (#133)
Browse files Browse the repository at this point in the history
* style: cards justify

* fix: chat reloading when access history page
  • Loading branch information
iaurg committed Nov 30, 2023
1 parent c9ff948 commit ad24e88
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 13 deletions.
5 changes: 1 addition & 4 deletions frontend/src/app/(private)/game/history/[id]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
import Chat from "@/components/Chat";
import Header from "@/components/Header";
import MatchHistory from "@/components/MatchHistory";
import { ChatProvider } from "@/contexts/ChatContext";
import { ArrowLeft } from "@phosphor-icons/react";
import Link from "next/link";

Expand All @@ -22,9 +21,7 @@ export default function HistoryPage({ params }: { params: { id: string } }) {
<MatchHistory id={params.id} />
</div>
<div className="flex flex-col">
<ChatProvider>
<Chat />
</ChatProvider>
<Chat />
</div>
</div>
);
Expand Down
5 changes: 1 addition & 4 deletions frontend/src/app/(private)/game/page.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import Chat from "@/components/Chat";
import Header from "@/components/Header";
import { LeaderBoard } from "@/components/LeaderBoard";
import { ChatProvider } from "@/contexts/ChatContext";

export default function GamePage() {
return (
Expand All @@ -11,9 +10,7 @@ export default function GamePage() {
<LeaderBoard />
</div>
<div className="flex flex-col">
<ChatProvider>
<Chat />
</ChatProvider>
<Chat />
</div>
</div>
);
Expand Down
8 changes: 4 additions & 4 deletions frontend/src/app/(private)/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ import type { Metadata } from "next";

// These styles apply to every route in the application
import "../../styles/globals.css";
import Chat from "@/components/Chat";
import Header from "@/components/Header";
import Providers from "../auth/providers";
import { ChatProvider } from "@/contexts/ChatContext";
import { Toaster } from "react-hot-toast";
Expand All @@ -22,8 +20,10 @@ export default function RootPrivateLayout({
<html lang="en">
<body className="bg-black42-100 flex">
<Providers>
<div className="flex flex-col flex-1">{children}</div>
<Toaster />
<ChatProvider>
<div className="flex flex-col flex-1">{children}</div>
<Toaster />
</ChatProvider>
</Providers>
<Toaster />
</body>
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/MatchHistory/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export default function MatchHistory({ id }: { id: string }) {

return (
<div
className="flex flex-col justify-between items-center py-4 bg-black42-300 p-4 rounded-lg space-y-2 max-h-[80vh] overflow-y-scroll overscroll-contain
className="flex flex-col justify-start items-center py-4 bg-black42-300 p-4 rounded-lg space-y-2 max-h-[80vh] overflow-y-scroll overscroll-contain
scrollbar scrollbar-w-1 scrollbar-rounded-lg scrollbar-thumb-rounded-lg scrollbar-thumb-black42-100 scrollbar-track-black42-300
h-[calc(100vh-160px)]
"
Expand Down

0 comments on commit ad24e88

Please sign in to comment.