-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* chore: image remote pattern 설정 * feat: Film 추가 API 연동 * fix: userId type error 해결 * feat: response type 정의 * feat: 유저 페이지 API 연동 * feat: onEditProfile 인자 제거 * feat: 필름제목 수정 API 연동 * fix: 모달 내부 인풋 state가 초기화되지 않는 현상 수정 * feat: 카메라 롤 컷 클릭시 라우팅 * feat: 포토컷 올리기 모달 데이터 연동 및 submit 시 라우팅 적용 * feat: 로그인, 비로그인뷰 구분 * feat: useIsomorphicLayoutEffect 추가 * fix: 비로그인뷰가 잠시보이는 현상 임시 수정 * feat: empty view 추가
- Loading branch information
Showing
22 changed files
with
492 additions
and
156 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
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
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,31 @@ | ||
import Image from 'next/image'; | ||
import { useRouter } from 'next/router'; | ||
import { Button } from '@/components/shared'; | ||
|
||
interface Props { | ||
isLogin?: boolean; | ||
} | ||
|
||
export function EmptyView({ isLogin }: Props) { | ||
const router = useRouter(); | ||
|
||
return ( | ||
<div className='tw-flex tw-flex-col tw-items-center tw-gap-9'> | ||
<div className='tw-flex tw-flex-col tw-items-center tw-gap-2.5'> | ||
<Image | ||
src='/images/film.png' | ||
alt='empty view' | ||
width={200} | ||
height={186} | ||
priority | ||
/> | ||
<p className='tw-text-body1 tw-text-grayscale-300'> | ||
아직 등록된 사진이 없어요 | ||
</p> | ||
</div> | ||
{!isLogin && ( | ||
<Button onClick={() => router.push('/signin')}>내 그라피 만들기</Button> | ||
)} | ||
</div> | ||
); | ||
} |
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 |
---|---|---|
@@ -1,23 +1,44 @@ | ||
import { useRouter } from 'next/router'; | ||
import { type ComponentProps, type MouseEventHandler, useState } from 'react'; | ||
import { useCreateFilms } from '@/query-hooks/useFilms'; | ||
import { Input, Modal } from '@/components/shared'; | ||
|
||
type Props = Omit<ComponentProps<typeof Modal>, 'title' | 'children'>; | ||
|
||
export function FilmAddModal({ onCancel, ...restProps }: Props) { | ||
const router = useRouter(); | ||
const { mutate: createFilms } = useCreateFilms(); | ||
const [input, setInput] = useState(''); | ||
|
||
const handleValueChange = (value: string) => { | ||
setInput(value); | ||
}; | ||
|
||
const handleSave: MouseEventHandler<HTMLButtonElement> = (e) => { | ||
// TODO: 필름 추가 API 연결 | ||
const userId = localStorage.getItem('userId'); | ||
if (!userId) { | ||
router.push('/signin'); | ||
return; | ||
} | ||
|
||
createFilms({ title: input, userId }); | ||
|
||
if (onCancel) onCancel(e); | ||
}; | ||
|
||
return ( | ||
<Modal title='새로운 필름 추가' onCancel={onCancel} onSave={handleSave} {...restProps}> | ||
<Input label='필름 제목' placeholder='필름 제목을 입력하세요' value={input} onValueChange={handleValueChange} /> | ||
<Modal | ||
title='새로운 필름 추가' | ||
onCancel={onCancel} | ||
onSave={handleSave} | ||
{...restProps} | ||
> | ||
<Input | ||
label='필름 제목' | ||
placeholder='필름 제목을 입력하세요' | ||
value={input} | ||
onValueChange={handleValueChange} | ||
/> | ||
</Modal> | ||
); | ||
} |
Oops, something went wrong.