-
Notifications
You must be signed in to change notification settings - Fork 2
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
지도 삭제/수정, 장소 삭제, 지도 상세보기 UI, 장소 상세보기 UI 구현 #140
Merged
Merged
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
9de7bd3
fix: location 타입 변경, place, customPlace 분리 #101
1119wj 7c1a807
feat: 지도 수정페이지 구현 #101
1119wj 65e6545
feat: 지도 상세보기 페이지 구현 #101
1119wj f4aad3c
feat: 지도 삭제 구현 #101
1119wj dc7ded0
Refactor: 변수명 변경 및 리팩토링 #101
1119wj 3ee58c7
feat: 지도 삭제 api #101
1119wj 644818a
Refactor: 변수명 변경, 함수 분리 #101
1119wj 2212797
fix: 경로 수정 #101
1119wj c8975e8
fix: 경로 수정 #101
1119wj 1097bab
style: 파비콘 변경 #101
1119wj c3faf66
feat: 장소 조회 컴포넌트 구현 #101
1119wj 3d7ae93
Refactor: 함수 분리 #101
1119wj 6fb1c6b
Refactor: props 추가 #101
1119wj 42ad3b9
feat: 지도 수정 api 구현 #101
1119wj cae7ded
feat: 라우팅 및 서스펜스 #101
1119wj 92fa851
Refactor: button 타입 추가 #101
1119wj 0dade62
feat: 사이드탭 확장위한 컨테이너 #101
1119wj File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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 |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<link rel="icon" type="image/svg+xml" href="/vite.svg" /> | ||
<link rel="icon" type="image/svg+xml" href="/pin.svg" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<link rel="stylesheet" as="style" crossorigin | ||
href="https://cdn.jsdelivr.net/gh/orioncactus/[email protected]/dist/web/static/pretendard.min.css" /> | ||
|
File renamed without changes
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,51 @@ | ||
import React from 'react'; | ||
import BaseWrapper from '../common/BaseWrapper'; | ||
import FormWrapper from './FormWrapper'; | ||
import { BaseMap, Map } from '@/types'; | ||
import { useEditMapMutation } from '@/hooks/api/useEditMapMutation'; | ||
import { useMapForm } from '@/hooks/useMapForm'; | ||
|
||
import PlaceListPanel from '../Place/PlaceListPanel'; | ||
import { useNavigate } from 'react-router-dom'; | ||
|
||
type EditMapFormProps = { | ||
mapData: Map; | ||
}; | ||
|
||
const EditMapForm = ({ mapData }: EditMapFormProps) => { | ||
const editMapMutation = useEditMapMutation(); | ||
const navigate = useNavigate(); | ||
const initialMapData: BaseMap = { | ||
title: mapData.title, | ||
description: mapData.description, | ||
isPublic: mapData.isPublic, | ||
thumbnailUrl: mapData.thumbnailUrl, | ||
mode: 'MAP', | ||
}; | ||
|
||
const { mapInfo, updateMapInfo, isMapInfoValid } = useMapForm(initialMapData); | ||
|
||
const onSubmitHandler = (e: React.FormEvent<HTMLFormElement>) => { | ||
e.preventDefault(); | ||
editMapMutation.mutate({ mapId: mapData.id, ...mapInfo }); | ||
navigate(`/map/${mapData.id}`); | ||
}; | ||
console.log(mapData); | ||
return ( | ||
<> | ||
<BaseWrapper position="" top="" left="" className="w-1/2"> | ||
<FormWrapper | ||
header="지도 수정" | ||
mapInfo={mapInfo} | ||
updateMapInfo={updateMapInfo} | ||
isMapInfoValid={isMapInfoValid} | ||
onSubmitHandler={onSubmitHandler} | ||
isEditMode={true} | ||
/> | ||
</BaseWrapper> | ||
<PlaceListPanel places={mapData.places} /> | ||
</> | ||
); | ||
}; | ||
|
||
export default EditMapForm; |
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,23 @@ | ||
import useDeleteMapMutation from '@/hooks/api/useDeleteMapMutation'; | ||
|
||
/**todo : 삭제 모달 구현*/ | ||
|
||
type DeleteMapButtonProps = { | ||
mapId: number; | ||
text: string; | ||
}; | ||
|
||
const DeleteMapButton = ({ mapId, text }: DeleteMapButtonProps) => { | ||
const deleteMutation = useDeleteMapMutation(); | ||
|
||
const onClick = () => { | ||
deleteMutation.mutate(mapId); | ||
}; | ||
return ( | ||
<button onClick={onClick} className="text-xs text-c_placeholder_gray"> | ||
{text} | ||
</button> | ||
); | ||
}; | ||
|
||
export default DeleteMapButton; |
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,21 @@ | ||
import { useNavigate } from 'react-router-dom'; | ||
|
||
type EditMapButtonProps = { | ||
mapId: number; | ||
text: string; | ||
}; | ||
|
||
const EditMapButton = ({ mapId, text }: EditMapButtonProps) => { | ||
const navigate = useNavigate(); | ||
|
||
const onClick = () => { | ||
navigate(`/edit/map/${mapId}`); | ||
}; | ||
return ( | ||
<button onClick={onClick} className="text-xs text-c_placeholder_gray"> | ||
{text} | ||
</button> | ||
); | ||
}; | ||
|
||
export default EditMapButton; |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
p3. public - private 변경인가요?
줄이지 않는 편이 이해하기 좋아 보여요
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
넵 수정하겠습니다