Skip to content

Commit

Permalink
chore: resolved sonarcloud issues
Browse files Browse the repository at this point in the history
  • Loading branch information
WaseemAbbasCofinityX committed Jan 14, 2025
1 parent b396e3d commit 584770d
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/components/basic/Input/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -99,24 +99,25 @@ export const Input = ({
variant={variant}
placeholder={placeholder}
error={error}
type={showToggle ? (!showPassword ? 'password' : 'text') : 'text'}
type={showToggle && !showPassword ? 'password' : 'text'}
InputProps={{
endAdornment: (
<InputAdornment position="end">
{showToggle ? (
{showToggle && (
<IconButton
onClick={handleToggleVisibility}
edge="end"
aria-label="toggle password visibility"
>
{showPassword ? <VisibilityOff /> : <Visibility />}
</IconButton>
) : error ? (
)}
{error && (
<ErrorOutline
color="error"
className="cx-form-control__input-adornment--error"
/>
) : null}
)}
</InputAdornment>
),
}}
Expand Down

0 comments on commit 584770d

Please sign in to comment.