@@ -24,6 +24,7 @@ export interface ProjectDialogProps {
24
24
function ProjectsDialog ( props : ProjectDialogProps ) {
25
25
const classes = useStyles ( ) ;
26
26
const { onClose, open, projects } = props ;
27
+ console . log ( projects )
27
28
const state = useSelector ( ( store :RootState ) => store . appState ) ;
28
29
const dispatch = useDispatch ( ) ;
29
30
// If no projects selected, keep the name of the current displayed
@@ -40,6 +41,14 @@ function ProjectsDialog(props: ProjectDialogProps) {
40
41
dispatch ( openProject ( selectedProject ) )
41
42
onClose ( ) ;
42
43
} ;
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
+
43
52
return (
44
53
< Dialog
45
54
onClose = { handleClose }
@@ -48,20 +57,44 @@ function ProjectsDialog(props: ProjectDialogProps) {
48
57
>
49
58
< DialogTitle style = { { color : "#000" } } id = "project-dialog-title" > Open Project</ DialogTitle >
50
59
< 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
+ } ) }
65
98
</ List >
66
99
</ Dialog >
67
100
) ;
0 commit comments