-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Feature] Create text-input.tsx component #15 #77
base: dev
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See comments
export const TextInput = forwardRef<HTMLInputElement, TextInputProps>( | ||
({ className, error, ...props }, ref) => { | ||
return ( | ||
<div className="relative w-[460px] h-[42px]"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't hard code dimensions/spacing, use w-full and h-fit
<input | ||
ref={ref} | ||
className={cn( | ||
'w-full h-full rounded-sm px-3 py-2 pr-10 transition-colors bg-light-neutral-gray-opaque bg-opacity-25 placeholder:text-light-neutral-gray focus:placeholder:text-light-text text-light-text focus:outline-none', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hard coded spacing values, make sure to use spacing defined in tailwind.config.ts (-md, -lg, -xl)
<svg | ||
xmlns="http://www.w3.org/2000/svg" | ||
viewBox="0 0 20 20" | ||
fill="currentColor" | ||
className="w-5 h-5 text-black" | ||
> | ||
<path d="M3 3.5A1.5 1.5 0 0 1 4.5 2h6.879a1.5 1.5 0 0 1 1.06.44l4.122 4.12A1.5 1.5 0 0 1 17 7.622V16.5a1.5 1.5 0 0 1-1.5 1.5h-11A1.5 1.5 0 0 1 3 16.5v-13Z" /> | ||
</svg> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use the heroicons package to get icons
Created the text input component