-
Notifications
You must be signed in to change notification settings - Fork 5
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: 모두의 정원 등록 페이지 #362
Merged
Merged
feat: 모두의 정원 등록 페이지 #362
Changes from 23 commits
Commits
Show all changes
38 commits
Select commit
Hold shift + click to select a range
a9c718b
chore: PetCard -> PetPlantCard 네이밍 변경
bassyu 19613f8
chore: calendar URL 삭제
bassyu 264e5b8
chore: 모두의 정원 등록 페이지 URL 추가
bassyu 44d1a0f
refactor: InlineRadio에서 UI 분리
WaiNaat c455b71
chore: JSX 안쓰는 tsx 파일 ts로 변경
WaiNaat 1937578
Merge branch 'develop' of https://github.com/woowacourse-teams/2023-p…
WaiNaat ba8ebcc
feat: 게시글 등록 api 로직
WaiNaat 18f321e
feat: 게시글 등록 msw
WaiNaat 8817587
feat: 등록 양식 마크업 작성
WaiNaat 0d9c5fe
refactor: 식물 사전 상세 디자인 깨짐 수정
WaiNaat 3e5b9f2
fix: Element type is invalid 오류 해결
WaiNaat d6610a1
test: 사전 식물 상세 스토리북 수정
WaiNaat 83d7f2e
design: Inline Radio Option 디자인 수정
WaiNaat 5cb5386
feat: 양식 디자인 및 기본 기능
WaiNaat f88cde2
feat: 라우터 설정
WaiNaat 789a767
feat: 반려 식물 선택 페이지
WaiNaat 443ee23
feat: 세션 검증 및 디자인 수정
WaiNaat 5fb1695
refactor: 불필요한 async 삭제
WaiNaat fa66ab6
feat: 서버 통신 로직과 결합
WaiNaat a64dc75
feat: 식물 삭제 버튼 위치 변경
WaiNaat edf25e6
feat: 모두의 정원 등록 버튼
WaiNaat 7a9e487
Merge branch 'develop' of https://github.com/woowacourse-teams/2023-p…
WaiNaat fdcb427
refactor: 등록 성공 후 목록으로 이동
WaiNaat 8bccf2f
fix: 등록 버튼 가려지는 문제 해결
WaiNaat 5ed132a
design: '글쓰기'를 '기록하기'로 변경
WaiNaat 8bb6014
refactor: alt에서 불필요한 내용 삭제
WaiNaat d06855a
chore: 파일명 변경
WaiNaat 3466ee2
feat: 난이도를 선택하지 않았으면 게시글에 노출 안함
WaiNaat 56d645c
feat: 양식 제출 검사 및 내용 입력 필수
WaiNaat 3fad939
refactor: 절대경로 사용
WaiNaat 4a2cfbe
feat: 반려식물 요약 프로필 자세하게 변경
WaiNaat 4eef772
feat: 반려 식물 정보 수정 취소 시 뒤로가기
WaiNaat c2427c9
feat: 반려 식물 삭제 버튼 롤백
WaiNaat de773c3
design: 정보수정 링크 hover 색 변경
WaiNaat 06e14b9
design: 등록하기 -> 기록하기 변경
WaiNaat 7605a8e
fix: typo
WaiNaat 45bd549
Merge `develop` into this branch
WaiNaat 5a95f25
feat: profile에 suspense 적용
WaiNaat 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 |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import type { GardenRegisterForm } from 'types/garden'; | ||
import { BASE_URL } from 'constants/index'; | ||
|
||
export const GARDEN_URL = `${BASE_URL}/garden`; | ||
|
||
const headers = { | ||
'Content-Type': 'application/json', | ||
}; | ||
|
||
const register = (form: GardenRegisterForm) => { | ||
return fetch(GARDEN_URL, { | ||
method: 'POST', | ||
headers, | ||
credentials: 'include', | ||
body: JSON.stringify(form), | ||
}); | ||
}; | ||
|
||
const GardenAPI = { | ||
register, | ||
}; | ||
|
||
export default GardenAPI; |
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
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
16 changes: 2 additions & 14 deletions
16
frontend/src/components/@common/InlineRadio/ingredients/Main.tsx
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
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
5 changes: 5 additions & 0 deletions
5
frontend/src/components/dictionaryPlant/TagSwitch/TagSwitch.style.ts
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,5 @@ | ||
import { styled } from 'styled-components'; | ||
|
||
export const Padding = styled.span` | ||
padding: 3px 13px; | ||
`; |
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 |
---|---|---|
|
@@ -21,12 +21,11 @@ import { | |
EnvironmentItem, | ||
TimelineLinkArea, | ||
TimelineLink, | ||
EditLink, | ||
DeleteButton, | ||
PrimaryLink, | ||
SecondaryLink, | ||
ButtonArea | ||
} from './PetPlantDetail.style'; | ||
import useDeletePetPlant from 'hooks/queries/petPlant/useDeletePetPlant'; | ||
import usePetPlantDetails from 'hooks/queries/petPlant/usePetPlantDetails'; | ||
import useConfirm from 'hooks/useConfirm'; | ||
import { convertDateKorYear, getDaysBetween } from 'utils/date'; | ||
import { URL_PATH } from 'constants/index'; | ||
import theme from 'style/theme.style'; | ||
|
@@ -37,16 +36,13 @@ interface PetDetailsProps { | |
|
||
const PetPlantDetail = ({ petPlantId }: PetDetailsProps) => { | ||
const { data: petPlantDetails } = usePetPlantDetails(petPlantId); | ||
const confirm = useConfirm(); | ||
const { mutate } = useDeletePetPlant(); | ||
|
||
if (!petPlantDetails) return null; | ||
|
||
const { | ||
id, | ||
imageUrl, | ||
nickname, | ||
dictionaryPlant: { id: dictId, name: dictName }, | ||
dictionaryPlant: { id: dictionaryPlantId, name: dictionaryPlantName }, | ||
birthDate, | ||
daySince, | ||
waterCycle, | ||
|
@@ -55,20 +51,9 @@ const PetPlantDetail = ({ petPlantId }: PetDetailsProps) => { | |
flowerpot, | ||
light, | ||
wind, | ||
dday, | ||
dday | ||
} = petPlantDetails; | ||
|
||
const deletePetPlant = async () => { | ||
const isConfirmed = await confirm({ | ||
title: '반려 식물 삭제', | ||
message: `정말로 '${nickname}'을(를) 지우실 건가요?`, | ||
}); | ||
|
||
if (!isConfirmed) return; | ||
|
||
mutate(id); | ||
}; | ||
|
||
const birthDateKorean = convertDateKorYear(birthDate); | ||
const today = convertDateKorYear(new Date()).slice(5); | ||
const isBirthday = today === birthDateKorean.slice(5); | ||
|
@@ -79,16 +64,16 @@ const PetPlantDetail = ({ petPlantId }: PetDetailsProps) => { | |
|
||
return ( | ||
<Wrapper> | ||
<Image type="wide" src={imageUrl} alt={`${nickname}(${dictName})`} size="300px" /> | ||
<Image type="wide" src={imageUrl} alt={`${nickname}(${dictionaryPlantName})`} size="300px" /> | ||
<Content> | ||
<TitleArea> | ||
<Title> | ||
{nickname} | ||
{isBirthday && <SvgFill icon="crown" aria-hidden="true" />} | ||
</Title> | ||
<StyledLink to={generatePath(URL_PATH.dictDetail, { id: dictId.toString() })}> | ||
<StyledLink to={generatePath(URL_PATH.dictDetail, { id: dictionaryPlantId.toString() })}> | ||
<SubTitle> | ||
{dictName} | ||
{dictionaryPlantName} | ||
<SvgStroke icon="dictionary" aria-hidden="true" color={theme.color.grayDark} /> | ||
</SubTitle> | ||
</StyledLink> | ||
|
@@ -179,14 +164,17 @@ const PetPlantDetail = ({ petPlantId }: PetDetailsProps) => { | |
{wind} | ||
</EnvironmentItem> | ||
</Environment> | ||
<ExpandedTextBox> | ||
<EditLink to={generatePath(URL_PATH.petEdit, { id: petPlantId.toString() })}> | ||
정보 수정하기 | ||
</EditLink> | ||
<DeleteButton type="button" onClick={deletePetPlant}> | ||
식물 삭제하기 | ||
</DeleteButton> | ||
</ExpandedTextBox> | ||
<ButtonArea> | ||
<PrimaryLink | ||
to={generatePath(URL_PATH.gardenRegisterForm, { id: petPlantId.toString() })} | ||
state={{ nickname, dictionaryPlantName, imageUrl }} | ||
> | ||
모두의 정원에 등록하기 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. C
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 기록하기가 좀더 어울리는 것 같네요 👍 |
||
</PrimaryLink> | ||
<SecondaryLink to={generatePath(URL_PATH.petEdit, { id: petPlantId.toString() })}> | ||
정보 수정 | ||
</SecondaryLink> | ||
</ButtonArea> | ||
</Content> | ||
</Wrapper> | ||
); | ||
|
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.
👍