11import React , { useEffect , useState } from 'react' ;
22
33import { Box , FlexBox , H3 , FullWidthSpinner } from '../../../../../components' ;
4+ import { SidePopup } from '../SidePopup' ;
45
56import { StackBox } from '../../../../common/StackBox' ;
67import { CustomStackBox } from '../../../../common/CustomStackBox' ;
@@ -31,6 +32,7 @@ export const GetList: React.FC<Props> = ({
3132 const locationPath = useLocation ( ) as any ;
3233 const [ fetching , setFetching ] = useState ( false ) ;
3334 const [ list , setlist ] = useState ( [ ] ) ;
35+ const [ showPopup , setShowPopup ] = useState < boolean > ( false ) ;
3436 const selectedWorkspace = useSelector ( workspaceSelectors . selectedWorkspace ) ;
3537
3638 useEffect ( ( ) => {
@@ -105,15 +107,21 @@ export const GetList: React.FC<Props> = ({
105107 < StackBox stackName = "Create" stackDesc = "Create a stack" />
106108 </ div >
107109 </ Box >
108- { list ?. map ( ( item : any ) => (
109- < Box marginLeft = "md" >
110+ { list ?. map ( ( item : any ) => {
111+
112+ const checkboxValue = selectedStack . filter ( ( s : any ) => {
113+ return s . id === item . id ;
114+ } ) ;
115+
116+ return (
117+ < Box marginLeft = "md" style = { { cursor : 'pointer' } } onClick = { ( ) => setShowPopup ( true ) } >
110118 < CustomStackBox
111119 image = { item ?. logoUrl }
112120 stackName = { item . name }
113- stackDesc = { item ?. flavor }
114- value = { false }
115- onCheck = { ( ) => {
116- // var selectedList = selectedStack;
121+ stackDesc = { item ?. flavor . name }
122+ value = { checkboxValue ?. length > 0 ? true : false }
123+ onCheck = { ( e : any ) => {
124+ e . stopPropagation ( )
117125 var index = selectedStack . findIndex ( function ( s : any ) {
118126 return s . id === item . id ;
119127 } ) ;
@@ -126,8 +134,29 @@ export const GetList: React.FC<Props> = ({
126134 } }
127135 />
128136 </ Box >
129- ) ) }
137+ )
138+ } ) }
130139 </ FlexBox . Row >
140+
141+
142+ { showPopup && (
143+ < SidePopup
144+ isCreate = { false }
145+ onSeeExisting = { ( ) => { } }
146+ onClose = { ( ) => setShowPopup ( false ) }
147+ >
148+ < Box marginTop = "md" >
149+ { /* <FormTextField
150+ onChange={(e: any) => {}}
151+ placeholder=""
152+ label='Stack Name'
153+ value={selectedStackBox.name}
154+ /> */ }
155+ </ Box >
156+ </ SidePopup >
157+ ) }
158+
159+
131160 </ >
132161 ) ;
133162} ;
0 commit comments