Skip to content

Commit e8ab64d

Browse files
committed
Feat: Updated the placeholder from object to text string
1 parent b2261f0 commit e8ab64d

File tree

2 files changed

+5
-9
lines changed

2 files changed

+5
-9
lines changed

src/lib/components/select/select.module.scss

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@
1212
}
1313
.selectValue {
1414
@apply tw-flex tw-items-center;
15+
&.placeholder {
16+
@apply tw-text-[#666666];
17+
}
1518
.seletIcon {
1619
@apply tw-mr-2 tw-h-5 tw-w-5 tw-flex-shrink-0;
1720
}

src/lib/components/select/select.tsx

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,7 @@ interface Props {
1212
selected: IOption | null;
1313
onSelect: (obj: IOption) => void;
1414
themeColor?: string;
15-
placeholder?: {
16-
text: string;
17-
color?: string;
18-
};
15+
placeholder?: string;
1916
}
2017

2118
interface IDropdownPosition {
@@ -148,11 +145,7 @@ export const Select: FC<Props> = ({ children, selected, onSelect, themeColor, pl
148145
<span className={styles.selectText}>{selected.label}</span>
149146
</span>
150147
) : (
151-
placeholder && (
152-
<span className={styles.selectValue} style={{ color: placeholder.color || '#9ca3af' }}>
153-
{placeholder.text}
154-
</span>
155-
)
148+
placeholder && <span className={`${styles.selectValue} ${styles.placeholder}`}>{placeholder}</span>
156149
)}
157150
<span className={styles.chevronDownIconSpan}>
158151
<ChevronDownIcon

0 commit comments

Comments
 (0)