1+ import { useRef } from 'react' ;
12import ComponentMapping from '../../mappings/ComponentMapping' ;
23import { useStoreActions , useStoreState } from '../../state/Hooks' ;
3- import CollapsibleList from './CollapsibleList ' ;
4+ import ComponentInfo from '../atoms/ComponentInfo ' ;
45import Definition from '../atoms/Definition' ;
56import {
6- CreateDefinitionMenu ,
7- CreateDefinitionMenuNav ,
8- } from '../menus/definitions/CreateDefinitionMenu ' ;
7+ InspectorDefinitionMenu ,
8+ InspectorDefinitionMenuNav ,
9+ } from '../menus/definitions/InspectorDefinitionMenu ' ;
910import SubTypeMenuNav from '../menus/SubTypeMenu' ;
10- import ComponentInfo from '../atoms/ComponentInfo' ;
11+ import CollapsibleList from './CollapsibleList' ;
12+ import GuideContainer from './GuideContainer' ;
1113
1214export interface DefinitionsProps {
1315 type : ComponentMapping ;
@@ -18,10 +20,14 @@ export interface DefinitionsProps {
1820const DefinitionsContainer = ( props : DefinitionsProps ) => {
1921 const items = useStoreState ( props . type . store . get ) ;
2022 const navigateTo = useStoreActions ( ( actions ) => actions . navigateTo ) ;
23+ const guideStep = useStoreState ( ( state ) => state . guideStep ) ;
24+ const ref = useRef ( null ) ;
2125
22- console . log ( props , 'props' )
2326 return (
24- < div className = "w-full p-4 pb-0" >
27+ < div ref = { ref } className = "w-full p-4 pb-0" >
28+ { props . type . guide && guideStep === props . type . guide . step && (
29+ < GuideContainer target = { ref } > { props . type . guide . info } </ GuideContainer >
30+ ) }
2531 < CollapsibleList
2632 title = { props . type . name . plural }
2733 expanded = { props . expanded }
@@ -35,12 +41,12 @@ const DefinitionsContainer = (props: DefinitionsProps) => {
3541 component : SubTypeMenuNav ,
3642 props : {
3743 typePage : props . type . subtypes ?. component ,
38- menuPage : CreateDefinitionMenu ,
44+ menuPage : InspectorDefinitionMenu ,
3945 menuProps : { dataType : props . type } ,
4046 } ,
4147 }
4248 : {
43- component : CreateDefinitionMenuNav ,
49+ component : InspectorDefinitionMenuNav ,
4450 props : { dataType : props . type } ,
4551 } ,
4652 )
0 commit comments