Skip to content

Commit

Permalink
Merge pull request #1410 from 42organization/6th_party
Browse files Browse the repository at this point in the history
[test-deploy] 파티생성시 마감기한 추가후 최종 테스트
  • Loading branch information
izone00 authored Apr 16, 2024
2 parents b321c1f + 969a91a commit bdb04f5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
11 changes: 8 additions & 3 deletions components/party/PartyCreate.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { useRouter } from 'next/router';
import { FormEvent, useState } from 'react';
import { useSetRecoilState } from 'recoil';
import { FaTimes } from 'react-icons/fa';
import { PartyCategory, PartyCreateForm } from 'types/partyTypes';
import { instance } from 'utils/axios';
import { getFormattedDateToString } from 'utils/handleTime';
import { toastState } from 'utils/recoil/toast';
import {
customTemplate,
Expand Down Expand Up @@ -128,6 +128,9 @@ function DetailCustomization({
minute: 0,
});
const [isSubmitting, setIsSubmitting] = useState(false);
const dueDate = getFormattedDateToString(
new Date(Date.now() + partyForm.openPeriod * 60 * 1000)
);

function handleOpenPeriod(period: { hour: number; minute: number }) {
setOpenPeriod(period);
Expand Down Expand Up @@ -258,7 +261,9 @@ function DetailCustomization({
))}
</select>
<div className={styles.textCenter}>분 후</div>
<div className={styles.dueDate}>23시 34분 마감</div>
<div className={styles.dueDate}>
{dueDate.hour}{dueDate.min}분 마감
</div>
</div>
</label>
<label className={styles.contentLabel}>
Expand All @@ -276,7 +281,7 @@ function DetailCustomization({
/>
<div
className={styles.contentCount}
>{`${partyForm.content.length}/1000`}</div>
>{`${partyForm.content.length}/100`}</div>
</label>
<div className={styles.submitButtonWrap}>
<button type='submit' disabled={isSubmitting}>
Expand Down
2 changes: 1 addition & 1 deletion hooks/party/usePartyForm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ const reducer: React.Reducer<PartyCreateForm, PartyFormAction> = (
case 'UPDATE_MAX_PEOPLE':
return { ...state, maxPeople: action.maxPeople };
case 'UPDATE_CONTENT':
if (action.content.length > 1000) return state;
if (action.content.length > 100) return state;
return { ...state, content: action.content };
case 'UPDATE_OPEN_PERIOD':
return {
Expand Down

0 comments on commit bdb04f5

Please sign in to comment.