refactor: handling applied styles based on colorVariant in a neater manner

This commit is contained in:
utin-francis-peter
2024-07-07 08:33:02 +01:00
parent d554444b0e
commit abf5b89c28

View File

@@ -15,14 +15,15 @@ const Input = ({
onPaste,
onKeyDown,
}: InputProps) => {
const colorStyles = {
silver: 'border-silver dark:border-silver/40',
jet: 'border-jet',
gray: 'border-gray-5000 dark:text-silver',
};
return (
<input
className={`h-[42px] w-full rounded-full border-2 px-3 outline-none dark:bg-transparent dark:text-white ${className} ${
colorVariant === 'silver' ? 'border-silver dark:border-silver/40' : ''
} ${colorVariant === 'jet' ? 'border-jet' : ''} ${
colorVariant === 'gray' ? 'border-gray-5000 dark:text-silver' : ''
}
}`}
className={`h-[42px] w-full rounded-full border-2 px-3 outline-none dark:bg-transparent dark:text-white ${className} ${colorStyles[colorVariant]}`}
type={type}
id={id}
name={name}