diff --git a/packages/fakeyou.com/src/components/common/TempSelect/TempSelect.tsx b/packages/fakeyou.com/src/components/common/TempSelect/TempSelect.tsx index 0d80378b23..36f2a297aa 100644 --- a/packages/fakeyou.com/src/components/common/TempSelect/TempSelect.tsx +++ b/packages/fakeyou.com/src/components/common/TempSelect/TempSelect.tsx @@ -5,8 +5,8 @@ import "../Select/Select.scss"; import ReactSelect, { Props as ReactSelectProps } from "react-select"; export interface Option { - value: string, - label: string + value: string; + label: string; } export interface SelectProps extends ReactSelectProps { @@ -14,34 +14,64 @@ export interface SelectProps extends ReactSelectProps { label?: string; rounded?: boolean; small?: boolean; - options: Option[], + options: Option[]; onChange?: (value: any) => void; } - - -export default function Select({ label, icon, name, onChange: inChange = () => {}, options = [], rounded, small, value, ...rest }: SelectProps) { - const valueLabel = options.find((option: any)=> option.value === value)?.label || ""; - const onChange = ({ value }: any) => inChange({ target: { value, name, type: "select" } }); +export default function Select({ + label, + icon, + name, + onChange: inChange = () => {}, + options = [], + rounded, + small, + value, + ...rest +}: SelectProps) { + const valueLabel = + options.find((option: any) => option.value === value)?.label || ""; + const onChange = ({ value }: any) => + inChange({ target: { value, name, type: "select" } }); const classNames = { control: ({ isFocused }: { isFocused: boolean }) => - `select${ icon ? " with-icon" : "" }${ rounded ? " rounded-full" : "" }${ isFocused ? " focused" : "" }`, + `select${icon ? " with-icon" : ""}${rounded ? " rounded-full" : ""}${ + isFocused ? " focused" : "" + }`, option: () => "select-option", - input: () => "select-input", + input: () => "select-input", placeholder: () => "select-placeholder", singleValue: () => "select-value", menu: () => "select-container", indicatorSeparator: () => "select-separator", }; - return <> - { label && } -
- { icon && } -
- + return ( +
+ {label && } +
+ {icon && ( + + )} +
+ +
- ; -}; \ No newline at end of file + ); +}