File tree Expand file tree Collapse file tree 2 files changed +13
-8
lines changed Expand file tree Collapse file tree 2 files changed +13
-8
lines changed Original file line number Diff line number Diff line change 11{
22 "name" : " @netdata/netdata-ui" ,
3- "version" : " 4.3.6 " ,
3+ "version" : " 4.3.7 " ,
44 "description" : " netdata UI kit" ,
55 "main" : " dist/index.js" ,
66 "module" : " dist/es6/index.js" ,
Original file line number Diff line number Diff line change @@ -3,6 +3,16 @@ import Flex from "@/components/templates/flex"
33import { TextMicro } from "@/components/typography"
44import { Input , LabelText } from "./styled"
55
6+ const Error = ( { error } ) => {
7+ const errorMessage = error === true ? "invalid" : error
8+
9+ return typeof errorMessage === "string" ? (
10+ < TextMicro color = "errorText" > { errorMessage } </ TextMicro >
11+ ) : (
12+ ! ! errorMessage && errorMessage
13+ )
14+ }
15+
616export const TextInput = ( {
717 error,
818 disabled,
@@ -21,10 +31,9 @@ export const TextInput = ({
2131 size = "large" ,
2232 containerStyles,
2333 inputContainerStyles,
34+ hideErrorMessage,
2435 ...props
2536} ) => {
26- const errorMessage = error === true ? "invalid" : error
27-
2837 return (
2938 < Flex gap = { 0.5 } column className = { className } { ...containerStyles } as = "label" >
3039 { typeof label === "string" ? < LabelText size = { size } > { label } </ LabelText > : label }
@@ -61,11 +70,7 @@ export const TextInput = ({
6170 ) }
6271 </ Flex >
6372 { typeof hint === "string" ? < TextMicro color = "textLite" > { hint } </ TextMicro > : ! ! hint && hint }
64- { typeof errorMessage === "string" ? (
65- < TextMicro color = "errorText" > { errorMessage } </ TextMicro >
66- ) : (
67- ! ! errorMessage && errorMessage
68- ) }
73+ { ! hideErrorMessage ? < Error error = { error } /> : null }
6974 </ Flex >
7075 )
7176}
You can’t perform that action at this time.
0 commit comments