From 808eb30f9b75f7efbe638b3e3f7e65efb4531832 Mon Sep 17 00:00:00 2001 From: JEON TAEHEON Date: Thu, 24 Oct 2024 17:36:30 +0900 Subject: [PATCH] =?UTF-8?q?=EC=88=98=EC=A0=95=EC=82=AC=ED=95=AD=20?= =?UTF-8?q?=EB=B0=98=EC=98=81=20(issue=20#746)=20(#747)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * refactor: 커스텀 뮤테이션 인자 변경 * Merge branch 'dev' of https://github.com/woowacourse-teams/2024-devel-up into dev * remove: 파일 삭제 * refactor: 수정사항 반영 * refactor: privateRotue * refacotr: a링크로 대체 * fix: 링크 삭제 * design: 수정사항 반영 * design: 수정사항 반영 --- .../DashboardDiscussion.styled.ts | 6 ++++++ .../DashboardDiscussion/DiscussionItem.tsx | 9 +++++---- .../DashBoard/DashboardDiscussion/index.tsx | 6 +++--- .../src/components/common/Error/ErrorLogo.tsx | 5 ++++- frontend/src/index.tsx | 18 +++++++++--------- .../DashBoardPageLayout.styled.ts | 1 - .../DashBoardPageLayout/index.tsx | 11 ++++++++--- .../pages/DashboardPage/Discussion/index.tsx | 7 ++++++- .../DashboardPage/DiscussionComment/index.tsx | 7 ++++++- 9 files changed, 47 insertions(+), 23 deletions(-) diff --git a/frontend/src/components/DashBoard/DashboardDiscussion/DashboardDiscussion.styled.ts b/frontend/src/components/DashBoard/DashboardDiscussion/DashboardDiscussion.styled.ts index 0d453c41..7160f592 100644 --- a/frontend/src/components/DashBoard/DashboardDiscussion/DashboardDiscussion.styled.ts +++ b/frontend/src/components/DashBoard/DashboardDiscussion/DashboardDiscussion.styled.ts @@ -81,6 +81,11 @@ export const ImageCommentWrapper = styled.div` export const TextWrapper = styled.div` display: flex; flex-direction: column; + width: 50rem; + + ${media.medium` + width:18rem + `} `; export const CommentText = styled.span` @@ -88,6 +93,7 @@ export const CommentText = styled.span` white-space: nowrap; overflow: hidden; text-overflow: ellipsis; + width: 80%; `; export const SubText = styled.span` diff --git a/frontend/src/components/DashBoard/DashboardDiscussion/DiscussionItem.tsx b/frontend/src/components/DashBoard/DashboardDiscussion/DiscussionItem.tsx index b11db9bb..9ca1a752 100644 --- a/frontend/src/components/DashBoard/DashboardDiscussion/DiscussionItem.tsx +++ b/frontend/src/components/DashBoard/DashboardDiscussion/DiscussionItem.tsx @@ -6,7 +6,7 @@ import { formatDateString } from '@/utils/formatDateString'; interface DiscussionItemProps { id: number; mission: string; - hashTags: HashTag[]; + hashTags?: HashTag[]; title: string; imageUrl: string; commentCount: number; @@ -27,9 +27,10 @@ export default function DiscussionItem({ {mission && {mission}} - {hashTags.map((hashTag) => { - return {hashTag.name}; - })} + {hashTags && + hashTags.map((hashTag) => { + return {hashTag.name}; + })} {title} {formatDateString(createdAt)} diff --git a/frontend/src/components/DashBoard/DashboardDiscussion/index.tsx b/frontend/src/components/DashBoard/DashboardDiscussion/index.tsx index 9683ce31..4d6a73e8 100644 --- a/frontend/src/components/DashBoard/DashboardDiscussion/index.tsx +++ b/frontend/src/components/DashBoard/DashboardDiscussion/index.tsx @@ -30,16 +30,16 @@ export default function DashBoardDiscussionList() { return ( <> - {!discussionList.length ? ( + {!discussionList?.length ? ( ) : ( - {discussionList.map((discussion) => { + {discussionList?.map((discussion) => { return ( - 🚀 DEVEL UP + + DEVEL UP + diff --git a/frontend/src/index.tsx b/frontend/src/index.tsx index f75de0ff..6d3217a2 100644 --- a/frontend/src/index.tsx +++ b/frontend/src/index.tsx @@ -284,17 +284,17 @@ export const router = createBrowserRouter(routes, { basename: ROUTES.main, }); -// async function enableMocking() { -// if (process.env.NODE_ENV !== 'development') { -// return; -// } +async function enableMocking() { + if (process.env.NODE_ENV !== 'development') { + return; + } -// const { worker } = await import('./mocks/browser'); + const { worker } = await import('./mocks/browser'); -// // `worker.start()` returns a Promise that resolves -// // once the Service Worker is up and ready to intercept requests. -// return worker.start(); -// } + // `worker.start()` returns a Promise that resolves + // once the Service Worker is up and ready to intercept requests. + return worker.start(); +} // enableMocking().then(() => { // root.render( diff --git a/frontend/src/pages/DashboardPage/DashBoardPageLayout/DashBoardPageLayout.styled.ts b/frontend/src/pages/DashboardPage/DashBoardPageLayout/DashBoardPageLayout.styled.ts index d7767620..34fcb089 100644 --- a/frontend/src/pages/DashboardPage/DashBoardPageLayout/DashBoardPageLayout.styled.ts +++ b/frontend/src/pages/DashboardPage/DashBoardPageLayout/DashBoardPageLayout.styled.ts @@ -10,7 +10,6 @@ export const Container = styled.div` width: 100rem; ${media.large` - width: 80rem; padding: 3rem 0; gap: 3rem; `} diff --git a/frontend/src/pages/DashboardPage/DashBoardPageLayout/index.tsx b/frontend/src/pages/DashboardPage/DashBoardPageLayout/index.tsx index 40c0a635..7085720f 100644 --- a/frontend/src/pages/DashboardPage/DashBoardPageLayout/index.tsx +++ b/frontend/src/pages/DashboardPage/DashBoardPageLayout/index.tsx @@ -1,7 +1,7 @@ import { createContext, type PropsWithChildren, useContext, useEffect, useState } from 'react'; import useUserInfo from '@/hooks/useUserInfo'; import * as S from './DashBoardPageLayout.styled'; -import { Link, useLocation } from 'react-router-dom'; +import { useLocation } from 'react-router-dom'; const PATH_INFO = [ { @@ -63,6 +63,11 @@ export default function DashboardPageLayout({ children }: PropsWithChildren) { const { data: userInfo } = useUserInfo(); const currentPathText = PATH_INFO.find((item) => item.name === path); + const URL = + process.env.NODE_ENV === 'development' + ? 'https://dev.devel-up.co.kr' + : 'https://devel-up.co.kr'; + return ( @@ -78,9 +83,9 @@ export default function DashboardPageLayout({ children }: PropsWithChildren) { return ( - + {path.text} - + ); })} diff --git a/frontend/src/pages/DashboardPage/Discussion/index.tsx b/frontend/src/pages/DashboardPage/Discussion/index.tsx index ba29d3a3..1356788e 100644 --- a/frontend/src/pages/DashboardPage/Discussion/index.tsx +++ b/frontend/src/pages/DashboardPage/Discussion/index.tsx @@ -1,5 +1,10 @@ import DashBoardDiscussionList from '@/components/DashBoard/DashboardDiscussion'; +import SpinnerSuspense from '@/components/common/SpinnerSuspense'; export default function DashboardDiscussionPage() { - return ; + return ( + + + + ); } diff --git a/frontend/src/pages/DashboardPage/DiscussionComment/index.tsx b/frontend/src/pages/DashboardPage/DiscussionComment/index.tsx index 8373c8eb..d9ed44a2 100644 --- a/frontend/src/pages/DashboardPage/DiscussionComment/index.tsx +++ b/frontend/src/pages/DashboardPage/DiscussionComment/index.tsx @@ -1,5 +1,10 @@ import DiscussionCommentList from '@/components/DashBoard/DiscussionComment'; +import SpinnerSuspense from '@/components/common/SpinnerSuspense'; export default function DashboardDiscussionCommentPage() { - return ; + return ( + + + + ); }