diff --git a/apps/member/src/components/main/MainBanner/MainBanner.tsx b/apps/member/src/components/common/ActivityPhotoBanner/ActivityPhotoBanner.tsx similarity index 93% rename from apps/member/src/components/main/MainBanner/MainBanner.tsx rename to apps/member/src/components/common/ActivityPhotoBanner/ActivityPhotoBanner.tsx index da09fe5e..ac8098c1 100644 --- a/apps/member/src/components/main/MainBanner/MainBanner.tsx +++ b/apps/member/src/components/common/ActivityPhotoBanner/ActivityPhotoBanner.tsx @@ -3,7 +3,7 @@ import Image from '@components/common/Image/Image'; import { useActivityPhoto } from '@hooks/queries'; import { createImageUrl } from '@utils/api'; -const MainBanner = () => { +const ActivityPhotoBanner = () => { const { data } = useActivityPhoto(); if (data.totalItems === 0) { @@ -30,4 +30,4 @@ const MainBanner = () => { ); }; -export default MainBanner; +export default ActivityPhotoBanner; diff --git a/apps/member/src/components/common/ErrorSection/ErrorSection.tsx b/apps/member/src/components/common/ErrorSection/ErrorSection.tsx new file mode 100644 index 00000000..b182cef5 --- /dev/null +++ b/apps/member/src/components/common/ErrorSection/ErrorSection.tsx @@ -0,0 +1,26 @@ +import { Button } from '@clab-platforms/design-system'; +import { HighPriorityColor } from '@clab-platforms/icon'; + +interface Props { + reset: () => void; +} + +const ErrorSection = ({ reset }: Props) => { + return ( +
+ +
+

+ 불편을 드려 죄송합니다. 오류가 발생했어요. 😭 +

+
+
+

만약 같은 문제가 지속적으로 발생할 경우 문의 해주시기 바랍니다.

+

감사합니다.

+
+ +
+ ); +}; + +export default ErrorSection; diff --git a/apps/member/src/components/common/Image/Image.tsx b/apps/member/src/components/common/Image/Image.tsx index 18b2b2ce..c73743b1 100644 --- a/apps/member/src/components/common/Image/Image.tsx +++ b/apps/member/src/components/common/Image/Image.tsx @@ -45,7 +45,7 @@ const Image = ({ {
현재 활동 사진 - + ); diff --git a/apps/member/src/pages/MainPage/MainPage.tsx b/apps/member/src/pages/MainPage/MainPage.tsx deleted file mode 100644 index 426af369..00000000 --- a/apps/member/src/pages/MainPage/MainPage.tsx +++ /dev/null @@ -1,55 +0,0 @@ -import { Suspense } from 'react'; - -import Content from '@components/common/Content/Content'; -import { - HireBoard, - NewsBoard, - NoticeBoard, - QnABoard, -} from '@components/community/Board'; -import { BoardSection } from '@components/community/BoardSection'; -import BirthdaySection from '@components/main/BirthdaySection/BirthdaySection'; -import BlogSection from '@components/main/BlogSection/BlogSection'; -import MainBanner from '@components/main/MainBanner/MainBanner'; -import MainNoticeSection from '@components/main/MainNoticeSection/MainNoticeSection'; -import OrganizationNewsSection from '@components/main/OrganizationNewsSection/OrganizationNewsSection'; - -const MainPage = () => { - return ( - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ); -}; - -export default MainPage; diff --git a/apps/member/src/components/main/BirthdaySection/BirthdaySection.tsx b/apps/member/src/pages/MainPage/components/BirthdaySection.tsx similarity index 85% rename from apps/member/src/components/main/BirthdaySection/BirthdaySection.tsx rename to apps/member/src/pages/MainPage/components/BirthdaySection.tsx index 29c29a10..8adbabae 100644 --- a/apps/member/src/components/main/BirthdaySection/BirthdaySection.tsx +++ b/apps/member/src/pages/MainPage/components/BirthdaySection.tsx @@ -6,14 +6,7 @@ import { createImageUrl } from '@utils/api'; import { formatMemberName } from '@utils/string'; import dayjs from 'dayjs'; -interface BirthdayCardProps { - id: string; - name: string; - imageUrl: string | null; - birth: string; -} - -const BirthdaySection = () => { +export function BirthdaySection() { const { data } = useBirthday(); return ( @@ -26,15 +19,22 @@ const BirthdaySection = () => {

) : ( data.items.map(({ id, ...props }) => ( - + )) )} ); -}; +} -const BirthdayCard = ({ id, name, imageUrl, birth }: BirthdayCardProps) => { +interface CardProps { + id: string; + name: string; + imageUrl: string | null; + birth: string; +} + +const Card = ({ id, name, imageUrl, birth }: CardProps) => { return (
{
); }; - -export default BirthdaySection; diff --git a/apps/member/src/components/main/BlogSection/BlogSection.tsx b/apps/member/src/pages/MainPage/components/BlogSection.tsx similarity index 93% rename from apps/member/src/components/main/BlogSection/BlogSection.tsx rename to apps/member/src/pages/MainPage/components/BlogSection.tsx index 798b18b0..e5941cbb 100644 --- a/apps/member/src/components/main/BlogSection/BlogSection.tsx +++ b/apps/member/src/pages/MainPage/components/BlogSection.tsx @@ -6,7 +6,7 @@ import { COMMUNITY_MESSAGE } from '@constants/message'; import { PATH_FINDER } from '@constants/path'; import { useBlog } from '@hooks/queries'; -const BlogSection = () => { +export function BlogSection() { const { data } = useBlog(); return ( @@ -29,6 +29,4 @@ const BlogSection = () => { ); -}; - -export default BlogSection; +} diff --git a/apps/member/src/components/main/MainNoticeSection/MainNoticeSection.tsx b/apps/member/src/pages/MainPage/components/NoticeSection.tsx similarity index 92% rename from apps/member/src/components/main/MainNoticeSection/MainNoticeSection.tsx rename to apps/member/src/pages/MainPage/components/NoticeSection.tsx index 1d1b2433..a319a83b 100644 --- a/apps/member/src/components/main/MainNoticeSection/MainNoticeSection.tsx +++ b/apps/member/src/pages/MainPage/components/NoticeSection.tsx @@ -10,16 +10,15 @@ import { DATE_FORMAT } from '@constants/state'; import { useSchedule } from '@hooks/queries'; import { now } from '@utils/date'; -const MainNoticeSection = () => { +export function NoticeSection() { + const [open, setOpen] = useState(false); + const { data } = useSchedule({ startDate: now().format(DATE_FORMAT.WITH_TIME), }); - const [open, setOpen] = useState(false); - /** - * 일정이 없을 경우 렌더링하지 않습니다. - */ if (data.items.length === 0) { + // 일정이 없을 경우 렌더링하지 않습니다. return null; } @@ -63,6 +62,4 @@ const MainNoticeSection = () => { ); -}; - -export default MainNoticeSection; +} diff --git a/apps/member/src/components/main/OrganizationNewsSection/OrganizationNewsSection.tsx b/apps/member/src/pages/MainPage/components/OrganizationNewsSection.tsx similarity index 92% rename from apps/member/src/components/main/OrganizationNewsSection/OrganizationNewsSection.tsx rename to apps/member/src/pages/MainPage/components/OrganizationNewsSection.tsx index 54354b58..dab85630 100644 --- a/apps/member/src/components/main/OrganizationNewsSection/OrganizationNewsSection.tsx +++ b/apps/member/src/pages/MainPage/components/OrganizationNewsSection.tsx @@ -6,7 +6,7 @@ import { COMMUNITY_MESSAGE } from '@constants/message'; import { PATH_FINDER } from '@constants/path'; import { useBoardByCategory } from '@hooks/queries'; -const OrganizationNewsSection = () => { +export function OrganizationNewsSection() { const { data } = useBoardByCategory({ category: 'organization' }); return ( @@ -29,6 +29,4 @@ const OrganizationNewsSection = () => { ); -}; - -export default OrganizationNewsSection; +} diff --git a/apps/member/src/pages/MainPage/index.tsx b/apps/member/src/pages/MainPage/index.tsx new file mode 100644 index 00000000..69bfad34 --- /dev/null +++ b/apps/member/src/pages/MainPage/index.tsx @@ -0,0 +1,70 @@ +import { Suspense } from 'react'; + +import { QueryErrorResetBoundary } from '@tanstack/react-query'; + +import ActivityPhotoBanner from '@components/common/ActivityPhotoBanner/ActivityPhotoBanner'; +import Content from '@components/common/Content/Content'; +import ErrorSection from '@components/common/ErrorSection/ErrorSection'; +import { + HireBoard, + NewsBoard, + NoticeBoard, + QnABoard, +} from '@components/community/Board'; +import { BoardSection } from '@components/community/BoardSection'; + +import { ErrorBoundary } from '@suspensive/react'; + +import { BirthdaySection } from './components/BirthdaySection'; +import { BlogSection } from './components/BlogSection'; +import { NoticeSection } from './components/NoticeSection'; +import { OrganizationNewsSection } from './components/OrganizationNewsSection'; + +export default function MainPage() { + return ( + + {({ reset }) => ( + } + > + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + )} + + ); +} diff --git a/apps/member/src/pages/MyPage/index.tsx b/apps/member/src/pages/MyPage/index.tsx index 92c49eee..0ea04574 100644 --- a/apps/member/src/pages/MyPage/index.tsx +++ b/apps/member/src/pages/MyPage/index.tsx @@ -5,6 +5,7 @@ import { QueryErrorResetBoundary } from '@tanstack/react-query'; import { Grid } from '@clab-platforms/design-system'; import Content from '@components/common/Content/Content'; +import ErrorSection from '@components/common/ErrorSection/ErrorSection'; import { Section } from '@components/common/Section'; import { ErrorBoundary } from '@suspensive/react'; @@ -18,7 +19,10 @@ export default function MyPage() { return ( {({ reset }) => ( - }> + } + > }> diff --git a/apps/member/src/pages/Routes.tsx b/apps/member/src/pages/Routes.tsx index affc73cb..446aec45 100644 --- a/apps/member/src/pages/Routes.tsx +++ b/apps/member/src/pages/Routes.tsx @@ -5,7 +5,7 @@ import { SectionSkeleton } from '@components/common/Section'; import ProtectAuth from '@components/router/ProtectAuth'; import { PATH } from '@constants/path'; -import MainPage from '@pages/MainPage/MainPage'; +import MainPage from '@pages/MainPage'; import { GlobalErrorPage } from './GlobalErrorPage'; import { PageLayout } from './PageLayout'; diff --git a/apps/member/src/pages/SupportPage/index.tsx b/apps/member/src/pages/SupportPage/index.tsx index 87c35931..ce51adcc 100644 --- a/apps/member/src/pages/SupportPage/index.tsx +++ b/apps/member/src/pages/SupportPage/index.tsx @@ -3,13 +3,13 @@ import { Suspense } from 'react'; import { QueryErrorResetBoundary } from '@tanstack/react-query'; import Content from '@components/common/Content/Content'; +import ErrorSection from '@components/common/ErrorSection/ErrorSection'; import Header from '@components/common/Header/Header'; import { SupportHistorySection, SupportHistorySectionSkeleton, } from '@components/support/SupportHistorySection'; -import { GlobalErrorPage } from '@pages/GlobalErrorPage'; import { ErrorBoundary } from '@suspensive/react'; import { IntroduceSection } from './components/IntroduceSection'; @@ -19,7 +19,10 @@ export default function SupportPage() { return ( {({ reset }) => ( - }> + } + >