-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' of https://github.com/Moaguide-develop/moaguide_f…
…ront into feat/notification
- Loading branch information
Showing
12 changed files
with
274 additions
and
80 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,63 @@ | ||
import Image from 'next/image'; | ||
const NoticeDetailPage = () => { | ||
return ( | ||
<div className=" max-w-[640px] mx-auto"> | ||
<Image | ||
src={'/images/detail/CaretLeft.svg'} | ||
width={24} | ||
height={24} | ||
alt="Left Arrow" | ||
className="mb-[34px] mt-[15px]" | ||
/> | ||
<div className=" flex flex-col "> | ||
<div className=" text-base font-bold mb-[12px]">23기 배당금 지급 안내</div> | ||
|
||
<div className=" text-gray-400">2024.06.06</div> | ||
|
||
<div className=" w-full h-[1px] bg-gray-200 my-[20px]" /> | ||
<div className="text-gray-400 mb-[40px]"> | ||
공지자료 내용 안내 노출란입니다. 공지자료 내용 안내 노출란입니다. 공지자료 내용 | ||
안내 노출란입니다. 공지자료 내용 안내 노출란입니다. 공지자료 내용 안내 | ||
노출란입니다. 공지자료 내용 안내 노출란입니다. 공지자료 내용 안내 노출란입니다. | ||
공지자료 내용 안내 노출란입니다. | ||
</div> | ||
|
||
<div className=" border-gray-200 rounded-lg border-[1px] flex justify-between px-[20px] py-[16px] mb-[12px]"> | ||
<div className=" flex"> | ||
<Image | ||
src={'/images/detail/FileText.svg'} | ||
width={20} | ||
height={20} | ||
alt="File Text" | ||
/> | ||
<div>1호 23기 배당 안내문 1.pdf</div> | ||
</div> | ||
<Image | ||
src={'/images/detail/DownloadSimple.svg'} | ||
width={20} | ||
height={20} | ||
alt="Download Simple" | ||
/> | ||
</div> | ||
<div className=" border-gray-200 rounded-lg border-[1px] flex justify-between px-[20px] py-[16px]"> | ||
<div className=" flex"> | ||
<Image | ||
src={'/images/detail/FileText.svg'} | ||
width={20} | ||
height={20} | ||
alt="File Text" | ||
/> | ||
<div>2호 23기 배당 안내문 1.pdf</div> | ||
</div> | ||
<Image | ||
src={'/images/detail/DownloadSimple.svg'} | ||
width={20} | ||
height={20} | ||
alt="Download Simple" | ||
/> | ||
</div> | ||
</div> | ||
</div> | ||
); | ||
}; | ||
export default NoticeDetailPage; |
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,76 @@ | ||
'use client'; | ||
import Container from '@/components/common/Container'; | ||
import NoticeItemSkeleton from '@/components/skeleton/NoticeItemSkeleton'; | ||
import UseNoticeLists from '@/factory/useNoticeLists'; | ||
import { INoticeItem } from '@/types/BuildingProductType'; | ||
import { useCallback } from 'react'; | ||
import { Virtuoso } from 'react-virtuoso'; | ||
import Image from 'next/image'; | ||
import { useRouter } from 'next/navigation'; | ||
const NoticePage = () => { | ||
const router = useRouter(); | ||
const category = 'sou.8'; | ||
|
||
const { data, fetchNextPage, hasNextPage, isFetching, isFetchingNextPage, isLoading } = | ||
UseNoticeLists(category); | ||
|
||
const loadMore = useCallback(() => { | ||
if (hasNextPage && !isFetching && !isFetchingNextPage && !isLoading) { | ||
setTimeout(() => { | ||
fetchNextPage(); | ||
}, 200); | ||
} | ||
}, [fetchNextPage, hasNextPage, isFetching, isFetchingNextPage, isLoading]); | ||
|
||
// const allPosts = data?.pages?.flat() || []; | ||
const allPosts = data?.pages.flatMap((page) => page.notice) || []; | ||
// const allPosts = data?.pages[0].notice; | ||
|
||
return ( | ||
<Container> | ||
<Image | ||
src={'/images/detail/CaretLeft.svg'} | ||
width={24} | ||
height={24} | ||
alt="Left Arrow" | ||
className="mb-[34px] mt-[15px] ml-[10px]" | ||
onClick={() => router.back()} | ||
/> | ||
<div> | ||
<div className="flex justify-start text-2xl ml-[10px] mt-[15px] font-bold"> | ||
공지사항 | ||
</div> | ||
|
||
<div className="max-w-[1000px] mx-auto mt-[32px]"> | ||
{isLoading ? ( | ||
Array.from({ length: 5 }).map((_, i) => <NoticeItemSkeleton key={i} />) | ||
) : ( | ||
<Virtuoso | ||
style={{ height: '200px', margin: '0px' }} | ||
useWindowScroll | ||
totalCount={allPosts.length} | ||
data={allPosts} | ||
endReached={loadMore} | ||
itemContent={(index, item: INoticeItem) => ( | ||
<NoticeItem key={item.id} {...item} /> | ||
)} | ||
/> | ||
)} | ||
</div> | ||
</div> | ||
</Container> | ||
); | ||
}; | ||
|
||
export default NoticePage; | ||
|
||
const NoticeItem = ({ content, id, noticeDay, title }: INoticeItem) => { | ||
return ( | ||
<div | ||
key={id} | ||
className=" flex flex-col border-b-[1px] border-gray-200 py-[20px] px-[20px] rounded-lg"> | ||
<div className="text-base font-bold mb-[12px]">{title}</div> | ||
<div className="text-gray-400">{noticeDay}</div> | ||
</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
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
Oops, something went wrong.