From b0f67c43e808df578eea1a472d8a803928d44a95 Mon Sep 17 00:00:00 2001 From: Kong <155794105+ocahs9@users.noreply.github.com> Date: Sun, 13 Oct 2024 18:50:48 +0900 Subject: [PATCH] =?UTF-8?q?Chip=20=EB=B6=80=EB=B6=84=EB=A7=8C=20revert?= =?UTF-8?q?=ED=95=98=EA=B3=A0=20=EB=B3=80=EA=B2=BD=EC=82=AC=ED=95=AD?= =?UTF-8?q?=EB=93=A4=EC=9D=80=20=EB=B0=98=EC=98=81=20(#929)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Revert "모임 개설 대상 파트 Chip 으로 변경 (#914)" This reverts commit d185a0857ef8a7c42e87399e9303c806dafc9069. * Revert "Input 높이 및 모집 대상 chip 변경 (#924)" This reverts commit 02ee18edef16957a0976e79005bf68c89bfe7487. --- pages/post/index.tsx | 2 + .../Presentation/JoinablePartsField/index.tsx | 59 ------------------- src/components/form/Presentation/index.tsx | 45 +++++++------- src/components/form/TableOfContents/index.tsx | 3 + src/components/form/TextInput/index.tsx | 11 ++-- .../Information/InformationPanel.tsx | 10 +--- src/constants/option.ts | 4 +- src/data/options.ts | 9 +-- 8 files changed, 44 insertions(+), 99 deletions(-) delete mode 100644 src/components/form/Presentation/JoinablePartsField/index.tsx diff --git a/pages/post/index.tsx b/pages/post/index.tsx index 3f5d6b18..b01aeb08 100644 --- a/pages/post/index.tsx +++ b/pages/post/index.tsx @@ -135,6 +135,8 @@ export default function PostPage() { !!comment ); + console.log({ comments }); + const handleClickComment = () => { const refCurrent = commentRef.current; if (refCurrent) { diff --git a/src/components/form/Presentation/JoinablePartsField/index.tsx b/src/components/form/Presentation/JoinablePartsField/index.tsx deleted file mode 100644 index 24cedf52..00000000 --- a/src/components/form/Presentation/JoinablePartsField/index.tsx +++ /dev/null @@ -1,59 +0,0 @@ -import { Option } from '@components/form/Select/OptionItem'; -import { parts } from '@data/options'; -import { Chip } from '@sopt-makers/ui'; - -interface JoinablePartsFieldProps { - value: Option[]; - onChange: (newSelectedParts: Option[]) => void; -} - -const JoinablePartsField = ({ value, onChange }: JoinablePartsFieldProps) => { - const handleClick = (selectedOption: Option) => { - const isValidValue = Array.isArray(value); - let updatedParts = isValidValue ? [...value] : []; - - // 'all' 옵션을 클릭했을 때 처리 - if (selectedOption.value === 'all') { - // 전체 옵션이 이미 선택되어 있으면 해제, 아니면 전체 선택 - updatedParts = isValidValue && value.some(part => part.value === 'all') ? [] : parts; - } else { - // 개별 옵션을 선택할 때 - if (isValidValue && value.some(part => part.value === selectedOption.value)) { - // 이미 선택된 항목이면 해제 - updatedParts = updatedParts.filter(part => part.value !== selectedOption.value); - } else { - // 선택되지 않은 항목이면 추가 - updatedParts.push(selectedOption); - } - - // 개별 옵션 해제 시 전체 옵션도 해제 - if (updatedParts.some(part => part.value === 'all') && updatedParts.length < parts.length) { - updatedParts = updatedParts.filter(part => part.value !== 'all'); - } - - // 모든 개별 파트가 선택되었으면 'all' 옵션도 활성화 - if (updatedParts.length === parts.length - 1) { - updatedParts.push(parts[0]); // 'all'을 활성화 - } - } - - onChange(updatedParts); - }; - - return ( - <> - {parts.map(part => ( - selected.value === part.value)} - onClick={() => handleClick(part)} - key={part.value} - style={{ width: '80px' }} - > - {part.label} - - ))} - - ); -}; - -export default JoinablePartsField; diff --git a/src/components/form/Presentation/index.tsx b/src/components/form/Presentation/index.tsx index 91609c67..360582cc 100644 --- a/src/components/form/Presentation/index.tsx +++ b/src/components/form/Presentation/index.tsx @@ -13,6 +13,7 @@ import TextInput from '../TextInput'; import ImagePreview from './ImagePreview'; import { MAX_FILE_SIZE } from '@type/form'; import NeedMentor from '../CheckBox/NeedMentor'; +import { parts } from '@data/options'; import { useRouter } from 'next/router'; import { getPresignedUrl, uploadImage } from '@api/API_LEGACY/meeting'; import { imageS3Bucket } from '@constants/url'; @@ -21,7 +22,6 @@ import { fontsObject } from '@sopt-makers/fonts'; import { colors } from '@sopt-makers/colors'; import CheckSelectedIcon from '@assets/svg/checkBox/form_selected.svg'; import CheckUnselectedIcon from '@assets/svg/checkBox/form_unselected.svg'; -import JoinablePartsField from '@components/form/Presentation/JoinablePartsField'; import { IconAlertCircle } from '@sopt-makers/icons'; import { useDialog } from '@sopt-makers/ui'; import sopt_schedule_tooltip from 'public/assets/images/sopt_schedule_tooltip.png'; @@ -431,23 +431,23 @@ function Presentation({ }; return ( - - ( - - )} - > - + ( +