Skip to content
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

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from

Conversation

amarahatta
Copy link
Collaborator

Created the text input component

@amarahatta amarahatta linked an issue Nov 20, 2024 that may be closed by this pull request
Copy link
Collaborator

@ahmadgaz ahmadgaz left a 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]">
Copy link
Collaborator

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',
Copy link
Collaborator

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)

Comment on lines +21 to +28
<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>
Copy link
Collaborator

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature] Create text-input.tsx component
2 participants