(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',
},
],
},