From ffb600b55a72397269b2de4b6ba2410cf68218cd Mon Sep 17 00:00:00 2001 From: SuJin Date: Mon, 1 Jan 2024 14:58:56 +0900 Subject: [PATCH 01/17] =?UTF-8?q?feat:=20=EC=83=81=EC=84=B8=EC=A0=95?= =?UTF-8?q?=EB=B3=B4=20api=20=EC=97=B0=EA=B2=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../community/info/CommunityInfo.tsx | 47 ++++++++++++------- .../{info/index.page.tsx => [id].page.tsx} | 0 src/types/Community.ts | 16 +++++++ 3 files changed, 47 insertions(+), 16 deletions(-) rename src/pages/community/{info/index.page.tsx => [id].page.tsx} (100%) create mode 100644 src/types/Community.ts diff --git a/src/components/community/info/CommunityInfo.tsx b/src/components/community/info/CommunityInfo.tsx index 3afb1078..2c4b65d3 100644 --- a/src/components/community/info/CommunityInfo.tsx +++ b/src/components/community/info/CommunityInfo.tsx @@ -4,8 +4,6 @@ import Image from 'next/image'; import Comment from '@/components/common/Comment'; import CommentInput from '@/components/common/Comment/CommentInput'; import Category from '@/components/common/Category'; -import Sue from '@icons/icon/Icon18/Sue.svg'; -import Ben from '@icons/icon/Icon18/Ben.svg'; import SamllHits from '@icons/icon/Icon18/SmallHits.svg'; import FilledLiked from '@icons/icon/Liked/FilledLiked.svg'; import DefaultLiked from '@icons/icon/Liked/DefaultLiked.svg'; @@ -17,9 +15,11 @@ import { getCommunityInfoCommentAPI, } from '@/apis/communityAPIS'; import { useRouter } from 'next/router'; -import { Comments, NoticeInfoProps } from '@/types/NoticeFunsystem'; +import { Comments } from '@/types/NoticeFunsystem'; import UtilityHeader from '@/components/common/Header/UtilityHeader'; +import { CommunityInfoProps } from '@/types/Community'; const CommunityInfo = () => { + const [data, setData] = useState(); const [comments, setComments] = useState(); const [isLike, setIsLike] = useState(false); const [isScrap, setIsScrap] = useState(false); @@ -36,11 +36,29 @@ const CommunityInfo = () => { setIsScrap(!isScrap); }; + // 현재 주소 값 + const router = useRouter(); + const path = router.asPath; + const pathId = router.query.id; + + useEffect(() => { + // 공지사항 API 연결 + const getCommunityInfo = getCommunityInfoAPI(Number(pathId)); + getCommunityInfo.then((res) => { + setData(res.data); + }); + + const getcomments = getCommunityInfoCommentAPI(Number(pathId)); + getcomments.then((res) => { + setComments(res?.data); + }); + }, []); + return ( - + @@ -55,11 +73,11 @@ const CommunityInfo = () => { - 닉네임 + {data?.writerNickName} - 2023/05/20 - 21:23 + {data?.updatedAt.slice(0, 10)} + {data?.updatedAt.slice(11, 16)} @@ -71,17 +89,14 @@ const CommunityInfo = () => { priority /> - 5회 + {data?.views} - 이거 어떻게 하는 거예요 - - 엄청나게 잘해서 A+를 받겠어~ 엄청나게 잘해서 A+를 받겠어~ 종강아 - 어서와 - + {data?.title} + {data?.content} @@ -104,7 +119,7 @@ const CommunityInfo = () => { )} {/** TODO: 눌렀을때 모양 변경 */} - 5 + {data?.likes} @@ -116,7 +131,7 @@ const CommunityInfo = () => { priority /> - 5 + {data?.comments} @@ -138,7 +153,7 @@ const CommunityInfo = () => { /> )} - 0 + {data?.scrapCount} diff --git a/src/pages/community/info/index.page.tsx b/src/pages/community/[id].page.tsx similarity index 100% rename from src/pages/community/info/index.page.tsx rename to src/pages/community/[id].page.tsx diff --git a/src/types/Community.ts b/src/types/Community.ts new file mode 100644 index 00000000..ff512da2 --- /dev/null +++ b/src/types/Community.ts @@ -0,0 +1,16 @@ +export interface CommunityInfoProps { + id: number; + title: string; + content: string; + category: string; + imageUrls: string[]; + fileUrl: string; + createdAt: string; + updatedAt: string; + views: number; + comments: number; + likes: number; + scrapCount: number; + topic: string; + writerNickName: string; +} From 6cb962d1a0d24120062a97bb101f0218fe308e70 Mon Sep 17 00:00:00 2001 From: SuJin Date: Tue, 2 Jan 2024 19:08:19 +0900 Subject: [PATCH 02/17] =?UTF-8?q?feat:=20=EC=A2=8B=EC=95=84=EC=9A=94,=20?= =?UTF-8?q?=EC=8A=A4=ED=81=AC=EB=9E=A9=20api=20=EC=97=B0=EA=B2=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/apis/communityAPIS.ts | 44 +++++++++++++++++++ .../community/info/CommunityInfo.tsx | 22 +++++++--- 2 files changed, 60 insertions(+), 6 deletions(-) diff --git a/src/apis/communityAPIS.ts b/src/apis/communityAPIS.ts index 20f22d53..e9cfc02f 100644 --- a/src/apis/communityAPIS.ts +++ b/src/apis/communityAPIS.ts @@ -60,3 +60,47 @@ export const getCommunityInfoCommentAPI = async (articleID: number) => { return null; } }; + +export const postCommunityScrapAPI = async ( + articleID: number, + isActive: boolean, +) => { + try { + const response = await axiosInstance.post( + `/community/article/${articleID}/scrap?isActive=${isActive}`, + ); + return response.data; + } catch (error) { + if (axios.isAxiosError(error)) { + console.log(error.response?.data); + } + return null; + } +}; + +export const postCommunityLikeAPI = async (articleID: number) => { + try { + const response = await axiosInstance.post( + `/community/article/${articleID}/like`, + ); + return response.data; + } catch (error) { + if (axios.isAxiosError(error)) { + console.log(error.response?.data); + } + return null; + } +}; +export const postCommunityDislikeAPI = async (articleID: number) => { + try { + const response = await axiosInstance.post( + `/community/article/${articleID}/dislike`, + ); + return response.data; + } catch (error) { + if (axios.isAxiosError(error)) { + console.log(error.response?.data); + } + return null; + } +}; diff --git a/src/components/community/info/CommunityInfo.tsx b/src/components/community/info/CommunityInfo.tsx index 2c4b65d3..260a31d1 100644 --- a/src/components/community/info/CommunityInfo.tsx +++ b/src/components/community/info/CommunityInfo.tsx @@ -13,6 +13,9 @@ import DefaultScrap from '@icons/icon/Scrap/DefaultScrap.svg'; import { getCommunityInfoAPI, getCommunityInfoCommentAPI, + postCommunityDislikeAPI, + postCommunityLikeAPI, + postCommunityScrapAPI, } from '@/apis/communityAPIS'; import { useRouter } from 'next/router'; import { Comments } from '@/types/NoticeFunsystem'; @@ -28,21 +31,28 @@ const CommunityInfo = () => { setMenu(!menu); }; + // 현재 주소 값 + const router = useRouter(); + const path = router.asPath; + const pathId = router.query.id; + const handleLikeClick = () => { setIsLike(!isLike); + if (!isLike) { + postCommunityLikeAPI(Number(pathId)); + } else { + postCommunityDislikeAPI(Number(pathId)); + } }; const handleScrapClick = () => { setIsScrap(!isScrap); + if (!isScrap) { + postCommunityScrapAPI(Number(pathId), !isScrap); + } }; - // 현재 주소 값 - const router = useRouter(); - const path = router.asPath; - const pathId = router.query.id; - useEffect(() => { - // 공지사항 API 연결 const getCommunityInfo = getCommunityInfoAPI(Number(pathId)); getCommunityInfo.then((res) => { setData(res.data); From 0aeb88ef9bca1c01ab3c61217c2c8db76b68e799 Mon Sep 17 00:00:00 2001 From: SuJin Date: Tue, 2 Jan 2024 19:08:29 +0900 Subject: [PATCH 03/17] =?UTF-8?q?feat:=20=EB=8C=93=EA=B8=80=20api=20?= =?UTF-8?q?=EC=97=B0=EA=B2=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/community/info/CommunityInfo.tsx | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/components/community/info/CommunityInfo.tsx b/src/components/community/info/CommunityInfo.tsx index 260a31d1..f2cfc684 100644 --- a/src/components/community/info/CommunityInfo.tsx +++ b/src/components/community/info/CommunityInfo.tsx @@ -170,6 +170,20 @@ const CommunityInfo = () => { 댓글 + {comments?.map((comment) => { + return ( + + ); + })} From bd411755750431504d7277eb04de6254435824e4 Mon Sep 17 00:00:00 2001 From: SuJin Date: Tue, 2 Jan 2024 19:38:23 +0900 Subject: [PATCH 04/17] =?UTF-8?q?style:=20=EB=B0=98=EC=9D=91=ED=98=95?= =?UTF-8?q?=EC=9C=BC=EB=A1=9C=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/community/info/CommunityInfo.style.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/components/community/info/CommunityInfo.style.ts b/src/components/community/info/CommunityInfo.style.ts index d001ff6e..244e8715 100644 --- a/src/components/community/info/CommunityInfo.style.ts +++ b/src/components/community/info/CommunityInfo.style.ts @@ -3,7 +3,7 @@ import { TEXT_STYLES } from '@/styles/constants/textStyles'; import { COLORS } from '@/styles/constants/colors'; export const Container = styled.div` - width: 390px; + width: 100%; `; export const Padding = styled.div` @@ -88,7 +88,7 @@ export const ProfileCenterBox = styled.div` display: flex; flex-direction: column; margin: auto 0; - width: 345px; + width: 100%; `; export const ProfileRightBox = styled.div` @@ -109,6 +109,7 @@ export const ProfileBottomBox = styled.div` display: flex; height: 24px; align-items: center; + width: 100%; `; export const DateBox = styled.div` @@ -151,6 +152,7 @@ export const TitleBox = styled.div` export const ContentBox = styled.div` margin-bottom: 15px; ${TEXT_STYLES.BodyR16} + word-break: break-all; `; export const UnderBarBox = styled.div` From 61fa42446515da56b4f83fc942b8602f55d13f7a Mon Sep 17 00:00:00 2001 From: SuJin Date: Tue, 2 Jan 2024 19:38:42 +0900 Subject: [PATCH 05/17] =?UTF-8?q?style:=20=EB=B0=B0=EA=B2=BD=20=ED=9D=B0?= =?UTF-8?q?=EC=83=89=EC=9C=BC=EB=A1=9C=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/community/info/CommunityInfo.style.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/components/community/info/CommunityInfo.style.ts b/src/components/community/info/CommunityInfo.style.ts index 244e8715..0b97d847 100644 --- a/src/components/community/info/CommunityInfo.style.ts +++ b/src/components/community/info/CommunityInfo.style.ts @@ -4,6 +4,8 @@ import { COLORS } from '@/styles/constants/colors'; export const Container = styled.div` width: 100%; + height: 100vh; + background-color: white; `; export const Padding = styled.div` From 7be564cb778bb3fcdbcc3b9a3e27caa5bf4da64d Mon Sep 17 00:00:00 2001 From: Sanghyeon Sim <96258104+halfmoon-mind@users.noreply.github.com> Date: Thu, 4 Jan 2024 21:59:29 +0900 Subject: [PATCH 06/17] =?UTF-8?q?[#159]=20Header=20=EA=B4=80=EB=A0=A8=20?= =?UTF-8?q?=EB=A1=9C=EC=A7=81=20=EC=B6=94=EA=B0=80=20(#160)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: Route에 따른 header 조건 지정 * fix: 바텀네비게이션 announce -> notice로 수정 * refactor: style 코드들 정렬 * feat: 더보기 클릭 라우팅 추가 * feat: 코드 스타일 업데이트 * feat: 스크롤 코드 삭제 * feat: bottom nav bar true로 설정 * feat: 상위 3개만 출력하도록 변경 * feat: 로그인에서 utility header 추가 * refactor: 불필요한 코드 삭제 * refactor: PR시 빌드 확인 코드 삭제 * feat: main에서 api 콜 수정 * refactor: header 설정 추가 * fix: storybook 업데이트 --- .github/workflows/pull_request_action.yml | 23 ------ .../NoticeFunSystem.styles.tsx | 71 +++++++++---------- .../Home/NoticeFunSystem/NoticeFunSystem.tsx | 13 +++- .../LineSearchBar/LineSearchBar.styles.ts | 24 ++++--- .../LineSearchBar/LineSearchBar.tsx | 29 +++++--- .../NoticeFunSystemTab/NoticeFunSystemTab.tsx | 61 ++++++++-------- .../PopularPosts/PopularPosts.stories.tsx | 8 +-- .../Home/PopularPosts/PopularPosts.styles.ts | 2 +- .../Home/PopularPosts/PopularPosts.tsx | 31 ++++---- src/components/common/Header/Header.tsx | 68 +++++++++++++----- src/components/common/Navbar/Navigation.ts | 2 +- src/components/landing/index.tsx | 1 - src/components/main/index.tsx | 21 +++++- src/hooks/useNavbar.ts | 2 +- src/pages/index.page.tsx | 25 ++----- src/pages/landing/index.page.tsx | 9 +++ src/pages/layout/index.tsx | 17 ++++- src/pages/login/index.page.tsx | 8 ++- 18 files changed, 236 insertions(+), 179 deletions(-) delete mode 100644 .github/workflows/pull_request_action.yml create mode 100644 src/pages/landing/index.page.tsx diff --git a/.github/workflows/pull_request_action.yml b/.github/workflows/pull_request_action.yml deleted file mode 100644 index 7633424a..00000000 --- a/.github/workflows/pull_request_action.yml +++ /dev/null @@ -1,23 +0,0 @@ -name: Build on PR - -on: - pull_request: - branches: [main] - -jobs: - build: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v2 - - - name: Use Node.js - uses: actions/setup-node@v1 - with: - node-version: '16' - - - name: Install dependencies - run: yarn install - - - name: Build - run: yarn build diff --git a/src/components/Home/NoticeFunSystem/NoticeFunSystem.styles.tsx b/src/components/Home/NoticeFunSystem/NoticeFunSystem.styles.tsx index 1210b506..be6a2ea8 100644 --- a/src/components/Home/NoticeFunSystem/NoticeFunSystem.styles.tsx +++ b/src/components/Home/NoticeFunSystem/NoticeFunSystem.styles.tsx @@ -1,71 +1,70 @@ import styled from '@emotion/styled'; import { TEXT_STYLES } from '@/styles/constants/textStyles'; export const SummaryBox = styled.div` - width : 100%; - heigth : 264px; - padding : 16px 24px; - background: #FFFFFF; + width: 100%; + height: 264px; + padding: 16px 24px; + background: #ffffff; `; export const TopBox = styled.div` - display : flex; + display: flex; justify-content: space-between; `; export const Title = styled.div` ${TEXT_STYLES.HeadM20}; - left : 0px; - + left: 0px; `; export const MoreButton = styled.div` ${TEXT_STYLES.CapR14}; - color : #6E6E6E; - margin-top : 4px; - display : flex; - align-items : center; + color: #6e6e6e; + margin-top: 4px; + display: flex; + align-items: center; `; export const TextBox = styled.div` box-sizing: border-box; position: relative; width: 100%; - height : 170px; - margin-top : 16px; - background: #FFFFFF; - border: 1px solid #D9D9D9; + height: 170px; + margin-top: 16px; + background: #ffffff; + border: 1px solid #d9d9d9; box-shadow: 4px 4px 10px rgba(0, 0, 0, 0.05); border-radius: 15px; `; -export const Line = styled.div<{top : string}>` - width : 100%; - height : 1px; - top : ${(props)=> props.top}; - position : absolute; - background-color : #D9D9D9; +export const Line = styled.div<{ top: string }>` + width: 100%; + height: 1px; + top: ${(props) => props.top}; + position: absolute; + background-color: #d9d9d9; `; -export const TextLine = styled.div<{top : string}>` - display : flex; - width : 100%; - position : absolute; +export const TextLine = styled.div<{ top: string }>` + display: flex; + width: 100%; + position: absolute; // margin : 0px 12px; - top : ${(props)=> props.top}; - box-sizing : border-box; + top: ${(props) => props.top}; + box-sizing: border-box; `; export const TextSummary = styled.div` ${TEXT_STYLES.BodyM16}; - white-space : nowrap; - overflow : hidden; - display : auto; - text-overflow : ellipsis; - padding-right : 50px; + white-space: nowrap; + overflow: hidden; + display: auto; + text-overflow: ellipsis; + padding-right: 50px; padding-left: 12px; `; export const Date = styled.div` ${TEXT_STYLES.CapR14}; - color : #6E6E6E; - position : absolute; - right : 12px; -`; \ No newline at end of file + color: #6e6e6e; + position: absolute; + right: 12px; +`; diff --git a/src/components/Home/NoticeFunSystem/NoticeFunSystem.tsx b/src/components/Home/NoticeFunSystem/NoticeFunSystem.tsx index 3a5f7b9a..15f23479 100644 --- a/src/components/Home/NoticeFunSystem/NoticeFunSystem.tsx +++ b/src/components/Home/NoticeFunSystem/NoticeFunSystem.tsx @@ -2,6 +2,7 @@ import { useState } from 'react'; import * as styles from './NoticeFunSystem.styles'; import RightArrow from '@icons/icon/Arrow/RightSmallArrow.svg'; import Image from 'next/image'; +import { useRouter } from 'next/router'; export interface SummaryText { id: number; @@ -17,11 +18,21 @@ export interface NoticeFunSystemProps { } const NoticeFunSystem = (props: NoticeFunSystemProps) => { + const router = useRouter(); + + function handleOnClickMore() { + if (props.title === '공지사항') { + router.push('/notice'); + } else { + router.push('/funsystem'); + } + } + return ( {props.title} - + 더보기 right arrow diff --git a/src/components/Home/NoticeFunSystemTab/LineSearchBar/LineSearchBar.styles.ts b/src/components/Home/NoticeFunSystemTab/LineSearchBar/LineSearchBar.styles.ts index ca49de15..3a6a37cb 100644 --- a/src/components/Home/NoticeFunSystemTab/LineSearchBar/LineSearchBar.styles.ts +++ b/src/components/Home/NoticeFunSystemTab/LineSearchBar/LineSearchBar.styles.ts @@ -1,15 +1,15 @@ import styled from '@emotion/styled'; import Image from 'next/image'; import { TEXT_STYLES } from '@/styles/constants/textStyles'; -import {COLORS} from '@/styles/constants/colors'; +import { COLORS } from '@/styles/constants/colors'; export const SearchBarBox = styled.div` - width : 100%; - height :56px; - padding-left : 16px; - padding-right : 16px; - padding-bottom : 8px; - box-sizing : border-box; + width: 100%; + height: 56px; + padding-left: 16px; + padding-right: 16px; + padding-bottom: 8px; + box-sizing: border-box; background: ${COLORS.grayscale.white}; `; @@ -26,6 +26,8 @@ export const Input = styled.input` border: none; outline: none; ${TEXT_STYLES.BodyM16}; + background-color: white; + color: ${COLORS.grayscale.Black}; `; export const GlassImage = styled(Image)` @@ -33,10 +35,10 @@ export const GlassImage = styled(Image)` `; export const Circle = styled.div` margin-right: 15px; - width : 18px; - height : 18px; - border-radius : 50%; - background-color : ${COLORS.grayscale.Gray3}; + width: 18px; + height: 18px; + border-radius: 50%; + background-color: ${COLORS.grayscale.Gray3}; `; export const CancelImage = styled(Image)` filter: brightness(0) invert(1); diff --git a/src/components/Home/NoticeFunSystemTab/LineSearchBar/LineSearchBar.tsx b/src/components/Home/NoticeFunSystemTab/LineSearchBar/LineSearchBar.tsx index 4475054d..46ac8f00 100644 --- a/src/components/Home/NoticeFunSystemTab/LineSearchBar/LineSearchBar.tsx +++ b/src/components/Home/NoticeFunSystemTab/LineSearchBar/LineSearchBar.tsx @@ -3,7 +3,11 @@ import * as styles from './LineSearchBar.styles'; import searchicon from '@icons/icon/Search/BlueSearch.svg'; import cancelicon from '@icons/icon/SubscribeList/Cancel.svg'; -const LineSearchBar = ({onSearch}:{onSearch : (searchText:string)=>void}) => { +const LineSearchBar = ({ + onSearch, +}: { + onSearch: (searchText: string) => void; +}) => { const [searchText, setSearchText] = useState(''); const handleOnKeyPress = (e: KeyboardEvent) => { @@ -15,7 +19,7 @@ const LineSearchBar = ({onSearch}:{onSearch : (searchText:string)=>void}) => { const handleClearSearch = () => { setSearchText(''); }; - const handleSearch = () =>{ + const handleSearch = () => { onSearch(searchText); }; @@ -30,18 +34,23 @@ const LineSearchBar = ({onSearch}:{onSearch : (searchText:string)=>void}) => { onChange={(e) => setSearchText(e.target.value)} /> - + - - + width={24} + height={24} + alt={''} + onClick={handleSearch} + /> - ); }; diff --git a/src/components/Home/NoticeFunSystemTab/NoticeFunSystemTab.tsx b/src/components/Home/NoticeFunSystemTab/NoticeFunSystemTab.tsx index 2c71d100..8147e0af 100644 --- a/src/components/Home/NoticeFunSystemTab/NoticeFunSystemTab.tsx +++ b/src/components/Home/NoticeFunSystemTab/NoticeFunSystemTab.tsx @@ -5,20 +5,17 @@ import LineSearchBar from './LineSearchBar/LineSearchBar'; import CommunityList from '@/components/community/list/CommunityList'; import FunSystemList from '@/components/notice/FunSystemList'; - const NoticeFunSystemTab = () => { - - const [index, setIndex] = useState(0); - const [search, setSearch] = useState(""); + const [search, setSearch] = useState(''); - useEffect(()=>{ + useEffect(() => { window.location.reload; }, [index, search]); - const handleSearch = (searchText : string) =>{ + const handleSearch = (searchText: string) => { setSearch(searchText); - } + }; const selectMenuHandler = (n: number) => { setIndex(n); @@ -26,29 +23,35 @@ const NoticeFunSystemTab = () => { return ( <> - - {search && - - {["공지사항", "펀시스템","커뮤니티"].map((element, idx) => ( - selectMenuHandler(idx)}> - {element} - - ))} - - {index === 0 ? ( - - ) : index === 1 ?( - - ) : ( - - )} - } - + + {search && ( + + + {['공지사항', '펀시스템', '커뮤니티'].map((element, idx) => ( + selectMenuHandler(idx)} + > + {element} + + ))} + + {index === 0 ? ( + + ) : index === 1 ? ( + + ) : ( + + )} + + )} ); }; -export default NoticeFunSystemTab; \ No newline at end of file +export default NoticeFunSystemTab; diff --git a/src/components/Home/PopularPosts/PopularPosts.stories.tsx b/src/components/Home/PopularPosts/PopularPosts.stories.tsx index 557fb9c7..228aae01 100644 --- a/src/components/Home/PopularPosts/PopularPosts.stories.tsx +++ b/src/components/Home/PopularPosts/PopularPosts.stories.tsx @@ -17,18 +17,18 @@ export const PopularPostsExample: Story = { id: 1, title: '제목', content: '내용', - type: 'info', + topic: 'info', commentCount: 3, - createdAt: '2021-10-10 10:10:10', + updatedAt: '2021-10-10 10:10:10', }, { id: 2, title: '제목', content: '내용나더라너라더라더ㅏㄹ날냗런댜ㅓㄹ자ㅡ라즈ㅏ냐나더라ㅣ너ㅣㅏ러니ㅏ더리ㅏㄷ너ㅣㅏ럳니ㅏㅓ릳너ㅣㅏ러ㅏ디너리ㅏㄴ더ㅏㅣ러ㅏㅣㄴ더ㅣㅏ러니다러ㅏ니ㅓㅏ더러쟈러다란르ㅏㄴㄷ르ㅏㅡ', - type: 'info', + topic: 'info', commentCount: 5, - createdAt: '2021-10-10 20:10:10', + updatedAt: '2021-10-10 20:10:10', }, ], }, diff --git a/src/components/Home/PopularPosts/PopularPosts.styles.ts b/src/components/Home/PopularPosts/PopularPosts.styles.ts index 1c86c395..6bbb2093 100644 --- a/src/components/Home/PopularPosts/PopularPosts.styles.ts +++ b/src/components/Home/PopularPosts/PopularPosts.styles.ts @@ -7,7 +7,7 @@ export const Container = styled.div` display: flex; background-color: ${COLORS.grayscale.Gray5}; flex-direction: column; - padding: 20px; + padding: 16px 24px; `; export const RowSpacer = styled.div` diff --git a/src/components/Home/PopularPosts/PopularPosts.tsx b/src/components/Home/PopularPosts/PopularPosts.tsx index e7078bb2..ff40b177 100644 --- a/src/components/Home/PopularPosts/PopularPosts.tsx +++ b/src/components/Home/PopularPosts/PopularPosts.tsx @@ -9,17 +9,21 @@ export interface PostDetailProps { id: number; title: string; content: string; - type: 'info' | 'question' | 'free'; + topic: string; commentCount: number; - createdAt: string; + updatedAt: string; } const PopularPosts = ({ posts }: { posts: PostDetailProps[] }) => { + const router = useRouter(); + const handleOnClickMore = () => { + router.push('/community'); + }; return ( 인기 게시글 - + 더보기{' '} { id={post.id} title={post.title} content={post.content} - type={post.type} + topic={post.topic} commentCount={post.commentCount} - createdAt={post.createdAt} + updatedAt={post.updatedAt} key={post.id} /> ))} @@ -50,21 +54,12 @@ const PostDetail = ({ id, title, content, - type, + topic, commentCount, - createdAt, + updatedAt, }: PostDetailProps) => { const router = useRouter(); - let typeTrans = ''; - if (type === 'info') { - typeTrans = '정보'; - } else if (type === 'question') { - typeTrans = '질문'; - } else { - typeTrans = '자유'; - } - function onClick() { //TODO 실제 게시글로 이동 router.push(`/post/${id}`); @@ -74,10 +69,10 @@ const PostDetail = ({ - {typeTrans} + {topic} {title} - {beforeTime(createdAt)} + {beforeTime(updatedAt)} {content} diff --git a/src/components/common/Header/Header.tsx b/src/components/common/Header/Header.tsx index a62e4bbe..8cf36787 100644 --- a/src/components/common/Header/Header.tsx +++ b/src/components/common/Header/Header.tsx @@ -2,29 +2,63 @@ import * as styles from './Header.style'; import SearchIcon from '@icons/icon/header/search.svg'; import AlarmIcon from '@icons/icon/header/alarm.svg'; import Image from 'next/image'; -import { useState } from 'react'; -import LineSearchBar from '@/components/Home/NoticeFunSystemTab/LineSearchBar/LineSearchBar'; +import { useEffect, useState } from 'react'; import NoticeFunSystemTab from '@/components/Home/NoticeFunSystemTab/NoticeFunSystemTab'; +import { useRouter } from 'next/router'; + const Header = () => { + const router = useRouter(); + const [isHeaderVisible, setIsHeaderVisible] = useState(true); const [isSearchVisible, setIsSearchVisible] = useState(false); - const handleSearchIconClick=()=>{ - setIsSearchVisible((prev)=> !prev); - } + + const handleSearchIconClick = () => { + setIsSearchVisible((prev) => !prev); + }; + + const handleLogoClick = () => { + router.push('/'); + }; + + const handleAlarmIconClick = () => { + router.push('/alarm'); + }; + + useEffect(() => { + const path = router.pathname; + if (['/login', '/landing'].includes(path)) { + setIsHeaderVisible(false); + } else { + setIsHeaderVisible(true); + } + }, [router.pathname]); return ( <> - - DAITSSU - - search - alarm - - - {isSearchVisible && } + {isHeaderVisible && ( + <> + + DAITSSU + + search + {/* 알림 기능 완성까지 보류 */} + {/* alarm */} + + + {isSearchVisible && } + + )} ); }; diff --git a/src/components/common/Navbar/Navigation.ts b/src/components/common/Navbar/Navigation.ts index 4226e211..2207484d 100644 --- a/src/components/common/Navbar/Navigation.ts +++ b/src/components/common/Navbar/Navigation.ts @@ -8,7 +8,7 @@ export const NAV_LIST = { export const NAV_URL_LIST = { [NAV_LIST.HOME]: '/', - [NAV_LIST.ANNOUNCEMENT]: '/announcement', + [NAV_LIST.ANNOUNCEMENT]: '/notice', [NAV_LIST.COMMUNITY]: '/community', [NAV_LIST.CALENDAR]: '/calendar', [NAV_LIST.MY_PAGE]: '/myPage', diff --git a/src/components/landing/index.tsx b/src/components/landing/index.tsx index 13fd4ade..83802e20 100644 --- a/src/components/landing/index.tsx +++ b/src/components/landing/index.tsx @@ -18,7 +18,6 @@ const Landing = () => { /> - ); }; diff --git a/src/components/main/index.tsx b/src/components/main/index.tsx index 9a43d5bc..2ea33609 100644 --- a/src/components/main/index.tsx +++ b/src/components/main/index.tsx @@ -19,15 +19,30 @@ const Main = () => { const funSystemResponse = getFunsystem(); popularArticleResponse.then((data) => { - setPosts(data.data); + const result: PostDetailProps[] = data.data; + if (result.length > 3) { + setPosts(result.slice(0, 3)); + } else { + setPosts(result); + } }); noticeResponse.then((data) => { - setNoticeList(data.data.content); + const result: SummaryText[] = data.data.notices; + if (result.length > 3) { + setNoticeList(result.slice(0, 3)); + } else { + setNoticeList(result); + } }); funSystemResponse.then((data) => { - setFunSystemList(data.data.content); + const result: SummaryText[] = data.data.funSystems; + if (result.length > 3) { + setFunSystemList(result.slice(0, 3)); + } else { + setFunSystemList(result); + } }); }, []); diff --git a/src/hooks/useNavbar.ts b/src/hooks/useNavbar.ts index cc8bd634..c41ff373 100644 --- a/src/hooks/useNavbar.ts +++ b/src/hooks/useNavbar.ts @@ -4,7 +4,7 @@ import { useState, useEffect } from 'react'; 미로그인시 랜딩페이지에서 스크롤 위치에 따라 하단 네비게이션바를 렌더링 여부를 return하는 hook */ const useNavbar = () => { - const [isLogin, setIsLogin] = useState(false); //TODO: 추후 전역 상태에서 가져옴 + const [isLogin, setIsLogin] = useState(true); //TODO: 추후 전역 상태에서 가져옴 const [renderNavbar, setRenderNavbar] = useState(false); function onScroll() { diff --git a/src/pages/index.page.tsx b/src/pages/index.page.tsx index a44e672f..88b1c490 100644 --- a/src/pages/index.page.tsx +++ b/src/pages/index.page.tsx @@ -5,7 +5,6 @@ import { userNavAtom, IUserNavAtom } from '@/states/userNavAtom'; import { NAV_LIST } from '@/components/common/Navbar/Navigation'; import '../styles/Home.module.css'; import Main from '@/components/main'; -import Landing from '@/components/landing'; const MainPage = () => { const setNavAtom = useSetRecoilState(userNavAtom); @@ -13,9 +12,6 @@ const MainPage = () => { activeNavType: NAV_LIST.HOME, }; - //TODO: 추후 전역 상태로 관리 - const [isLogin, setIsLogin] = useState(false); - //mobile height size 설정 useEffect(() => { const vh = window.innerHeight * 0.01; @@ -27,21 +23,10 @@ const MainPage = () => { }); }, []); - if (isLogin) { - return ( - -
- - ); - } else { - return ( - <> - - -
- - - ); - } + return ( + +
+ + ); }; export default MainPage; diff --git a/src/pages/landing/index.page.tsx b/src/pages/landing/index.page.tsx new file mode 100644 index 00000000..7d13995b --- /dev/null +++ b/src/pages/landing/index.page.tsx @@ -0,0 +1,9 @@ +import Landing from '@/components/landing'; + +export default function Home() { + return ( + <> + + + ); +} diff --git a/src/pages/layout/index.tsx b/src/pages/layout/index.tsx index fc9a3fc4..f0f02e74 100644 --- a/src/pages/layout/index.tsx +++ b/src/pages/layout/index.tsx @@ -1,6 +1,5 @@ -import Header from '@/components/common/Header/Header'; import { userNavAtom } from '@/states/userNavAtom'; -import { PropsWithChildren } from 'react'; +import { PropsWithChildren, useEffect, useState } from 'react'; import { useRecoilValue } from 'recoil'; import { Outlet } from 'react-router-dom'; import * as styles from './layout.style'; @@ -11,10 +10,24 @@ const MainLayout = ({ children }: PropsWithChildren<{}>) => { const activeNavType = useRecoilValue(userNavAtom).activeNavType; const { renderNavbar } = useNavbar(); + const [isShow, setIsShow] = useState(false); + + useEffect(() => { + const currentPageUrl = window.location.href; + if ( + currentPageUrl.includes('landing') || + currentPageUrl.includes('login') + ) { + setIsShow(false); + } else { + setIsShow(true); + } + }, []); return ( <> {children || } + {/* {isShow &&
} */} diff --git a/src/pages/login/index.page.tsx b/src/pages/login/index.page.tsx index 4ba569a5..5d00f30e 100644 --- a/src/pages/login/index.page.tsx +++ b/src/pages/login/index.page.tsx @@ -1,5 +1,11 @@ +import UtilityHeader from '@/components/common/Header/UtilityHeader'; import LoginLayout from '@/components/login/LoginLayout/LoginLayout'; export default function Login() { - return ; + return ( + <> + + + + ); } From e016420490e468dc8274c404be1d0258591e35c3 Mon Sep 17 00:00:00 2001 From: SuJin Date: Fri, 5 Jan 2024 11:46:07 +0900 Subject: [PATCH 07/17] =?UTF-8?q?style:=20=EB=B9=A0=EC=A7=84=20=EA=B8=80?= =?UTF-8?q?=EC=9E=90=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/community/info/CommunityInfo.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/community/info/CommunityInfo.tsx b/src/components/community/info/CommunityInfo.tsx index f2cfc684..d6e9add8 100644 --- a/src/components/community/info/CommunityInfo.tsx +++ b/src/components/community/info/CommunityInfo.tsx @@ -99,7 +99,7 @@ const CommunityInfo = () => { priority /> - {data?.views} + {data?.views}회 From 2312306ae6b25475f6b3cd3ad22500c335173f77 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=EC=A0=95=EC=9A=B0?= Date: Mon, 8 Jan 2024 21:44:20 +0900 Subject: [PATCH 08/17] =?UTF-8?q?[#164]=20=EB=A0=88=EC=9D=B4=EC=95=84?= =?UTF-8?q?=EC=9B=83=20=EA=B4=80=EB=A0=A8=20=EC=8A=A4=ED=83=80=EC=9D=BC=20?= =?UTF-8?q?=EC=88=98=EC=A0=95=20(#165)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * style: global.css body 요소에 height 설정, padding 추가(네비게이션바 100px) * style: 랜딩 페이지 배경 이미지 position:fixed로 변경 * fix: 랜딩 페이지에서 헤더 미노출 로직 추가 --- src/components/common/Header/Header.tsx | 7 +++++++ src/components/landing/Landing.styles.ts | 2 +- src/styles/globals.css | 2 ++ 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/components/common/Header/Header.tsx b/src/components/common/Header/Header.tsx index 8cf36787..5ca82c96 100644 --- a/src/components/common/Header/Header.tsx +++ b/src/components/common/Header/Header.tsx @@ -11,6 +11,9 @@ const Header = () => { const [isHeaderVisible, setIsHeaderVisible] = useState(true); const [isSearchVisible, setIsSearchVisible] = useState(false); + //TOOD: recoil 전역상태로 수정 + const [isLogin, setIsLogin] = useState(false); + const handleSearchIconClick = () => { setIsSearchVisible((prev) => !prev); }; @@ -30,6 +33,10 @@ const Header = () => { } else { setIsHeaderVisible(true); } + //첫 랜딩 페이지 & 미로그인시 헤더 안보이게 + if (path == '/' && !isLogin) { + setIsHeaderVisible(false); + } }, [router.pathname]); return ( diff --git a/src/components/landing/Landing.styles.ts b/src/components/landing/Landing.styles.ts index 0842a11d..b4021cc9 100644 --- a/src/components/landing/Landing.styles.ts +++ b/src/components/landing/Landing.styles.ts @@ -3,5 +3,5 @@ import styled from '@emotion/styled'; export const LandingLayout = styled.div` width: 100vw; height: 100vh; - position: relative; + position: fixed; `; diff --git a/src/styles/globals.css b/src/styles/globals.css index 854dd0a1..1eeb5037 100644 --- a/src/styles/globals.css +++ b/src/styles/globals.css @@ -86,6 +86,8 @@ body { } body { + height: 100vh; + padding-bottom: 100px; color: rgb(var(--foreground-rgb)); background: linear-gradient( to bottom, From 216f4b87c4747ee85af82dc7fddfdbd2da572a67 Mon Sep 17 00:00:00 2001 From: SuJin Date: Mon, 1 Jan 2024 14:58:56 +0900 Subject: [PATCH 09/17] =?UTF-8?q?feat:=20=EC=83=81=EC=84=B8=EC=A0=95?= =?UTF-8?q?=EB=B3=B4=20api=20=EC=97=B0=EA=B2=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../community/info/CommunityInfo.tsx | 47 ++++++++++++------- .../{info/index.page.tsx => [id].page.tsx} | 0 src/types/Community.ts | 16 +++++++ 3 files changed, 47 insertions(+), 16 deletions(-) rename src/pages/community/{info/index.page.tsx => [id].page.tsx} (100%) create mode 100644 src/types/Community.ts diff --git a/src/components/community/info/CommunityInfo.tsx b/src/components/community/info/CommunityInfo.tsx index 3afb1078..2c4b65d3 100644 --- a/src/components/community/info/CommunityInfo.tsx +++ b/src/components/community/info/CommunityInfo.tsx @@ -4,8 +4,6 @@ import Image from 'next/image'; import Comment from '@/components/common/Comment'; import CommentInput from '@/components/common/Comment/CommentInput'; import Category from '@/components/common/Category'; -import Sue from '@icons/icon/Icon18/Sue.svg'; -import Ben from '@icons/icon/Icon18/Ben.svg'; import SamllHits from '@icons/icon/Icon18/SmallHits.svg'; import FilledLiked from '@icons/icon/Liked/FilledLiked.svg'; import DefaultLiked from '@icons/icon/Liked/DefaultLiked.svg'; @@ -17,9 +15,11 @@ import { getCommunityInfoCommentAPI, } from '@/apis/communityAPIS'; import { useRouter } from 'next/router'; -import { Comments, NoticeInfoProps } from '@/types/NoticeFunsystem'; +import { Comments } from '@/types/NoticeFunsystem'; import UtilityHeader from '@/components/common/Header/UtilityHeader'; +import { CommunityInfoProps } from '@/types/Community'; const CommunityInfo = () => { + const [data, setData] = useState(); const [comments, setComments] = useState(); const [isLike, setIsLike] = useState(false); const [isScrap, setIsScrap] = useState(false); @@ -36,11 +36,29 @@ const CommunityInfo = () => { setIsScrap(!isScrap); }; + // 현재 주소 값 + const router = useRouter(); + const path = router.asPath; + const pathId = router.query.id; + + useEffect(() => { + // 공지사항 API 연결 + const getCommunityInfo = getCommunityInfoAPI(Number(pathId)); + getCommunityInfo.then((res) => { + setData(res.data); + }); + + const getcomments = getCommunityInfoCommentAPI(Number(pathId)); + getcomments.then((res) => { + setComments(res?.data); + }); + }, []); + return ( - + @@ -55,11 +73,11 @@ const CommunityInfo = () => { - 닉네임 + {data?.writerNickName} - 2023/05/20 - 21:23 + {data?.updatedAt.slice(0, 10)} + {data?.updatedAt.slice(11, 16)} @@ -71,17 +89,14 @@ const CommunityInfo = () => { priority /> - 5회 + {data?.views} - 이거 어떻게 하는 거예요 - - 엄청나게 잘해서 A+를 받겠어~ 엄청나게 잘해서 A+를 받겠어~ 종강아 - 어서와 - + {data?.title} + {data?.content} @@ -104,7 +119,7 @@ const CommunityInfo = () => { )} {/** TODO: 눌렀을때 모양 변경 */} - 5 + {data?.likes} @@ -116,7 +131,7 @@ const CommunityInfo = () => { priority /> - 5 + {data?.comments} @@ -138,7 +153,7 @@ const CommunityInfo = () => { /> )} - 0 + {data?.scrapCount} diff --git a/src/pages/community/info/index.page.tsx b/src/pages/community/[id].page.tsx similarity index 100% rename from src/pages/community/info/index.page.tsx rename to src/pages/community/[id].page.tsx diff --git a/src/types/Community.ts b/src/types/Community.ts new file mode 100644 index 00000000..ff512da2 --- /dev/null +++ b/src/types/Community.ts @@ -0,0 +1,16 @@ +export interface CommunityInfoProps { + id: number; + title: string; + content: string; + category: string; + imageUrls: string[]; + fileUrl: string; + createdAt: string; + updatedAt: string; + views: number; + comments: number; + likes: number; + scrapCount: number; + topic: string; + writerNickName: string; +} From a9a836b21895c8fb3992df194f85eb589bc705b5 Mon Sep 17 00:00:00 2001 From: SuJin Date: Tue, 2 Jan 2024 19:08:19 +0900 Subject: [PATCH 10/17] =?UTF-8?q?feat:=20=EC=A2=8B=EC=95=84=EC=9A=94,=20?= =?UTF-8?q?=EC=8A=A4=ED=81=AC=EB=9E=A9=20api=20=EC=97=B0=EA=B2=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/apis/communityAPIS.ts | 44 +++++++++++++++++++ .../community/info/CommunityInfo.tsx | 22 +++++++--- 2 files changed, 60 insertions(+), 6 deletions(-) diff --git a/src/apis/communityAPIS.ts b/src/apis/communityAPIS.ts index 20f22d53..e9cfc02f 100644 --- a/src/apis/communityAPIS.ts +++ b/src/apis/communityAPIS.ts @@ -60,3 +60,47 @@ export const getCommunityInfoCommentAPI = async (articleID: number) => { return null; } }; + +export const postCommunityScrapAPI = async ( + articleID: number, + isActive: boolean, +) => { + try { + const response = await axiosInstance.post( + `/community/article/${articleID}/scrap?isActive=${isActive}`, + ); + return response.data; + } catch (error) { + if (axios.isAxiosError(error)) { + console.log(error.response?.data); + } + return null; + } +}; + +export const postCommunityLikeAPI = async (articleID: number) => { + try { + const response = await axiosInstance.post( + `/community/article/${articleID}/like`, + ); + return response.data; + } catch (error) { + if (axios.isAxiosError(error)) { + console.log(error.response?.data); + } + return null; + } +}; +export const postCommunityDislikeAPI = async (articleID: number) => { + try { + const response = await axiosInstance.post( + `/community/article/${articleID}/dislike`, + ); + return response.data; + } catch (error) { + if (axios.isAxiosError(error)) { + console.log(error.response?.data); + } + return null; + } +}; diff --git a/src/components/community/info/CommunityInfo.tsx b/src/components/community/info/CommunityInfo.tsx index 2c4b65d3..260a31d1 100644 --- a/src/components/community/info/CommunityInfo.tsx +++ b/src/components/community/info/CommunityInfo.tsx @@ -13,6 +13,9 @@ import DefaultScrap from '@icons/icon/Scrap/DefaultScrap.svg'; import { getCommunityInfoAPI, getCommunityInfoCommentAPI, + postCommunityDislikeAPI, + postCommunityLikeAPI, + postCommunityScrapAPI, } from '@/apis/communityAPIS'; import { useRouter } from 'next/router'; import { Comments } from '@/types/NoticeFunsystem'; @@ -28,21 +31,28 @@ const CommunityInfo = () => { setMenu(!menu); }; + // 현재 주소 값 + const router = useRouter(); + const path = router.asPath; + const pathId = router.query.id; + const handleLikeClick = () => { setIsLike(!isLike); + if (!isLike) { + postCommunityLikeAPI(Number(pathId)); + } else { + postCommunityDislikeAPI(Number(pathId)); + } }; const handleScrapClick = () => { setIsScrap(!isScrap); + if (!isScrap) { + postCommunityScrapAPI(Number(pathId), !isScrap); + } }; - // 현재 주소 값 - const router = useRouter(); - const path = router.asPath; - const pathId = router.query.id; - useEffect(() => { - // 공지사항 API 연결 const getCommunityInfo = getCommunityInfoAPI(Number(pathId)); getCommunityInfo.then((res) => { setData(res.data); From 14550c5d525e099acb71a3198cc125e240bffc79 Mon Sep 17 00:00:00 2001 From: SuJin Date: Tue, 2 Jan 2024 19:08:29 +0900 Subject: [PATCH 11/17] =?UTF-8?q?feat:=20=EB=8C=93=EA=B8=80=20api=20?= =?UTF-8?q?=EC=97=B0=EA=B2=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/community/info/CommunityInfo.tsx | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/components/community/info/CommunityInfo.tsx b/src/components/community/info/CommunityInfo.tsx index 260a31d1..f2cfc684 100644 --- a/src/components/community/info/CommunityInfo.tsx +++ b/src/components/community/info/CommunityInfo.tsx @@ -170,6 +170,20 @@ const CommunityInfo = () => { 댓글 + {comments?.map((comment) => { + return ( + + ); + })} From 02ee8da48f76349f65b62e223b338b940e9dd94d Mon Sep 17 00:00:00 2001 From: SuJin Date: Tue, 2 Jan 2024 19:38:23 +0900 Subject: [PATCH 12/17] =?UTF-8?q?style:=20=EB=B0=98=EC=9D=91=ED=98=95?= =?UTF-8?q?=EC=9C=BC=EB=A1=9C=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/community/info/CommunityInfo.style.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/components/community/info/CommunityInfo.style.ts b/src/components/community/info/CommunityInfo.style.ts index d001ff6e..244e8715 100644 --- a/src/components/community/info/CommunityInfo.style.ts +++ b/src/components/community/info/CommunityInfo.style.ts @@ -3,7 +3,7 @@ import { TEXT_STYLES } from '@/styles/constants/textStyles'; import { COLORS } from '@/styles/constants/colors'; export const Container = styled.div` - width: 390px; + width: 100%; `; export const Padding = styled.div` @@ -88,7 +88,7 @@ export const ProfileCenterBox = styled.div` display: flex; flex-direction: column; margin: auto 0; - width: 345px; + width: 100%; `; export const ProfileRightBox = styled.div` @@ -109,6 +109,7 @@ export const ProfileBottomBox = styled.div` display: flex; height: 24px; align-items: center; + width: 100%; `; export const DateBox = styled.div` @@ -151,6 +152,7 @@ export const TitleBox = styled.div` export const ContentBox = styled.div` margin-bottom: 15px; ${TEXT_STYLES.BodyR16} + word-break: break-all; `; export const UnderBarBox = styled.div` From 6c60f177b82441ee5815867523ded92d549cd3a7 Mon Sep 17 00:00:00 2001 From: SuJin Date: Tue, 2 Jan 2024 19:38:42 +0900 Subject: [PATCH 13/17] =?UTF-8?q?style:=20=EB=B0=B0=EA=B2=BD=20=ED=9D=B0?= =?UTF-8?q?=EC=83=89=EC=9C=BC=EB=A1=9C=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/community/info/CommunityInfo.style.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/components/community/info/CommunityInfo.style.ts b/src/components/community/info/CommunityInfo.style.ts index 244e8715..0b97d847 100644 --- a/src/components/community/info/CommunityInfo.style.ts +++ b/src/components/community/info/CommunityInfo.style.ts @@ -4,6 +4,8 @@ import { COLORS } from '@/styles/constants/colors'; export const Container = styled.div` width: 100%; + height: 100vh; + background-color: white; `; export const Padding = styled.div` From f4bc423cb3ac0eed0c8b17d0b6dfaf0515fb3d91 Mon Sep 17 00:00:00 2001 From: SuJin Date: Fri, 5 Jan 2024 11:46:07 +0900 Subject: [PATCH 14/17] =?UTF-8?q?style:=20=EB=B9=A0=EC=A7=84=20=EA=B8=80?= =?UTF-8?q?=EC=9E=90=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/community/info/CommunityInfo.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/community/info/CommunityInfo.tsx b/src/components/community/info/CommunityInfo.tsx index f2cfc684..d6e9add8 100644 --- a/src/components/community/info/CommunityInfo.tsx +++ b/src/components/community/info/CommunityInfo.tsx @@ -99,7 +99,7 @@ const CommunityInfo = () => { priority /> - {data?.views} + {data?.views}회 From e465b9481ae44690a5d3b65ccf7abe42c83150ef Mon Sep 17 00:00:00 2001 From: SuJin Date: Mon, 15 Jan 2024 13:44:06 +0900 Subject: [PATCH 15/17] =?UTF-8?q?chore:=20console=20=EC=82=AD=EC=A0=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/apis/communityAPIS.ts | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/src/apis/communityAPIS.ts b/src/apis/communityAPIS.ts index e9cfc02f..b6d8c571 100644 --- a/src/apis/communityAPIS.ts +++ b/src/apis/communityAPIS.ts @@ -28,9 +28,6 @@ export const getCommunityItemAPI = async ( return response.data; } } catch (error) { - if (axios.isAxiosError(error)) { - console.log(error.response?.data); - } return null; } }; @@ -40,9 +37,6 @@ export const getCommunityInfoAPI = async (articleID: number) => { const response = await axiosInstance.get(`/community/article/${articleID}`); return response.data; } catch (error) { - if (axios.isAxiosError(error)) { - console.log(error.response?.data); - } return null; } }; @@ -54,9 +48,6 @@ export const getCommunityInfoCommentAPI = async (articleID: number) => { ); return response.data; } catch (error) { - if (axios.isAxiosError(error)) { - console.log(error.response?.data); - } return null; } }; @@ -71,9 +62,6 @@ export const postCommunityScrapAPI = async ( ); return response.data; } catch (error) { - if (axios.isAxiosError(error)) { - console.log(error.response?.data); - } return null; } }; @@ -85,9 +73,6 @@ export const postCommunityLikeAPI = async (articleID: number) => { ); return response.data; } catch (error) { - if (axios.isAxiosError(error)) { - console.log(error.response?.data); - } return null; } }; @@ -98,9 +83,6 @@ export const postCommunityDislikeAPI = async (articleID: number) => { ); return response.data; } catch (error) { - if (axios.isAxiosError(error)) { - console.log(error.response?.data); - } return null; } }; From 7d2514bd0d9a73cb0aa5b199cbe18a7ce903138b Mon Sep 17 00:00:00 2001 From: SuJin Date: Fri, 26 Jan 2024 13:11:01 +0900 Subject: [PATCH 16/17] =?UTF-8?q?feat:=20=EB=8C=93=EA=B8=80=EC=97=90=20?= =?UTF-8?q?=EB=8B=89=EB=84=A4=EC=9E=84=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 3 ++- src/components/community/info/CommunityInfo.tsx | 2 +- src/types/NoticeFunsystem.ts | 1 + 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index fef14e83..1470e9bc 100644 --- a/.gitignore +++ b/.gitignore @@ -39,4 +39,5 @@ next-env.d.ts .yarn/unplugged .yarn/build-state.yml .yarn/install-state.gz -.pnp.* \ No newline at end of file +.pnp.* +.env diff --git a/src/components/community/info/CommunityInfo.tsx b/src/components/community/info/CommunityInfo.tsx index d6e9add8..6523e452 100644 --- a/src/components/community/info/CommunityInfo.tsx +++ b/src/components/community/info/CommunityInfo.tsx @@ -174,7 +174,7 @@ const CommunityInfo = () => { return ( Date: Fri, 26 Jan 2024 13:24:06 +0900 Subject: [PATCH 17/17] =?UTF-8?q?style:=20=EB=8C=93=EA=B8=80=20=EB=94=94?= =?UTF-8?q?=EC=9E=90=EC=9D=B8=20=EB=B0=98=EC=9D=91=ED=98=95=EC=9C=BC?= =?UTF-8?q?=EB=A1=9C=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/common/Comment/Comment.style.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/common/Comment/Comment.style.ts b/src/components/common/Comment/Comment.style.ts index 2f8cd542..4b4cfdc3 100644 --- a/src/components/common/Comment/Comment.style.ts +++ b/src/components/common/Comment/Comment.style.ts @@ -13,7 +13,7 @@ export const CLeftBox = styled.div` `; export const CRightBox = styled.div` - width: 373px; + width: 90vw; margin-left: 17px; display: flex; flex-direction: column;