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

fix: Remove icon if message is present #550

Merged
merged 1 commit into from
Jul 30, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading