-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* chore: update web style and tailwind config * feature: add search bar and chat component to layout
- Loading branch information
1 parent
56751f2
commit ce7ddf7
Showing
9 changed files
with
51 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,33 @@ | ||
import { PropsWithChildren, useReducer } from "react"; | ||
import Header from "@/components/shared/Header"; | ||
import Sidebar from "@/components/shared/Sidebar"; | ||
import Footer from "@/components/shared/Footer"; | ||
import { cn } from "@/lib/utils"; | ||
import Chat from "@/components/shared/Chat/v2/Chat"; | ||
|
||
export default function Layout({ children }: PropsWithChildren) { | ||
const [isChatVisible, toggleChatVisibility] = useReducer( | ||
(preState) => !preState, | ||
false | ||
); | ||
|
||
export default function Layout({ children }: { children: React.ReactNode }) { | ||
return ( | ||
<div className="wrap__ flex flex-col w-full h-full"> | ||
<Header /> | ||
<div className="container__ flex flex-grow gap-5"> | ||
<Sidebar /> | ||
<main className="flex-grow">{children}</main> | ||
<div className="inset-0 flex flex-col w-full h-full"> | ||
<Header onClickChatButton={toggleChatVisibility} /> | ||
<div className="ml-2 mr-4 my-6 flex grow max-w-[100vw]"> | ||
<div className="shrink-0"> | ||
<Sidebar /> | ||
</div> | ||
<main className="grow overflow-x-hidden">{children}</main> | ||
{isChatVisible && ( | ||
<div className="shrink-0"> | ||
<Chat | ||
userId="" | ||
friendList={[]} | ||
lobbyMessages={[]} | ||
roomMessages={[]} | ||
/> | ||
</div> | ||
)} | ||
</div> | ||
<Footer /> | ||
</div> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters