Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[design] 헤더 컴포넌트 / 레이아웃 잡기 #2

Merged
merged 7 commits into from
Feb 17, 2025
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
import LandingLayout from "@/layouts/LandingLayout";
import Home from "@/pages/home/Home";
import Landing from "@/pages/landing/Landing";
import { Route, Routes } from "react-router";

function App() {
return (
<>
<Routes>
<Route index element={<Home />} />
{/* <Route index element={<Home />} /> */}
<Route path="/" element={<LandingLayout />}>
<Route index element={<Landing />} />
</Route>
</Routes>
</>
);
Expand Down
5 changes: 5 additions & 0 deletions src/assets/icons/ellipsisButton.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file removed src/assets/icons/icons.svg
Empty file.
Binary file added src/assets/icons/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions src/assets/icons/notification.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
38 changes: 38 additions & 0 deletions src/layouts/Header.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
import logo from "@assets/icons/logo.png";
import notificationIcon from "@assets/icons/notification.svg";
import ellipsisButton from "@/assets/icons/ellipsisButton.svg";
import { Link } from "react-router";

interface HeaderProps {
showNotification?: boolean; // 알림 아이콘을 표시할지 여부
showMoreOptions?: boolean; // 더보기 메뉴를 표시할지 여부
}

function Header({ showNotification, showMoreOptions }: HeaderProps) {
console.log(showNotification);
return (
<header className="h-[44px] bg-[#FBF5FF]/90 backdrop-blur-sm px-3 flex items-center justify-between">
<Link to="/">
<img src={logo} alt="logo" />
</Link>

{/* 알림 아이콘, 더보기 메뉴 아이콘 표시 */}
<div className="flex gap-1">
{/* 알림 */}
{showNotification && (
<div className="px-2 py-3 flex justify-center items-center">
<img src={notificationIcon} alt="알림" />
</div>
)}
{/* 더보기 메뉴 */}
{showMoreOptions && (
<div className="px-2 py-3 flex justify-center items-center">
<img src={ellipsisButton} alt="더보기" />
</div>
)}
</div>
</header>
);
}

export default Header;
15 changes: 15 additions & 0 deletions src/layouts/LandingLayout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import Header from "@/layouts/Header";
import { Outlet } from "react-router";

function LandingLayout() {
return (
<div className="max-w-[700px] w-full h-screen mx-auto flex flex-col border border-red-500">
<Header showNotification showMoreOptions />
<div className="flex-1 border border-blue-500">
<Outlet />
</div>
</div>
);
}

export default LandingLayout;
1 change: 0 additions & 1 deletion src/pages/home/Home.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from "react";
import { twMerge } from "tailwind-merge";

function Home() {
Expand Down
5 changes: 5 additions & 0 deletions src/pages/landing/Landing.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
function Landing() {
return <div>렌딩페이지</div>;
}

export default Landing;