|
1 |
| -import { WorkspaceNameInput } from '@/entities'; |
| 1 | +import { HelpButton, WorkspaceNameInput } from '@/entities'; |
2 | 2 | import { Logo } from '@/shared/ui';
|
3 | 3 | import { WorkspaceHeaderButtons } from '../WorkspaceHeaderButtons/WorkspaceHeaderButtons';
|
4 |
| -import { useCoachMarkStore } from '@/shared/store/useCoachMarkStore'; |
5 |
| -import Question from '@/shared/assets/question.svg?react'; |
| 4 | +import { memo } from 'react'; |
6 | 5 |
|
7 | 6 | /**
|
8 | 7 | *
|
9 | 8 | * @description
|
10 | 9 | * 워크스페이스 페이지 헤더 컴포넌트
|
11 | 10 | */
|
12 |
| -export const WorkspacePageHeader = () => { |
13 |
| - const { openCoachMark } = useCoachMarkStore(); |
14 | 11 |
|
15 |
| - return ( |
16 |
| - <div className="flex h-14 w-full flex-shrink-0 items-center justify-between border-b border-gray-100 bg-white pl-8 pr-4"> |
17 |
| - <div className="flex items-center gap-5"> |
18 |
| - <Logo isBlack={false} /> |
19 |
| - <WorkspaceNameInput /> |
20 |
| - </div> |
21 |
| - <div className="flex gap-11"> |
22 |
| - <button |
23 |
| - className="text-medium-rg hover flex items-center gap-1 text-gray-300 hover:text-gray-500" |
24 |
| - onClick={openCoachMark} |
25 |
| - aria-label="도움말 버튼" |
26 |
| - > |
27 |
| - 도움말 <Question /> |
28 |
| - </button> |
29 |
| - <WorkspaceHeaderButtons /> |
30 |
| - </div> |
31 |
| - </div> |
32 |
| - ); |
| 12 | +type TWorkspacePageHeader = { |
| 13 | + currentStep: number; |
33 | 14 | };
|
| 15 | + |
| 16 | +export const WorkspacePageHeader = memo( |
| 17 | + ({ currentStep }: TWorkspacePageHeader) => { |
| 18 | + return ( |
| 19 | + <div className="flex h-14 w-full flex-shrink-0 items-center justify-between border-b border-gray-100 bg-white pl-8 pr-4"> |
| 20 | + <div className="flex items-center gap-5"> |
| 21 | + <Logo isBlack={false} /> |
| 22 | + <WorkspaceNameInput /> |
| 23 | + </div> |
| 24 | + <div className="flex gap-11"> |
| 25 | + <HelpButton /> |
| 26 | + <WorkspaceHeaderButtons currentStep={currentStep} /> |
| 27 | + </div> |
| 28 | + </div> |
| 29 | + ); |
| 30 | + }, |
| 31 | + (prevProps, nextProps) => { |
| 32 | + const prevIsFour = prevProps.currentStep !== 4; |
| 33 | + const nextIsFour = nextProps.currentStep !== 4; |
| 34 | + return prevIsFour && nextIsFour; |
| 35 | + } |
| 36 | +); |
0 commit comments