From 98a276b16542da97a7d34d0ac851ea427dfa364c Mon Sep 17 00:00:00 2001 From: leejeongho Date: Tue, 20 Aug 2024 22:07:43 +0900 Subject: [PATCH] =?UTF-8?q?fix:=201=EC=B0=A8=20QA=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/Checkbox/Checkbox.tsx | 21 ++++++++++------ .../components/Checkbox/CheckboxLabel.tsx | 24 ++++++++++++++++++ .../components/Checkbox/styles.ts | 8 +++++- .../GetMeetingInfo/GetMeetingInfo.tsx | 18 +++++++------ .../components/Checkbox/Checkbox.tsx | 21 ++++++++++------ .../components/Checkbox/CheckboxLabel.tsx | 24 ++++++++++++++++++ .../components/Checkbox/styles.ts | 8 +++++- .../components/Form/BasicInfoForm.tsx | 18 ++++++++----- .../components/Form/ExtraInfoForm.tsx | 4 +-- .../components/Form/HobbiesInfoForm.tsx | 8 ++++-- .../components/Form/IntroInfoForm.tsx | 2 +- .../components/Form/MbtiInfoForm.tsx | 6 ++++- .../get-user-info/components/Radio/Radio.tsx | 25 ++++++++++++------- .../components/Radio/RadioLabel.tsx | 24 ++++++++++++++++++ .../components/Radio/{styled.ts => styles.ts} | 8 +++++- 15 files changed, 172 insertions(+), 47 deletions(-) create mode 100644 packages/web-domains/src/new-meeting/features/get-meeting-info/components/Checkbox/CheckboxLabel.tsx create mode 100644 packages/web-domains/src/user/features/get-user-info/components/Checkbox/CheckboxLabel.tsx create mode 100644 packages/web-domains/src/user/features/get-user-info/components/Radio/RadioLabel.tsx rename packages/web-domains/src/user/features/get-user-info/components/Radio/{styled.ts => styles.ts} (74%) diff --git a/packages/web-domains/src/new-meeting/features/get-meeting-info/components/Checkbox/Checkbox.tsx b/packages/web-domains/src/new-meeting/features/get-meeting-info/components/Checkbox/Checkbox.tsx index 675f413f..cccd3bd3 100644 --- a/packages/web-domains/src/new-meeting/features/get-meeting-info/components/Checkbox/Checkbox.tsx +++ b/packages/web-domains/src/new-meeting/features/get-meeting-info/components/Checkbox/Checkbox.tsx @@ -1,31 +1,35 @@ import { Txt } from '@sambad/sds/components'; import { colors } from '@sambad/sds/theme'; -import { forwardRef, InputHTMLAttributes, useId } from 'react'; +import { forwardRef, InputHTMLAttributes, ReactNode, useId } from 'react'; import { CheckboxGroupImpl, useCheckboxContext } from './CheckboxGroupImpl'; +import { CheckboxLabel } from './CheckboxLabel'; import { checkboxCss } from './styles'; export interface CheckboxProps extends InputHTMLAttributes { value: string | number; - label: string; + label: string | ((isChecked?: boolean) => ReactNode); required?: boolean; } export const Checkbox = forwardRef((props, ref) => { - const { children, label, value, required, ...restProps } = props; + const { label, value, required, ...restProps } = props; const checkboxCtx = useCheckboxContext(); const isChecked = checkboxCtx.value?.includes(value); - const checkboxId = `${useId()}-${label}`; + const checkboxId = useId(); return (