@@ -24,6 +24,7 @@ export interface ProjectDialogProps {
2424function ProjectsDialog ( props : ProjectDialogProps ) {
2525 const classes = useStyles ( ) ;
2626 const { onClose, open, projects } = props ;
27+ console . log ( projects )
2728 const state = useSelector ( ( store :RootState ) => store . appState ) ;
2829 const dispatch = useDispatch ( ) ;
2930 // If no projects selected, keep the name of the current displayed
@@ -40,6 +41,14 @@ function ProjectsDialog(props: ProjectDialogProps) {
4041 dispatch ( openProject ( selectedProject ) )
4142 onClose ( ) ;
4243 } ;
44+ // these two filter between user projects and market projects
45+ // const userProjects = projects.filter((project: any) => {
46+ // project.forked === undefined
47+ // })
48+ // const marketProjects = projects.filter((project: any) => {
49+ // project.forked !== undefined
50+ // })
51+
4352 return (
4453 < Dialog
4554 onClose = { handleClose }
@@ -48,20 +57,44 @@ function ProjectsDialog(props: ProjectDialogProps) {
4857 >
4958 < DialogTitle style = { { color : "#000" } } id = "project-dialog-title" > Open Project</ DialogTitle >
5059 < List style = { { color : "#000" } } >
51- { projects . map ( ( project : any , index : number ) => (
52- < ListItem
53- button
54- onClick = { ( ) => handleListItemClick ( project . name ) }
55- key = { index }
56- >
57- < ListItemAvatar >
58- < Avatar className = { classes . avatar } >
59- < FolderOpenIcon />
60- </ Avatar >
61- </ ListItemAvatar >
62- < ListItemText primary = { project . name } />
63- </ ListItem >
64- ) ) }
60+ { projects . filter ( ( project : any ) => project . forked === undefined ) . map ( ( project : any , index : number ) => {
61+ console . log ( "Logging something inside the map:" , project . forked ) ; // Add this line
62+ return (
63+ < ListItem
64+ button
65+ onClick = { ( ) => handleListItemClick ( project . name ) }
66+ key = { index }
67+ >
68+ < ListItemAvatar >
69+ < Avatar className = { classes . avatar } >
70+ < FolderOpenIcon />
71+ </ Avatar >
72+ </ ListItemAvatar >
73+ < ListItemText primary = { project . name } />
74+ </ ListItem >
75+ ) ;
76+ } ) }
77+ </ List >
78+ { /* this section handles the projects cloned from the marketplace */ }
79+ < DialogTitle style = { { color : "#000" } } id = "project-dialog-title" > MP Projects</ DialogTitle >
80+ < List style = { { color : "#000" } } >
81+ { projects . filter ( ( project : any ) => project . forked !== undefined ) . map ( ( project : any , index : number ) => {
82+ console . log ( "Logging something inside the second map:" , project . forked ) ; // Add this line
83+ return (
84+ < ListItem
85+ button
86+ onClick = { ( ) => handleListItemClick ( project . name ) }
87+ key = { index }
88+ >
89+ < ListItemAvatar >
90+ < Avatar className = { classes . avatar } >
91+ < FolderOpenIcon />
92+ </ Avatar >
93+ </ ListItemAvatar >
94+ < ListItemText primary = { project . name } />
95+ </ ListItem >
96+ ) ;
97+ } ) }
6598 </ List >
6699 </ Dialog >
67100 ) ;
0 commit comments