11import { MarkdownViewer } from '@stoplight/markdown-viewer' ;
2- import { IRowRendererOptions , TreeStore } from '@stoplight/tree-list' ;
2+ import { IRowRendererOptions } from '@stoplight/tree-list' ;
33import { Icon , Popover } from '@stoplight/ui-kit' ;
44import * as cn from 'classnames' ;
55import * as React from 'react' ;
@@ -15,15 +15,14 @@ import { Types } from './';
1515export interface ISchemaRow {
1616 node : SchemaTreeListNode ;
1717 rowOptions : IRowRendererOptions ;
18- treeStore : TreeStore ;
1918 onGoToRef ?: GoToRefHandler ;
2019}
2120
2221const ICON_SIZE = 12 ;
2322const ICON_DIMENSION = 20 ;
2423const ROW_OFFSET = 7 ;
2524
26- export const SchemaRow : React . FunctionComponent < ISchemaRow > = ( { node, treeStore , onGoToRef } ) => {
25+ export const SchemaRow : React . FunctionComponent < ISchemaRow > = ( { node, rowOptions , onGoToRef } ) => {
2726 const schemaNode = node . metadata as SchemaNodeWithMeta ;
2827 const { name, $ref, subtype, required } = schemaNode ;
2928
@@ -79,7 +78,7 @@ export const SchemaRow: React.FunctionComponent<ISchemaRow> = ({ node, treeStore
7978 >
8079 < Icon
8180 iconSize = { ICON_SIZE }
82- icon = { treeStore . isNodeExpanded ( node ) ? 'caret-down' : 'caret-right' }
81+ icon = { rowOptions . isExpanded ? 'caret-down' : 'caret-right' }
8382 className = "text-darken-9 dark:text-lighten-9"
8483 />
8584 </ div >
@@ -140,7 +139,7 @@ export const SchemaRow: React.FunctionComponent<ISchemaRow> = ({ node, treeStore
140139 if ( Array . isArray ( validation ) ) {
141140 elem = validation . map ( ( v , i ) => (
142141 < div key = { i } className = "mt-1 mr-1 flex items-center" >
143- < div className = "px-1 bg-gray-2 dark:bg-gray-8 font-bold text-sm rounded" > { v } </ div >
142+ < div className = "px-1 bg-gray-2 dark:bg-gray-8 font-bold text-sm rounded" > { String ( v ) } </ div >
144143 { i < validation . length - 1 ? < div > ,</ div > : null }
145144 </ div >
146145 ) ) ;
0 commit comments