From 4ed24efa5a35933911c43a3abdc27f7b89887111 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=ED=95=9C=ED=98=9C=EC=84=A0?=
Date: Tue, 20 Feb 2024 22:34:33 +0900
Subject: [PATCH 1/3] =?UTF-8?q?ci:=20deploy.sh=20=EC=88=98=EC=A0=95=20(#22?=
=?UTF-8?q?)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
deploy.sh | 6 +-----
next.config.js | 1 +
2 files changed, 2 insertions(+), 5 deletions(-)
diff --git a/deploy.sh b/deploy.sh
index d1869ce..156561c 100644
--- a/deploy.sh
+++ b/deploy.sh
@@ -1,8 +1,4 @@
#!/usr/bin/env bash
echo "> FE 배포"
-
-cd /home/ubuntu/fridge-link-deploy
-
-nohup yarn start &
-
+sudo cp -rf /home/ubuntu/fridge-link-deploy/build/* /var/www/html
\ No newline at end of file
diff --git a/next.config.js b/next.config.js
index 408b379..29ffa44 100644
--- a/next.config.js
+++ b/next.config.js
@@ -4,6 +4,7 @@ const nextConfig = {
images: {
domains: ['mara-s3bucket.s3.ap-northeast-2.amazonaws.com'],
},
+ distDir: 'build',
webpack: (config) => {
return {
...config,
From 514ca96cd94931f0b86d443d3c0847106a7b238e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=ED=95=9C=ED=98=9C=EC=84=A0?=
Date: Tue, 20 Feb 2024 22:55:33 +0900
Subject: [PATCH 2/3] =?UTF-8?q?ci:=20deploy.sh=20=EC=88=98=EC=A0=95=20(#23?=
=?UTF-8?q?)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
deploy.sh | 7 ++++++-
next.config.js | 1 -
2 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/deploy.sh b/deploy.sh
index 156561c..2921d64 100644
--- a/deploy.sh
+++ b/deploy.sh
@@ -1,4 +1,9 @@
#!/usr/bin/env bash
echo "> FE 배포"
-sudo cp -rf /home/ubuntu/fridge-link-deploy/build/* /var/www/html
\ No newline at end of file
+
+sudo fuser -k 80/tcp
+
+cd /home/ubuntu/fridge-link-deploy
+
+nohup yarn start &
\ No newline at end of file
diff --git a/next.config.js b/next.config.js
index 29ffa44..408b379 100644
--- a/next.config.js
+++ b/next.config.js
@@ -4,7 +4,6 @@ const nextConfig = {
images: {
domains: ['mara-s3bucket.s3.ap-northeast-2.amazonaws.com'],
},
- distDir: 'build',
webpack: (config) => {
return {
...config,
From 03e3d026a2d47b053e3002d89887866af5f86ac7 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=ED=95=9C=ED=98=9C=EC=84=A0?=
Date: Wed, 21 Feb 2024 10:36:59 +0900
Subject: [PATCH 3/3] =?UTF-8?q?feat:=20=EB=82=98=EB=88=94=20=EB=AA=A9?=
=?UTF-8?q?=EB=A1=9D=20=EC=A1=B0=ED=9A=8C=20API=20=EC=97=B0=EB=8F=99=20(#2?=
=?UTF-8?q?4)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/components/organisms/ShareListItem.tsx | 16 +++++-----------
src/hooks/queries/queryKeys.ts | 1 +
src/hooks/queries/share/index.ts | 1 +
src/hooks/queries/share/useGetShares.ts | 7 +++++++
src/pages/share/index.tsx | 12 ++++++++++--
src/types/share/index.d.ts | 18 ++++++++++++++++++
6 files changed, 42 insertions(+), 13 deletions(-)
create mode 100644 src/hooks/queries/share/index.ts
create mode 100644 src/hooks/queries/share/useGetShares.ts
create mode 100644 src/types/share/index.d.ts
diff --git a/src/components/organisms/ShareListItem.tsx b/src/components/organisms/ShareListItem.tsx
index ca36e48..518c39c 100644
--- a/src/components/organisms/ShareListItem.tsx
+++ b/src/components/organisms/ShareListItem.tsx
@@ -6,22 +6,16 @@ import React from 'react';
import dayjs from 'dayjs';
const ShareListItem: React.FC<{
- data: {
- id: number;
- thumbnail: string | null;
- title: string;
- location: string;
- date: dayjs.Dayjs;
- };
+ data: ShareData;
}> = ({ data }) => {
return (
- {data.thumbnail ? (
+ {data.thumbNailImage ? (
- {dayjs(data.date).format('MM월 DD일 A HH:mm')}
+ {`${dayjs(data.shareDate).format('MM월 DD일')} ${data.shareTime.hour} : ${data.shareTime.minute}`}
diff --git a/src/hooks/queries/queryKeys.ts b/src/hooks/queries/queryKeys.ts
index 670e47a..42585d8 100644
--- a/src/hooks/queries/queryKeys.ts
+++ b/src/hooks/queries/queryKeys.ts
@@ -1,6 +1,7 @@
export const queryKeys = {
INGREDIENT: (id?: number) => (id ? ['ingredient', id] : ['ingredient']),
KAKAO: () => ['kakao'],
+ SHARES: () => ['shares'],
} as const;
export type QueryKeys = (typeof queryKeys)[keyof typeof queryKeys];
diff --git a/src/hooks/queries/share/index.ts b/src/hooks/queries/share/index.ts
new file mode 100644
index 0000000..a6b209c
--- /dev/null
+++ b/src/hooks/queries/share/index.ts
@@ -0,0 +1 @@
+export { default as useGetShares } from './useGetShares';
diff --git a/src/hooks/queries/share/useGetShares.ts b/src/hooks/queries/share/useGetShares.ts
new file mode 100644
index 0000000..dadda6c
--- /dev/null
+++ b/src/hooks/queries/share/useGetShares.ts
@@ -0,0 +1,7 @@
+import { queryKeys } from '../queryKeys';
+import { useBaseQuery } from '../useBaseQuery';
+
+const useGetShares = () =>
+ useBaseQuery(queryKeys.SHARES(), '/shares', true);
+
+export default useGetShares;
diff --git a/src/pages/share/index.tsx b/src/pages/share/index.tsx
index 0fddb89..dbac79c 100644
--- a/src/pages/share/index.tsx
+++ b/src/pages/share/index.tsx
@@ -14,6 +14,8 @@ import { PlusIcon } from '@/assets/icons';
import { type SortLabel, type TabLabel } from '@/types/common';
import dayjs from 'dayjs';
import Link from 'next/link';
+import { useGetShares } from '@/hooks/queries/share';
+import { SuspenseFallback } from '@/components/templates';
const TABS: TabLabel[] = [
{ label: '나눔 신청', value: 'enroll' },
@@ -50,6 +52,12 @@ const SharePage: NextPage = () => {
const [curTab, setCurTab] = useState(TABS[0]);
const [curSortType, setCurSortType] = useState(SORT_TYPES[0]);
const { isOpen, onOpen, onClose } = useDisclosure();
+ const { data } = useGetShares();
+ console.log(data?.data);
+
+ if (!data?.data) {
+ return ;
+ }
return (
<>
@@ -76,8 +84,8 @@ const SharePage: NextPage = () => {
- {MOCK_DATA.data.map((ele) => (
-
+ {data?.data.map((ele) => (
+
))}
diff --git a/src/types/share/index.d.ts b/src/types/share/index.d.ts
new file mode 100644
index 0000000..b9ccb6c
--- /dev/null
+++ b/src/types/share/index.d.ts
@@ -0,0 +1,18 @@
+interface ShareData {
+ shareId: number;
+ title: string;
+ itemName: string;
+ content: string;
+ shareTime: {
+ hour: number;
+ minute: number;
+ second: number;
+ nano: number;
+ };
+ shareDate: string;
+ limitDate: string;
+ limitPerson: number;
+ location: string;
+ status: string;
+ thumbNailImage: string;
+}