-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: 공연 기본 정보 UI 구현 및 공연 정보 입력 관련 폼 컴포넌트화 * feat: 공연 티켓 관리 UI 구현 및 공연 티켓 입력 관련 폼 컴포넌트화 * feat: 공연 기본 정보 수정 API 연동 및 폼 비활성화 구현 * feat: 공연 기본 정보 페이지에서 이탈 시, 입력한 정보 저장 여부 확인 기능 구현 * feat: 공연 삭제 API 연동 및 관련 기능 구현 * fix: ShowDetailLayout에서 상단 공연 제목의 모양이 어색하게 보이는 문제 수정
- Loading branch information
Showing
36 changed files
with
1,519 additions
and
625 deletions.
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
30 changes: 30 additions & 0 deletions
30
apps/admin/src/components/ShowDeleteForm/ShowDeleteForm.styles.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,30 @@ | ||
import styled from '@emotion/styled'; | ||
|
||
const ShowDeleteForm = styled.form``; | ||
|
||
const Description = styled.p` | ||
${({ theme }) => theme.typo.b3}; | ||
color: ${({ theme }) => theme.palette.grey.g70}; | ||
margin-bottom: 28px; | ||
`; | ||
|
||
const TextFieldContainer = styled.div` | ||
margin-bottom: 32px; | ||
div { | ||
width: 100%; | ||
} | ||
`; | ||
|
||
const ButtonContainer = styled.div` | ||
display: flex; | ||
justify-content: flex-end; | ||
gap: 8px; | ||
`; | ||
|
||
export default { | ||
ShowDeleteForm, | ||
Description, | ||
TextFieldContainer, | ||
ButtonContainer, | ||
}; |
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,69 @@ | ||
import { Button, TextField } from '@boolti/ui'; | ||
import { useState } from 'react'; | ||
import { SubmitHandler, useForm } from 'react-hook-form'; | ||
|
||
import Styled from './ShowDeleteForm.styles'; | ||
|
||
export interface ShowDeleteFormInputs { | ||
showName: string; | ||
} | ||
|
||
interface ShowDeleteFormProps { | ||
showName: string; | ||
onSubmit: SubmitHandler<ShowDeleteFormInputs>; | ||
} | ||
|
||
const ShowDeleteForm = ({ showName, onSubmit }: ShowDeleteFormProps) => { | ||
const { register, handleSubmit, watch } = useForm<ShowDeleteFormInputs>(); | ||
|
||
const [error, setError] = useState<string | null>(null); | ||
|
||
const onSubmitForm: SubmitHandler<ShowDeleteFormInputs> = (data) => { | ||
if (data.showName === showName) { | ||
onSubmit(data); | ||
|
||
return; | ||
} | ||
|
||
setError('정확한 공연명을 입력해주세요.'); | ||
}; | ||
|
||
return ( | ||
<Styled.ShowDeleteForm onSubmit={handleSubmit(onSubmitForm)}> | ||
<Styled.Description> | ||
삭제한 공연은 다시 되돌릴 수 없습니다. | ||
<br /> | ||
삭제하시려면 정확한 공연명을 입력해 주세요. | ||
</Styled.Description> | ||
<Styled.TextFieldContainer> | ||
<TextField | ||
inputType="text" | ||
size="big" | ||
placeholder="공연명을 입력해 주세요" | ||
errorMessage={error ?? undefined} | ||
{...register('showName', { | ||
required: true, | ||
onChange: () => { | ||
setError(null); | ||
}, | ||
})} | ||
/> | ||
</Styled.TextFieldContainer> | ||
<Styled.ButtonContainer> | ||
<Button type="button" size="bold" colorTheme="line"> | ||
취소 | ||
</Button> | ||
<Button | ||
type="submit" | ||
size="bold" | ||
colorTheme="primary" | ||
disabled={watch('showName', '').length === 0} | ||
> | ||
삭제 | ||
</Button> | ||
</Styled.ButtonContainer> | ||
</Styled.ShowDeleteForm> | ||
); | ||
}; | ||
|
||
export default ShowDeleteForm; |
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
Oops, something went wrong.