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

Feat: Header UI 추가 #26

Merged
merged 20 commits into from
Nov 9, 2023
Merged
Show file tree
Hide file tree
Changes from 17 commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
1d1d957
feat: header 추가
pepperdad Oct 26, 2023
9e6af80
feat: logo 추가
pepperdad Oct 26, 2023
70c8eb2
feat: Header 컴포넌트 개선
pepperdad Oct 26, 2023
40db830
Merge branch 'develop' of https://github.com/Project-Catcher/catcher-…
pepperdad Oct 30, 2023
f5baaba
fix: logo 경로 변경 및 asset 추가
pepperdad Oct 31, 2023
2b79fae
feat: 로그인 상태에 따라 보이는 헤더 UI 수정
pepperdad Oct 31, 2023
7311b7c
feat: Tabs 컴포넌트로 분리
pepperdad Oct 31, 2023
7506b63
fix: 로그인 상태 확인 로직 수정
pepperdad Oct 31, 2023
be19b35
design: close asset 추가
pepperdad Oct 31, 2023
6e9c449
feat: 알림 토글 추가
pepperdad Oct 31, 2023
38a7dc3
feat: 로그인 상태에서 알림, 내 정보 Toggle event 추가
pepperdad Nov 1, 2023
450af02
feat: 내부 알림 컴포넌트 추가 및 프로필,ID 영역 클릭시 토글로 수정
pepperdad Nov 2, 2023
124abdd
feat: 고정 데이터에 타입 추가
pepperdad Nov 2, 2023
3ff8952
fix: scroll position에서 발생하는 불필요한 렌더링 반복 제거
pepperdad Nov 4, 2023
f668721
fix: header 컴포넌트 경로 수정
pepperdad Nov 4, 2023
59edce0
feat: MyInfo 내의 반복되는 버튼 컴포넌트로 분리
pepperdad Nov 4, 2023
6587b37
fix: 글자 수 늘어날 시 width 달라지지 않게 width 고정
pepperdad Nov 4, 2023
e900733
Merge branch 'develop' of https://github.com/Project-Catcher/catcher-…
pepperdad Nov 6, 2023
06c58e2
Chore: 누락된 캐시파일 추가
NacreousCloud Nov 8, 2023
11c3064
Merge branch 'develop' into feat/header
pepperdad Nov 9, 2023
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
Binary file modified .yarn/cache/next-npm-12.3.2-ac8bcf5092-fa2372c3df.zip
Binary file not shown.
Binary file modified .yarn/install-state.gz
Binary file not shown.
2 changes: 2 additions & 0 deletions pages/_app.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import Header from "header/components";
import type { AppProps } from "next/app";
import { RecoilRoot } from "recoil";
import "@shared/styles/globals.css";
Expand All @@ -7,6 +8,7 @@ import Confirm from "../src/shared/modal/Confirm";
function MyApp({ Component, pageProps }: AppProps) {
return (
<RecoilRoot>
<Header />
<Component {...pageProps} />
<Alert />
<Confirm />
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이 코드 패치에 대한 간단한 코드 리뷰를 도와드리겠습니다. 잠재적 버그 위험과/또는 개선 제안에 대한 의견을 환영합니다.

  1. 빠진 import 문제: Header 컴포넌트를 가져오는 import Header from "header/components" 코드가 추가되었습니다. 이전 코드에서는 해당 import가 누락되었을 가능성이 있으므로 문제는 해결되었습니다.

  2. 기능 개선 제안: 리액트 애플리케이션의 헤더를 전역으로 사용하려면 <Header />를 사용하는 것은 좋은 접근 방식입니다. 그러나 각 페이지마다 반복해서 <Header />를 추가해야 하는 번거로움이 있을 수 있습니다. 이를 간소화할 수 있는 방법은 Next.js의 Layout 컴포넌트 아키텍처를 활용하는 것입니다. 레이아웃 컴포넌트를 생성하여 모든 페이지에 적용하고, 레이아웃 컴포넌트 내부에 헤더를 포함시킬 수 있습니다. 이렇게 하면 각 페이지에서 헤더를 중복해서 추가할 필요 없이 공통 레이아웃 컴포넌트에서 관리할 수 있습니다. 이 기능 개선은 코드를 DRY하게 유지하는 데 도움이 될 수 있습니다.

위의 리뷰에 따라 모든 import가 올바르게 추가되었고, 헤더가 애플리케이션 전체에서 사용되도록 변경되었습니다.

Expand Down
5 changes: 5 additions & 0 deletions public/header/icon_close.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
26 changes: 26 additions & 0 deletions public/header/logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
17 changes: 17 additions & 0 deletions public/header/notification.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
17 changes: 17 additions & 0 deletions public/header/notification_black.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 12 additions & 0 deletions public/header/photo_sample.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 10 additions & 0 deletions public/header/write-icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
41 changes: 41 additions & 0 deletions src/header/components/MyInfo.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
// TODO: 동적으로 데이터 받아와서 보여주기
import Image from "next/image";
import React from "react";
import MyInfoButton from "./MyInfoButton";

const MyInfo = () => {
return (
<>
<div
className="absolute top-8 w-0 h-0 border-[12px] border-solid"
style={{
borderColor: "transparent transparent white transparent",
}}
/>
<div className="absolute top-14 -right-10 w-[339px] bg-white rounded-[15px] shadow py-5 px-3 flex flex-wrap gap-2">
<MyInfoButton title={"내 일정"} number={523} />
<MyInfoButton title={"누적 좋아요 수"} number={523} />
<MyInfoButton title={"예정 일정"} number={523} />
<MyInfoButton title={"승인 대기 중"} number={523} />

<div className="w-[309px] h-[46.17px] bg-purple-500 rounded-[10px] shadow flex-center text-white">
새로운 일정만들기
<Image
src="/header/write-icon.svg"
alt="write-icon"
width={14}
height={14}
/>
</div>
<div className="w-[309px] h-[46px] bg-white rounded-[10px] shadow border border-neutral-200 flex-center">
마이페이지
</div>
<div className="w-[309px] h-[46px] bg-stone-300 rounded-[10px] shadow flex-center text-white">
Log out
</div>
</div>
</>
);
};

export default MyInfo;
Loading