Skip to content

Commit 6c5c3ff

Browse files
committed
refact: 이벤트 생성 첫 페이지에서만 좌측 상단에 홈버튼만 유지, 카카오맵 초기 좌표 설정
1 parent 8b2eaaa commit 6c5c3ff

File tree

8 files changed

+375
-99
lines changed

8 files changed

+375
-99
lines changed

design-system/ui/Header.tsx

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,30 +10,42 @@ interface HeaderProps {
1010
leftButtonLabel?: ReactNode; // 왼쪽 콘텐츠 (버튼)
1111
leftButtonClick?: () => void; // 왼쪽 버튼 클릭 핸들러
1212
leftButtonClassName?: string; // 왼쪽 버튼 추가 스타일링 클래스
13-
rightContent?: Button; // 오른쪽 콘텐츠 (버튼)
13+
rightContent?: Button | null; // 오른쪽 콘텐츠 (버튼)
1414
color?: 'white' | 'black'; // white 또는 black 중 선택
1515
className?: string; // 추가 스타일링 클래스
1616
}
1717

18+
// Button 타입 가드 함수 추가
19+
function isButtonElement(element: any): element is React.ReactElement<ButtonHTMLAttributes<HTMLButtonElement>> {
20+
return (
21+
React.isValidElement(element) &&
22+
typeof element.type === 'string' &&
23+
element.type === 'button'
24+
);
25+
}
26+
1827
const Header = ({
1928
centerContent,
2029
leftButtonLabel,
21-
leftButtonClick = () => {},
30+
leftButtonClick = () => { },
2231
leftButtonClassName,
2332
rightContent,
2433
color = 'black',
2534
className = '',
2635
}: HeaderProps) => {
2736
return (
2837
<header
29-
className={`relative flex items-center justify-between w-full h-16 px-6 ${className} ${
30-
color === 'white' ? 'text-white' : 'text-black'
31-
}`}
38+
className={`relative flex items-center justify-between w-full h-16 px-6 ${className} ${color === 'white' ? 'text-white' : 'text-black'
39+
}`}
3240
>
3341
{/* 왼쪽 콘텐츠 */}
3442
<div className="flex items-center space-x-2">
3543
{leftButtonLabel ? (
36-
<TextButton label={leftButtonLabel} onClick={leftButtonClick} className={`${leftButtonClassName} mr-6`} />
44+
isButtonElement(leftButtonLabel) ? (
45+
<div className="flex items-center ml-6 space-x-2">{leftButtonLabel}</div>
46+
) : (
47+
<TextButton label={leftButtonLabel} onClick={leftButtonClick} className={`${leftButtonClassName} mr-6`} />
48+
)
3749
) : null}
3850
</div>
3951

src/features/event/model/FunnelContext.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ export const FunnelProvider = ({ children }: { children: ReactNode }) => {
3131
onlineType: 'ONLINE',
3232
address: '',
3333
detailAddress: '',
34-
locationLat: 0,
35-
locationLng: 0,
34+
locationLat: 37.5665,
35+
locationLng: 126.9780,
3636
category: 'DEVELOPMENT_STUDY',
3737
hashtags: [],
3838
organizerEmail: '',

src/features/event/ui/DatePicker.tsx

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -99,15 +99,23 @@ const EventDatePicker = ({
9999
<div className="flex flex-wrap lg:flex-nowrap items-center justify-between gap-2">
100100
<div className="flex flex-col w-full sm:w-auto gap-2">
101101
{!isLabel && <span className="text-sm font-medium">시작 날짜</span>}
102-
<div className="flex gap-1">
102+
<div className="flex gap-1 ">
103103
<DatePicker
104104
id="startDate"
105105
selected={startDate}
106106
onChange={(date: Date | null) => setStartDate(date)}
107107
locale={ko}
108108
dateFormat="MM월 dd일"
109109
autoComplete="off"
110-
className="w-20 h-9 md:w-24 md:h-10 border border-placeholderText text-sm md:text-md rounded-[5px] p-2"
110+
onKeyDown={(e) => e.preventDefault()}
111+
className="
112+
w-20 h-9 md:w-24 md:h-10
113+
border border-placeholderText
114+
text-sm md:text-md
115+
rounded-[5px]
116+
p-2 cursor-pointer
117+
caret-transparent
118+
"
111119
renderCustomHeader={({
112120
date,
113121
decreaseMonth,
@@ -132,7 +140,7 @@ const EventDatePicker = ({
132140
id="startTime"
133141
value={startTime}
134142
onChange={e => setStartTime(e.target.value)}
135-
className="w-20 h-9 md:w-24 md:h-10 border border-placeholderText text-sm md:text-md rounded-[5px] p-2"
143+
className="w-20 h-9 md:w-24 md:h-10 border border-placeholderText text-sm md:text-md rounded-[5px] p-2 cursor-pointer"
136144
>
137145
{timeOptions.map(time => (
138146
<option key={time} value={time}>
@@ -155,7 +163,8 @@ const EventDatePicker = ({
155163
locale={ko}
156164
dateFormat="MM월 dd일"
157165
autoComplete="off"
158-
className="w-20 h-9 md:w-24 md:h-10 border border-placeholderText text-sm md:text-md rounded-[5px] p-2"
166+
onKeyDown={(e) => e.preventDefault()}
167+
className="w-20 h-9 md:w-24 md:h-10 border border-placeholderText text-sm md:text-md rounded-[5px] p-2 cursor-pointer caret-transparent"
159168
renderCustomHeader={({
160169
date,
161170
decreaseMonth,
@@ -180,7 +189,7 @@ const EventDatePicker = ({
180189
id="endTime"
181190
value={endTime}
182191
onChange={e => setEndTime(e.target.value)}
183-
className="w-20 h-9 md:w-24 md:h-10 border border-placeholderText text-sm md:text-md rounded-[5px] p-2"
192+
className="w-20 h-9 md:w-24 md:h-10 border border-placeholderText text-sm md:text-md rounded-[5px] p-2 cursor-pointer"
184193
>
185194
{timeOptions.map(time => (
186195
<option key={time} value={time}>

src/features/event/ui/EventFunnel.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ const EventFunnel = ({ onNext, onPrev, Funnel, Step, currentStep }: EventFunnelI
8181
title="이벤트 제목을 입력해주세요"
8282
onNext={() => handleNext(String(currentStep + 1))}
8383
onPrev={() => onPrev(String(currentStep - 1))}
84+
goHome={true}
8485
requireValidation={true}
8586
>
8687
<EventTitlePage />

src/features/event/ui/EventType.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ const EventType = ({ className }: EventTypeProps) => {
4646
locationLng,
4747
}));
4848
};
49-
49+
console.log(eventState.locationLat, eventState.locationLng);
5050
return (
5151
<div className={`flex flex-col justify-center w-full ${className}`}>
5252
<div className="flex flex-col justify-start">

src/index.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,4 +106,4 @@ body {
106106
.clip-bottom-banner {
107107
clip-path: polygon(3% 0%, 0% 100%, 100% 100%, 97% 0%);
108108
}
109-
}
109+
}

src/shared/ui/backgrounds/EventRegisterLayout.tsx

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ interface EventRegisterLayoutProps {
1212
onNext: () => void;
1313
onPrev: () => void;
1414
requireValidation?: boolean;
15+
goHome?: boolean;
1516
}
1617

1718
interface ValidationChildProps {
@@ -25,6 +26,7 @@ const EventRegisterLayout = ({
2526
onNext,
2627
onPrev,
2728
requireValidation = false,
29+
goHome = false,
2830
}: EventRegisterLayoutProps) => {
2931
const [isFormValid, setIsFormValid] = useState(false);
3032

@@ -46,16 +48,22 @@ const EventRegisterLayout = ({
4648
<div className="absolute top-0 w-full h-36 md:h-40 bg-gradient-to-br from-[#FF5593] to-[rgb(255,117,119)] rounded-b-[60px] z-10">
4749
<Header
4850
centerContent="이벤트 등록"
49-
leftButtonLabel="<"
50-
leftButtonClick={onPrev}
51+
leftButtonLabel={goHome ? ( <IconButton
52+
iconPath={<img src={HomeButton} />}
53+
onClick={() => navigate('/')}
54+
iconClassName="cursor-pointer z-30 ml-auto"
55+
/>) : '<'}
56+
leftButtonClick={goHome ? () => navigate('/') : onPrev}
5157
color="white"
5258
leftButtonClassName="text-xl z-30"
5359
rightContent={
54-
<IconButton
55-
iconPath={<img src={HomeButton} />}
56-
onClick={() => navigate('/')}
57-
iconClassName="cursor-pointer z-30 ml-auto"
58-
/>
60+
goHome ? null : (
61+
<IconButton
62+
iconPath={<img src={HomeButton} />}
63+
onClick={() => navigate('/')}
64+
iconClassName="cursor-pointer z-30 ml-auto"
65+
/>
66+
)
5967
}
6068
/>
6169
</div>

0 commit comments

Comments
 (0)