File tree Expand file tree Collapse file tree 2 files changed +4
-5
lines changed
Expand file tree Collapse file tree 2 files changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ describe('Validations component', () => {
1818 test ( 'should exclude deprecated from general validations' , ( ) => {
1919 const wrapper = shallow ( < Validations required = { false } validations = { validations } /> ) . find ( Popover ) ;
2020
21- expect ( shallow ( wrapper . prop ( 'target' ) as React . ReactElement ) ) . toHaveText ( 'optional +2' ) ;
21+ expect ( shallow ( wrapper . prop ( 'target' ) as React . ReactElement ) ) . toHaveText ( '+2' ) ;
2222 expect ( shallow ( wrapper . prop ( 'content' ) as React . ReactElement ) ) . toHaveText ( 'format:"email"minLength:2' ) ;
2323 } ) ;
2424
Original file line number Diff line number Diff line change 11import { safeStringify } from '@stoplight/json' ;
22import { Dictionary } from '@stoplight/types' ;
33import { Popover } from '@stoplight/ui-kit' ;
4- import cn from 'classnames' ;
54import * as React from 'react' ;
65import { ViewModeContext } from '../JsonSchemaViewer' ;
76
@@ -18,9 +17,9 @@ export const Validations: React.FunctionComponent<IValidations> = ({
1817 const validationCount = Object . keys ( validations ) . length ;
1918
2019 const requiredElem = (
21- < div className = { cn ( 'ml-2' , required ? 'font-medium' : 'text-darken-7 dark:text-lighten-6' ) } >
22- { required ? 'required' : 'optional' }
23- { validationCount ? `+ $ {validationCount } ` : '' }
20+ < div >
21+ { required && < span className = "ml-2 text-orange-7 dark:text-orange-6" > required </ span > }
22+ { validationCount ? < span className = "ml-1 text-darken-7 dark:text-lighten-6" > + { validationCount } </ span > : null }
2423 </ div >
2524 ) ;
2625
You can’t perform that action at this time.
0 commit comments