diff --git a/components/Button/Button.types.ts b/components/Button/Button.types.ts index 13d32c0..e9e265b 100644 --- a/components/Button/Button.types.ts +++ b/components/Button/Button.types.ts @@ -3,4 +3,5 @@ export interface ButtonProps { btnColorType: "orange" | "white" | "gray"; onClick?: React.MouseEventHandler; btnCustom?: string; + disabled?: boolean; } diff --git a/components/Button/index.tsx b/components/Button/index.tsx index 9c793b3..8217bde 100644 --- a/components/Button/index.tsx +++ b/components/Button/index.tsx @@ -4,18 +4,9 @@ import { ButtonProps } from "./Button.types"; const cx = classNames.bind(styles); -const Button = ({ - children, - btnColorType, - onClick, - btnCustom, -}: ButtonProps) => { +const Button = ({ children, btnColorType, onClick, btnCustom, disabled = false }: ButtonProps) => { return ( - ); diff --git a/components/Post/Post.types.ts b/components/Post/Post.types.ts index f0be5fd..892ad26 100644 --- a/components/Post/Post.types.ts +++ b/components/Post/Post.types.ts @@ -9,4 +9,5 @@ export interface PostProps { shopAddress2?: string; shopImageUrl: string; hourlyPay: number; + closed: boolean; } diff --git a/components/Post/index.tsx b/components/Post/index.tsx index f5603ef..f8ebf57 100644 --- a/components/Post/index.tsx +++ b/components/Post/index.tsx @@ -17,11 +17,13 @@ const Post: React.FC = ({ shopAddress1, shopImageUrl, hourlyPay, + closed = false, }) => { const startTime = moment(startsAt); const endTime = moment(startTime).add(workhour, "hours"); const now = moment(); const isPast = now.isAfter(startTime); + const isClosed = closed; const startTimeFormatted = startTime.format("YYYY-MM-DD HH:mm"); const endTimeFormatted = endTime.format("HH:mm"); @@ -38,6 +40,7 @@ const Post: React.FC = ({ alt="공고 이미지" /> {isPast &&
지난 공고
} + {isClosed &&
마감 완료
}

{shopName}

diff --git a/components/Search/index.tsx b/components/Search/index.tsx index cded061..bbfee55 100644 --- a/components/Search/index.tsx +++ b/components/Search/index.tsx @@ -123,6 +123,7 @@ const Search = () => { shopAddress1={notice.shop.item.address1} shopImageUrl={notice.shop.item.imageUrl} hourlyPay={notice.hourlyPay} + closed={notice.closed} /> ); diff --git a/components/Shop/ShopNotice/index.tsx b/components/Shop/ShopNotice/index.tsx index 9143f71..c62888e 100644 --- a/components/Shop/ShopNotice/index.tsx +++ b/components/Shop/ShopNotice/index.tsx @@ -92,11 +92,7 @@ const ShopNotice = ({ onClick }: NoticeEmptyProps) => {

공고를 등록해 보세요.

-
@@ -120,6 +116,7 @@ const ShopNotice = ({ onClick }: NoticeEmptyProps) => { shopAddress1={item.shop?.address1} hourlyPay={item.hourlyPay} shopImageUrl={item.shop?.imageUrl} + closed={item.closed} /> ); diff --git a/components/notice/CustomNoticeList/index.tsx b/components/notice/CustomNoticeList/index.tsx index 86ef42b..dc50a4d 100644 --- a/components/notice/CustomNoticeList/index.tsx +++ b/components/notice/CustomNoticeList/index.tsx @@ -116,6 +116,7 @@ const CustomNoticeList = () => { shopAddress1={notice.shop.item.address1} shopImageUrl={notice.shop.item.imageUrl} hourlyPay={notice.hourlyPay} + closed={notice.closed} /> ); diff --git a/components/notice/NoticeDetailed/index.tsx b/components/notice/NoticeDetailed/index.tsx index 9c69660..ecfa085 100644 --- a/components/notice/NoticeDetailed/index.tsx +++ b/components/notice/NoticeDetailed/index.tsx @@ -1,3 +1,4 @@ +import React, { useState } from "react"; import styles from "./NoticeDetailed.module.scss"; import classNames from "classnames/bind"; import Button from "@/components/Button"; @@ -9,7 +10,6 @@ import { INoticeDataProps } from "@/types/Notice"; import { formatCurrency } from "@/utils/formatCurrency"; import moment from "moment"; import { calculateIncreasePercent } from "@/utils/calculateIncreasePercent"; -import { useState } from "react"; import { postApplicant } from "@/api/notice"; const cx = classNames.bind(styles); @@ -21,6 +21,7 @@ const NoticeDetailed = ({ shopData }: INoticeDataProps) => { const endTime = moment(startTime).add(shopData.workhour, "hours"); const now = moment(); const isPast = now.isAfter(endTime); + const isClosed = shopData.closed; const startTimeFormatted = startTime.format("YYYY-MM-DD HH:mm"); const endTimeFormatted = endTime.format("HH:mm"); @@ -59,6 +60,7 @@ const NoticeDetailed = ({ shopData }: INoticeDataProps) => { alt="가게 이미지" /> {isPast &&
지난 공고
} + {isClosed &&
마감 완료
}
@@ -70,7 +72,10 @@ const NoticeDetailed = ({ shopData }: INoticeDataProps) => {
{increasePercent >= 1 && ( - + )}
@@ -85,7 +90,11 @@ const NoticeDetailed = ({ shopData }: INoticeDataProps) => {

{shopData.shop.description}

- {isApplied ? ( + {isPast || isClosed ? ( + + ) : isApplied ? ( diff --git a/components/notice/NoticeList/index.tsx b/components/notice/NoticeList/index.tsx index 484b9ca..b7c825a 100644 --- a/components/notice/NoticeList/index.tsx +++ b/components/notice/NoticeList/index.tsx @@ -111,6 +111,7 @@ const NoticeList: React.FC = () => { shopAddress1={notice.shop.item.address1} shopImageUrl={notice.shop.item.imageUrl} hourlyPay={notice.hourlyPay} + closed={notice.closed} /> ); diff --git a/pages/notices/[shopId]/[noticeId]/index.tsx b/pages/notices/[shopId]/[noticeId]/index.tsx index 401decd..eada9d2 100644 --- a/pages/notices/[shopId]/[noticeId]/index.tsx +++ b/pages/notices/[shopId]/[noticeId]/index.tsx @@ -73,6 +73,7 @@ const DetailedNotice = () => { shopAddress1={notice.shop.address1} shopImageUrl={notice.shop.imageUrl} hourlyPay={notice.hourlyPay} + closed={notice.closed} /> );