mirror of
https://github.com/wassname/talk.git
synced 2026-07-13 17:45:56 +08:00
Supporting icons with ValidationMessages
This commit is contained in:
@@ -14,13 +14,22 @@ export interface ValidationMessageProps {
|
||||
* If set renders a full width message
|
||||
*/
|
||||
fullWidth?: boolean;
|
||||
/*
|
||||
* Name of the icon, if not provided it will default to warning icon
|
||||
*/
|
||||
icon?: string;
|
||||
}
|
||||
|
||||
const ValidationMessage: StatelessComponent<ValidationMessageProps> = props => {
|
||||
const { className, fullWidth, children, ...rest } = props;
|
||||
const { className, fullWidth, children, icon, ...rest } = props;
|
||||
|
||||
return (
|
||||
<Message color="validation" icon="warning" className={className} {...rest}>
|
||||
<Message
|
||||
color="validation"
|
||||
icon={icon ? icon : "warning"}
|
||||
className={className}
|
||||
{...rest}
|
||||
>
|
||||
{children}
|
||||
</Message>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user