-
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.
[Feature] load mappin edit page (#34)
* [chore]Update style guide with new grid and layout settings * [feat] #21 로딩페이지 및 이벤트진입페이지 생성 * [fix] #21 수정 및 api 연결 * Delete fe/src/styles/globals.css * [fix] #21 위치 아이콘 크기 수정 * [fix] #21 아이콘 크기 수정 * #26 비밀번호 확인 페이지 기능 추가 * [chore] styles.css 수정 * [style] load-mappin 스타일 및 동작 기능 수정 * #33 [feat] load mappin edit page * 임시 커밋 - 병합 전 변경 사항 저장
- Loading branch information
Showing
24 changed files
with
452 additions
and
277 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
import React from "react"; | ||
|
||
interface ExitModalProps { | ||
onCancel: () => void; | ||
onExit: () => void; | ||
} | ||
|
||
function ExitModal({ onCancel, onExit }: ExitModalProps) { | ||
return ( | ||
<div className="w-[272px] h-[202px] flex flex-col items-center inline-flex bg-gray-500 bg-opacity-50 rounded-lg"> | ||
<div className="w-full h-[148px] px-[39px] pt-9 pb-7 bg-white rounded-tl-xl rounded-tr-xl flex flex-col items-center gap-2.5"> | ||
<div className="w-full h-[84px] flex flex-col items-center gap-2"> | ||
<div className="w-full text-center text-[#1d1d1d] text-xl font-semibold font-['Pretendard'] leading-7"> | ||
저장하지 않고 나갈까요? | ||
</div> | ||
<div className="text-center text-[#8e8e8e] text-base font-medium font-['Pretendard'] leading-normal"> | ||
이대로 나가면 | ||
<br /> 작성하던 내용이 사라져요 | ||
</div> | ||
</div> | ||
</div> | ||
|
||
<div className="w-full flex"> | ||
<button | ||
type="button" | ||
onClick={onCancel} | ||
className="w-1/2 h-[54px] bg-[#f0f0f0] rounded-bl-xl flex items-center justify-center" | ||
> | ||
<span className="text-center text-[#2c2c2c] text-lg font-medium font-['Pretendard'] leading-relaxed"> | ||
취소 | ||
</span> | ||
</button> | ||
|
||
<button | ||
type="button" | ||
onClick={onExit} | ||
className="w-1/2 h-[54px] bg-[#1d1d1d] rounded-br-xl flex items-center justify-center" | ||
> | ||
<span className="text-center text-white text-lg font-medium font-['Pretendard'] leading-relaxed"> | ||
나가기 | ||
</span> | ||
</button> | ||
</div> | ||
</div> | ||
); | ||
} | ||
export default ExitModal; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
"use client"; | ||
|
||
import React, { useState, useEffect, FormEvent } from "react"; | ||
import LinkField from "./LinkField"; | ||
|
||
interface FormProps { | ||
userName: string; | ||
} | ||
|
||
export default function Form({ userName }: FormProps) { | ||
const [mapLinks, setMapLinks] = useState([""]); | ||
const [storeLinks, setStoreLinks] = useState([""]); | ||
const [isTooltipVisible, setIsTooltipVisible] = useState(true); | ||
const [isFormComplete, setIsFormComplete] = useState(false); // isFormComplete 추가 | ||
|
||
// mapLinks와 storeLinks가 모두 입력되었을 때만 isFormComplete를 true로 설정 | ||
useEffect(() => { | ||
setIsFormComplete( | ||
mapLinks.some((link) => link.trim() !== "") && | ||
storeLinks.some((link) => link.trim() !== "") | ||
); | ||
}, [mapLinks, storeLinks]); | ||
|
||
const handleSubmit = (e: FormEvent) => { | ||
e.preventDefault(); | ||
const formData = { | ||
userName, | ||
mapLinks, | ||
storeLinks, | ||
}; | ||
console.log("폼 데이터:", formData); | ||
}; | ||
|
||
return ( | ||
<div className="px-4"> | ||
<form onSubmit={handleSubmit}> | ||
<LinkField | ||
label="맵핀 모음 링크" | ||
placeholder="링크 붙여넣기" | ||
value={mapLinks} | ||
onChange={setMapLinks} | ||
showTooltip={isTooltipVisible} | ||
onInfoClick={() => setIsTooltipVisible(true)} | ||
/> | ||
|
||
<LinkField | ||
label="가게 정보 링크" | ||
placeholder="링크 붙여넣기" | ||
value={storeLinks} | ||
onChange={setStoreLinks} | ||
/> | ||
|
||
<button | ||
className={`w-full flex items-center text-lg font-200 justify-center h-[60px] rounded-small ${ | ||
isFormComplete | ||
? "bg-grayscale-90 text-white" | ||
: "bg-grayscale-20 text-mediumGray" | ||
}`} | ||
type="submit" | ||
disabled={!isFormComplete} | ||
> | ||
확인 | ||
</button> | ||
</form> | ||
</div> | ||
); | ||
} |
Oops, something went wrong.