Skip to content

Commit

Permalink
fix: Remove icon if message is present (#550)
Browse files Browse the repository at this point in the history
  • Loading branch information
LautaroPetaccio authored Jul 30, 2024
1 parent 57b0ea2 commit cbcd331
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/components/Field/Field.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export type FieldProps = InputProps & {
label?: string
/** Boolean flag to show an error, default on false*/
error?: boolean
/** Message to display below the input*/
/** Message to display below the input */
message?: React.ReactNode
/** Button text to display before input to dispatch an action*/
action?: string
Expand Down Expand Up @@ -114,6 +114,7 @@ export class Field extends React.PureComponent<FieldProps> {
label,
error,
warning,
message,
info,
type,
loading,
Expand All @@ -129,7 +130,7 @@ export class Field extends React.PureComponent<FieldProps> {
} = this.props

const isAddress = this.isAddress()
const icon = error && !isAddress ? 'warning circle' : void 0
const icon = error && !message && !isAddress ? 'warning circle' : void 0
const classes = classnames('dcl field', kind, {
error,
warning: !error && warning,
Expand Down

0 comments on commit cbcd331

Please sign in to comment.