From b8ced1e341570475a11abaafa18fcaf519ef72f9 Mon Sep 17 00:00:00 2001 From: halfmoon-mind <5338095@gmail.com> Date: Thu, 28 Dec 2023 22:46:24 +0900 Subject: [PATCH 01/14] =?UTF-8?q?feat:=20Route=EC=97=90=20=EB=94=B0?= =?UTF-8?q?=EB=A5=B8=20header=20=EC=A1=B0=EA=B1=B4=20=EC=A7=80=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/common/Header/Header.tsx | 68 ++++++++++++++++++------- 1 file changed, 51 insertions(+), 17 deletions(-) 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 && } + + )} ); }; From c44378906c877080a43ef387e89d472be57a251a Mon Sep 17 00:00:00 2001 From: halfmoon-mind <5338095@gmail.com> Date: Thu, 28 Dec 2023 22:46:44 +0900 Subject: [PATCH 02/14] =?UTF-8?q?fix:=20=EB=B0=94=ED=85=80=EB=84=A4?= =?UTF-8?q?=EB=B9=84=EA=B2=8C=EC=9D=B4=EC=85=98=20announce=20->=20notice?= =?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/Navbar/Navigation.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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', From f280115eca6e40bd7063c9b9e5b888ab6fd3e414 Mon Sep 17 00:00:00 2001 From: halfmoon-mind <5338095@gmail.com> Date: Thu, 28 Dec 2023 22:47:15 +0900 Subject: [PATCH 03/14] =?UTF-8?q?refactor:=20style=20=EC=BD=94=EB=93=9C?= =?UTF-8?q?=EB=93=A4=20=EC=A0=95=EB=A0=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../NoticeFunSystem.styles.tsx | 71 +++++++++---------- .../LineSearchBar/LineSearchBar.styles.ts | 24 ++++--- .../Home/PopularPosts/PopularPosts.styles.ts | 2 +- 3 files changed, 49 insertions(+), 48 deletions(-) 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/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/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` From 5a2c5d12420d61b3cdf74b25ac6fc05dbe1f6883 Mon Sep 17 00:00:00 2001 From: halfmoon-mind <5338095@gmail.com> Date: Thu, 28 Dec 2023 22:48:53 +0900 Subject: [PATCH 04/14] =?UTF-8?q?feat:=20=EB=8D=94=EB=B3=B4=EA=B8=B0=20?= =?UTF-8?q?=ED=81=B4=EB=A6=AD=20=EB=9D=BC=EC=9A=B0=ED=8C=85=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Home/NoticeFunSystem/NoticeFunSystem.tsx | 13 ++++++++++++- src/components/Home/PopularPosts/PopularPosts.tsx | 6 +++++- 2 files changed, 17 insertions(+), 2 deletions(-) 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/PopularPosts/PopularPosts.tsx b/src/components/Home/PopularPosts/PopularPosts.tsx index e7078bb2..b7a7a6ce 100644 --- a/src/components/Home/PopularPosts/PopularPosts.tsx +++ b/src/components/Home/PopularPosts/PopularPosts.tsx @@ -15,11 +15,15 @@ export interface PostDetailProps { } const PopularPosts = ({ posts }: { posts: PostDetailProps[] }) => { + const router = useRouter(); + const handleOnClickMore = () => { + router.push('/community'); + }; return ( 인기 게시글 - + 더보기{' '} Date: Thu, 28 Dec 2023 22:49:08 +0900 Subject: [PATCH 05/14] =?UTF-8?q?feat:=20=EC=BD=94=EB=93=9C=20=EC=8A=A4?= =?UTF-8?q?=ED=83=80=EC=9D=BC=20=EC=97=85=EB=8D=B0=EC=9D=B4=ED=8A=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../LineSearchBar/LineSearchBar.tsx | 29 ++++++--- .../NoticeFunSystemTab/NoticeFunSystemTab.tsx | 61 ++++++++++--------- 2 files changed, 51 insertions(+), 39 deletions(-) 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; From 6e4609f90d91fa17581daeb195abf925d7b0acfe Mon Sep 17 00:00:00 2001 From: halfmoon-mind <5338095@gmail.com> Date: Thu, 28 Dec 2023 22:49:40 +0900 Subject: [PATCH 06/14] =?UTF-8?q?feat:=20=EC=8A=A4=ED=81=AC=EB=A1=A4=20?= =?UTF-8?q?=EC=BD=94=EB=93=9C=20=EC=82=AD=EC=A0=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/landing/index.tsx | 1 - src/pages/index.page.tsx | 21 ++++----------------- src/pages/landing/index.page.tsx | 9 +++++++++ 3 files changed, 13 insertions(+), 18 deletions(-) create mode 100644 src/pages/landing/index.page.tsx 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/pages/index.page.tsx b/src/pages/index.page.tsx index a44e672f..79bbd42a 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,12 @@ const MainPage = () => { }); }, []); - if (isLogin) { - return ( + return ( +
- ); - } else { - 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 ( + <> + + + ); +} From 956be6a4226626ae0d89cd991ae80c5919b562b2 Mon Sep 17 00:00:00 2001 From: halfmoon-mind <5338095@gmail.com> Date: Thu, 28 Dec 2023 22:50:01 +0900 Subject: [PATCH 07/14] =?UTF-8?q?feat:=20bottom=20nav=20bar=20true?= =?UTF-8?q?=EB=A1=9C=20=EC=84=A4=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/hooks/useNavbar.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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() { From 4144501c12e4145871b2e1e0877ef75db159b4fa Mon Sep 17 00:00:00 2001 From: halfmoon-mind <5338095@gmail.com> Date: Thu, 28 Dec 2023 22:50:14 +0900 Subject: [PATCH 08/14] =?UTF-8?q?feat:=20=EC=83=81=EC=9C=84=203=EA=B0=9C?= =?UTF-8?q?=EB=A7=8C=20=EC=B6=9C=EB=A0=A5=ED=95=98=EB=8F=84=EB=A1=9D=20?= =?UTF-8?q?=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/main/index.tsx | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/components/main/index.tsx b/src/components/main/index.tsx index 9a43d5bc..9484da33 100644 --- a/src/components/main/index.tsx +++ b/src/components/main/index.tsx @@ -19,15 +19,18 @@ const Main = () => { const funSystemResponse = getFunsystem(); popularArticleResponse.then((data) => { - setPosts(data.data); + const result: PostDetailProps[] = data.data; + setPosts(result.slice(0, 3)); }); noticeResponse.then((data) => { - setNoticeList(data.data.content); + const result: SummaryText[] = data.data.content; + setNoticeList(result.slice(0, 3)); }); funSystemResponse.then((data) => { - setFunSystemList(data.data.content); + const result: SummaryText[] = data.data.content; + setFunSystemList(result.slice(0, 3)); }); }, []); From 96d0560754c66b3204dbcb5ee2158496e0ea5473 Mon Sep 17 00:00:00 2001 From: halfmoon-mind <5338095@gmail.com> Date: Thu, 28 Dec 2023 22:50:34 +0900 Subject: [PATCH 09/14] =?UTF-8?q?feat:=20=EB=A1=9C=EA=B7=B8=EC=9D=B8?= =?UTF-8?q?=EC=97=90=EC=84=9C=20utility=20header=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/login/index.page.tsx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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 403e9621bbba849ec68d0b9f3923c68a3a32bac1 Mon Sep 17 00:00:00 2001 From: halfmoon-mind <5338095@gmail.com> Date: Thu, 28 Dec 2023 22:50:44 +0900 Subject: [PATCH 10/14] =?UTF-8?q?refactor:=20=EB=B6=88=ED=95=84=EC=9A=94?= =?UTF-8?q?=ED=95=9C=20=EC=BD=94=EB=93=9C=20=EC=82=AD=EC=A0=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/layout/index.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/src/pages/layout/index.tsx b/src/pages/layout/index.tsx index fc9a3fc4..ea7c31c3 100644 --- a/src/pages/layout/index.tsx +++ b/src/pages/layout/index.tsx @@ -1,4 +1,3 @@ -import Header from '@/components/common/Header/Header'; import { userNavAtom } from '@/states/userNavAtom'; import { PropsWithChildren } from 'react'; import { useRecoilValue } from 'recoil'; From 3cb40122a8ab39f6aab5aba12a6d33ea5df474ff Mon Sep 17 00:00:00 2001 From: halfmoon-mind <5338095@gmail.com> Date: Thu, 28 Dec 2023 22:57:04 +0900 Subject: [PATCH 11/14] =?UTF-8?q?refactor:=20PR=EC=8B=9C=20=EB=B9=8C?= =?UTF-8?q?=EB=93=9C=20=ED=99=95=EC=9D=B8=20=EC=BD=94=EB=93=9C=20=EC=82=AD?= =?UTF-8?q?=EC=A0=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/pull_request_action.yml | 23 ----------------------- 1 file changed, 23 deletions(-) delete mode 100644 .github/workflows/pull_request_action.yml 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 From 0ef9ba056a582017807069e7942ae882b82da11c Mon Sep 17 00:00:00 2001 From: halfmoon-mind <5338095@gmail.com> Date: Tue, 2 Jan 2024 01:59:49 +0900 Subject: [PATCH 12/14] =?UTF-8?q?feat:=20main=EC=97=90=EC=84=9C=20api=20?= =?UTF-8?q?=EC=BD=9C=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Home/PopularPosts/PopularPosts.tsx | 25 ++++++------------- src/components/main/index.tsx | 22 ++++++++++++---- 2 files changed, 25 insertions(+), 22 deletions(-) diff --git a/src/components/Home/PopularPosts/PopularPosts.tsx b/src/components/Home/PopularPosts/PopularPosts.tsx index b7a7a6ce..ff40b177 100644 --- a/src/components/Home/PopularPosts/PopularPosts.tsx +++ b/src/components/Home/PopularPosts/PopularPosts.tsx @@ -9,9 +9,9 @@ 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[] }) => { @@ -39,9 +39,9 @@ const PopularPosts = ({ posts }: { posts: PostDetailProps[] }) => { 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} /> ))} @@ -54,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}`); @@ -78,10 +69,10 @@ const PostDetail = ({ - {typeTrans} + {topic} {title} - {beforeTime(createdAt)} + {beforeTime(updatedAt)} {content} diff --git a/src/components/main/index.tsx b/src/components/main/index.tsx index 9484da33..2ea33609 100644 --- a/src/components/main/index.tsx +++ b/src/components/main/index.tsx @@ -20,17 +20,29 @@ const Main = () => { popularArticleResponse.then((data) => { const result: PostDetailProps[] = data.data; - setPosts(result.slice(0, 3)); + if (result.length > 3) { + setPosts(result.slice(0, 3)); + } else { + setPosts(result); + } }); noticeResponse.then((data) => { - const result: SummaryText[] = data.data.content; - setNoticeList(result.slice(0, 3)); + const result: SummaryText[] = data.data.notices; + if (result.length > 3) { + setNoticeList(result.slice(0, 3)); + } else { + setNoticeList(result); + } }); funSystemResponse.then((data) => { - const result: SummaryText[] = data.data.content; - setFunSystemList(result.slice(0, 3)); + const result: SummaryText[] = data.data.funSystems; + if (result.length > 3) { + setFunSystemList(result.slice(0, 3)); + } else { + setFunSystemList(result); + } }); }, []); From 428453d60ae704bbbaf345ae64dc77ac413d1c89 Mon Sep 17 00:00:00 2001 From: halfmoon-mind <5338095@gmail.com> Date: Tue, 2 Jan 2024 02:00:12 +0900 Subject: [PATCH 13/14] =?UTF-8?q?refactor:=20header=20=EC=84=A4=EC=A0=95?= =?UTF-8?q?=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/index.page.tsx | 8 +++----- src/pages/layout/index.tsx | 16 +++++++++++++++- 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/src/pages/index.page.tsx b/src/pages/index.page.tsx index 79bbd42a..88b1c490 100644 --- a/src/pages/index.page.tsx +++ b/src/pages/index.page.tsx @@ -24,11 +24,9 @@ const MainPage = () => { }, []); return ( -
- -
- -
+ +
+ ); }; export default MainPage; diff --git a/src/pages/layout/index.tsx b/src/pages/layout/index.tsx index ea7c31c3..f0f02e74 100644 --- a/src/pages/layout/index.tsx +++ b/src/pages/layout/index.tsx @@ -1,5 +1,5 @@ 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'; @@ -10,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 &&
} */} From ad2be98ac923f9d339fbabd7107f49c64a084122 Mon Sep 17 00:00:00 2001 From: halfmoon-mind <5338095@gmail.com> Date: Tue, 2 Jan 2024 20:42:03 +0900 Subject: [PATCH 14/14] =?UTF-8?q?fix:=20storybook=20=EC=97=85=EB=8D=B0?= =?UTF-8?q?=EC=9D=B4=ED=8A=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Home/PopularPosts/PopularPosts.stories.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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', }, ], },