-
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.
* feat: mainListTap 하단 border set Width as screen * feat: header height값 수정 * feat: Digest탭의 빈 페이지 구현 * feat: 메일 읽기 api 연동 추가 * feat: 메일 삭제 UI 및 API 연결 --------- Co-authored-by: moonki <[email protected]>
- Loading branch information
1 parent
c789f26
commit 8b1026b
Showing
13 changed files
with
146 additions
and
21 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import { useMutation } from '@tanstack/react-query'; | ||
import { axiosInstance } from '@/api/axiosInstance'; | ||
import { AxiosError, AxiosResponse } from 'axios'; | ||
|
||
interface patchParam { | ||
mailId: string; | ||
} | ||
|
||
export const patchFn = ({ mailId }: patchParam) => { | ||
return axiosInstance.patch(`/inbox/mails/${mailId}`, { action: 'read' }); | ||
}; | ||
|
||
export const deleteFn = ({ mailId }: patchParam) => { | ||
return axiosInstance.delete(`/inbox/mails/${mailId}`); | ||
}; | ||
|
||
export const useMailReadMutation = () => { | ||
return useMutation<AxiosResponse, AxiosError, patchParam>({ | ||
mutationFn: patchFn, | ||
}); | ||
}; | ||
|
||
export const useMailDeleteMutation = () => { | ||
return useMutation<AxiosResponse, AxiosError, patchParam>({ | ||
mutationFn: deleteFn, | ||
}); | ||
}; |
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,33 @@ | ||
import { useMailDeleteMutation } from '@/api/hooks/useMailReadMutation'; | ||
import DeleteIcon from '@/assets/icons/DeleteIcon.svg'; | ||
import ListIcon from '@/assets/icons/ListIcon.svg'; | ||
import Image from 'next/image'; | ||
|
||
interface ArticleFooterProps { | ||
mailId: string; | ||
} | ||
|
||
const ArticleFooter = ({ mailId }: ArticleFooterProps) => { | ||
const deleteMutation = useMailDeleteMutation(); | ||
|
||
const handleDeleteMail = (mailId: string) => { | ||
deleteMutation.mutate({ mailId }); | ||
}; | ||
return ( | ||
<div className='fixed bottom-0 flex flex-row items-center justify-center w-full h-12 bg-white border-t border-lightgrey'> | ||
<div className='flex flex-row justify-end gap-6 px-6 w-content'> | ||
<span | ||
className='flex items-center justify-center w-6 h-6 cursor-pointer' | ||
onClick={() => handleDeleteMail(mailId)} | ||
> | ||
<Image src={DeleteIcon} alt='delete' width={16} height={24} /> | ||
</span> | ||
<span className='flex items-center justify-center w-6 h-6 cursor-pointer'> | ||
<Image src={ListIcon} alt='list' width={24} height={24} /> | ||
</span> | ||
</div> | ||
</div> | ||
); | ||
}; | ||
|
||
export default ArticleFooter; |
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,30 @@ | ||
import Image from 'next/image'; | ||
import Link from 'next/link'; | ||
import EmptyView from '@/assets/images/EmptyView.png'; | ||
|
||
const EmptyMailView = () => { | ||
return ( | ||
<div className='flex flex-col items-center justify-start w-full h-full bg-background_grey rounded-xl pt-25'> | ||
<div className='flex flex-col items-center gap-3'> | ||
<Image src={EmptyView} alt='EmptyView' width={120} height={106} /> | ||
<div className='flex flex-col items-center gap-1'> | ||
<span className='text-h2 text-darkgrey'>뉴스레터를 모두 읽었어요</span> | ||
<span className='flex flex-row gap-1 text-btn1'> | ||
<span className='text-darkgrey'>더 많은 뉴스레터를 읽고 싶다면</span> | ||
<Link | ||
className='underline text-blue underline-offset-2' | ||
href={{ | ||
pathname: '/main', | ||
query: { tab: 'search' }, | ||
}} | ||
> | ||
탐색 탭으로 이동 | ||
</Link> | ||
</span> | ||
</div> | ||
</div> | ||
</div> | ||
); | ||
}; | ||
|
||
export default EmptyMailView; |
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