Skip to content

Commit

Permalink
Update input.tsx
Browse files Browse the repository at this point in the history
  • Loading branch information
jdinh8124 committed Aug 20, 2024
1 parent e51b49f commit a133346
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions react-app/src/components/Inputs/input.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,10 @@ import { InputProps } from "shared-types";
const Input = React.forwardRef<HTMLInputElement, InputProps>(
({ className, icon, iconRight, ...props }, ref) => {
return (
<div
className={cn(
"relative",
icon && !className.includes("w-full") && "w-fit",
)}
>
<div className="relative w-fit">
{icon && (
<span
className={`absolute inset-y-0 border-[#212121] border flex items-center px-3 bg-[#f0f0f0] ${
className={`absolute inset-y-0 border-[#212121] border flex items-center px-3 bg-[#f0f0f0] ${
iconRight
? "right-0 border-s-black rounded-e-sm"
: "left-0 border-e-black rounded-s-sm"
Expand All @@ -25,6 +20,7 @@ const Input = React.forwardRef<HTMLInputElement, InputProps>(
<input
className={cn(
"flex h-9 w-full rounded-sm border border-[#212121] bg-transparent px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",
icon && (iconRight ? "pr-10" : "pl-10"),
className,
)}
ref={ref}
Expand Down

0 comments on commit a133346

Please sign in to comment.