Skip to content

Commit

Permalink
InputDatePicker, Dropdown error props 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
cause38 authored and baegofda committed Oct 7, 2024
1 parent ca56f55 commit e49df4c
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 9 deletions.
14 changes: 7 additions & 7 deletions src/core/components/Dropdown/DropdownBase/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,14 @@ const DropdownBase = ({
)}
{trigger}
{isVisibleContent && content}
{feedback ? (
<Typography
theme='body-03-regular'
color={feedbackColor}
text={feedback}
/>
) : null}
</div>
{feedback ? (
<Typography
theme='body-03-regular'
color={feedbackColor}
text={feedback}
/>
) : null}
</DropdownContext.Provider>
);
};
Expand Down
1 change: 1 addition & 0 deletions src/core/components/Dropdown/DropdownBase/types/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ export interface DropdownItemsProps extends HTMLAttributes<HTMLUListElement> {
export interface DropdownTriggerProps
extends Omit<HTMLAttributes<HTMLButtonElement>, 'children'> {
onClick?: (e: MouseEvent<HTMLButtonElement>) => void;
error?: boolean;
children:
| ReactNode
| ((
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { DropdownSelectTriggerProps } from './types';

const DropdownSelectTrigger = forwardRef(
(
{ currentValue, ...props }: DropdownSelectTriggerProps,
{ currentValue, error, ...props }: DropdownSelectTriggerProps,
ref: React.Ref<HTMLButtonElement>,
) => {
const { className, placeholder, ...rest } = props;
Expand All @@ -18,7 +18,8 @@ const DropdownSelectTrigger = forwardRef(
<DropdownBase.Trigger
ref={ref}
className={clsx(
'flex h-[3.75rem] w-full items-center justify-between gap-x-2 overflow-hidden rounded-xl border border-gray-03 p-3',
'flex h-[3.75rem] w-full items-center justify-between gap-x-2 overflow-hidden rounded-xl border p-3',
error ? 'border-error' : ' border-gray-03',
className,
)}
{...rest}
Expand Down
2 changes: 2 additions & 0 deletions src/core/components/Input/InputDatePicker/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ const InputDatePicker = ({
isFixStartDate,
getPeriodDates,
externalDates,
error = false,
useTab = false,
useHoliday = false,
disabled = false,
Expand Down Expand Up @@ -107,6 +108,7 @@ const InputDatePicker = ({
onClick={handleDatePicker}
label={label}
required={required}
error={error}
feedback={feedback}
feedbackColor={feedbackColor}
disabled={disabled}
Expand Down
1 change: 1 addition & 0 deletions src/core/components/Input/InputDatePicker/types/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ export interface InputDatePickerProps
>,
Pick<
InputBaseProps<'input'>,
| 'error'
| 'feedback'
| 'feedbackColor'
| 'disabled'
Expand Down

0 comments on commit e49df4c

Please sign in to comment.