-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #21 from boostcampwm-2024/refactor/responsive-web
♻️ refactor: 채팅, 헤더 반응형 작업
- Loading branch information
Showing
14 changed files
with
318 additions
and
269 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
69 changes: 69 additions & 0 deletions
69
client/src/components/layout/navigation/DesktopNavigation.tsx
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 |
---|---|---|
@@ -0,0 +1,69 @@ | ||
import { useNavigate } from "react-router-dom"; | ||
|
||
import SideButton from "@/components/layout/SideButton"; | ||
import SearchButton from "@/components/search/SearchButton"; | ||
import { Button } from "@/components/ui/button"; | ||
import { | ||
NavigationMenu, | ||
NavigationMenuItem, | ||
NavigationMenuList, | ||
NavigationMenuLink, | ||
navigationMenuTriggerStyle, | ||
} from "@/components/ui/navigation-menu"; | ||
|
||
import logo from "@/assets/logo-denamu-main.svg"; | ||
|
||
export default function DesktopNavigation({ | ||
toggleModal, | ||
}: { | ||
toggleModal: (modalType: "search" | "rss" | "login") => void; | ||
}) { | ||
const navigate = useNavigate(); | ||
|
||
return ( | ||
<div className="h-20 items-center flex justify-between relative px-[20px]"> | ||
{/* 로고 */} | ||
<button className="flex-shrink-0 relative z-50" onClick={() => location.reload()}> | ||
<img className="h-14 w-auto cursor-pointer" src={logo} alt="Logo" /> | ||
</button> | ||
|
||
{/* 검색 */} | ||
<div className="absolute left-1/2 transform -translate-x-1/2 w-[25%] flex justify-center z-40"> | ||
<SearchButton handleSearchModal={() => toggleModal("search")} /> | ||
</div> | ||
{/* 버튼 */} | ||
<div className="flex items-center z-50"> | ||
<NavigationMenu> | ||
<NavigationMenuList> | ||
<NavigationMenuItem> | ||
<SideButton /> | ||
</NavigationMenuItem> | ||
<NavigationMenuItem> | ||
<NavigationMenuLink | ||
className={`${navigationMenuTriggerStyle()} hover:text-primary hover:bg-primary/10`} | ||
onClick={() => navigate("/about")} | ||
href="#" | ||
> | ||
서비스 소개 | ||
</NavigationMenuLink> | ||
</NavigationMenuItem> | ||
<NavigationMenuItem> | ||
<NavigationMenuLink | ||
className={`${navigationMenuTriggerStyle()} hover:text-primary hover:bg-primary/10`} | ||
onClick={() => toggleModal("login")} | ||
href="#" | ||
> | ||
로그인 | ||
</NavigationMenuLink> | ||
</NavigationMenuItem> | ||
<NavigationMenuItem> | ||
<Button variant="default" onClick={() => toggleModal("rss")} className="bg-primary hover:bg-primary/90"> | ||
블로그 등록 | ||
</Button> | ||
</NavigationMenuItem> | ||
</NavigationMenuList> | ||
</NavigationMenu> | ||
</div> | ||
</div> | ||
); | ||
} |
53 changes: 53 additions & 0 deletions
53
client/src/components/layout/navigation/MobileNavigation.tsx
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 |
---|---|---|
@@ -0,0 +1,53 @@ | ||
import { Menu, X } from "lucide-react"; | ||
|
||
import SideBar from "@/components/layout/Sidebar"; | ||
import SearchButton from "@/components/search/SearchButton"; | ||
import { Button } from "@/components/ui/button"; | ||
import { Sheet, SheetContent, SheetHeader, SheetTitle } from "@/components/ui/sheet"; | ||
|
||
import logo from "@/assets/logo-denamu-title.svg"; | ||
|
||
import { useSidebarStore } from "@/store/useSidebarStore"; | ||
|
||
export default function MobileNavigation({ | ||
toggleModal, | ||
}: { | ||
toggleModal: (modalType: "search" | "rss" | "login") => void; | ||
}) { | ||
const { isOpen, setIsOpen } = useSidebarStore(); | ||
return ( | ||
<div className="h-20 items-center flex justify-between relative px-[10px]"> | ||
{/* 로고 */} | ||
<button className="flex-shrink-0 relative z-50" onClick={() => location.reload()}> | ||
<img className="h-14 w-auto cursor-pointer" src={logo} alt="Logo" /> | ||
</button> | ||
|
||
{/* 검색 */} | ||
<div className="absolute left-1/2 transform -translate-x-1/2 w-[50%] flex justify-center z-40"> | ||
<SearchButton handleSearchModal={() => toggleModal("search")} /> | ||
</div> | ||
{/* 햄버거 버튼 */} | ||
<Sheet open={isOpen}> | ||
<Button variant="outline" size="icon" className="hover:border-primary hover:text-primary" onClick={setIsOpen}> | ||
<Menu className="h-4 w-4" /> | ||
</Button> | ||
<SheetContent className="w-full"> | ||
<SheetHeader> | ||
<SheetTitle className="text-primary">메뉴</SheetTitle> | ||
<Button | ||
className="absolute right-2 top-0 rounded-sm opacity-70 bg-transparent text-black active:bg-transparent" | ||
onClick={setIsOpen} | ||
> | ||
<X /> | ||
</Button> | ||
</SheetHeader> | ||
<SideBar | ||
handleRssModal={() => toggleModal("rss")} | ||
handleLoginModal={() => toggleModal("login")} | ||
handleSidebar={setIsOpen} | ||
/> | ||
</SheetContent> | ||
</Sheet> | ||
</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
Oops, something went wrong.