1- import React from 'react' ;
1+ import React , { useState } from 'react' ;
22import RoadmapCard from './RoadmapCard' ;
33import { getOnlyBgStatusColor , statusTextColor } from '../../utils/roadmapHelpers' ;
4+ import { EyeIcon , EyeSlashIcon } from '@phosphor-icons/react' ; // Import eye icons
45
56const RoadmapView = ( { issuesData = [ ] } ) => {
7+ const [ hiddenColumns , setHiddenColumns ] = useState ( [ ] ) ; // State to track hidden columns
8+
9+ const toggleColumnVisibility = ( status ) => {
10+ if ( hiddenColumns . includes ( status ) ) {
11+ setHiddenColumns ( hiddenColumns . filter ( ( s ) => s !== status ) ) ; // Show column
12+ } else {
13+ setHiddenColumns ( [ ...hiddenColumns , status ] ) ; // Hide column
14+ }
15+ } ;
16+
617 const groupedApps = issuesData . reduce ( ( acc , app ) => {
718 const status = app . status || 'Planned' ; // Default to Planned if not specified
819 if ( ! acc [ status ] ) {
@@ -16,23 +27,37 @@ const RoadmapView = ({ issuesData = [] }) => {
1627
1728 return (
1829 < div className = "grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6" >
19- { statusOrder . map ( ( status ) => (
20- < div key = { status } className = "bg-gray-900/70 backdrop-blur-sm rounded-xl shadow-lg p-4 border border-gray-800" >
21- < h3
22- className = { `text-lg font-mono tracking-wider mb-4 flex items-center gap-2 text-white` }
23- >
24- < span
25- className = { `w-3 h-3 rounded-full ${ getOnlyBgStatusColor ( status ) } ${ statusTextColor ( status ) } ` }
26- > </ span >
27- { status } ({ groupedApps [ status ] ?. length || 0 } )
28- </ h3 >
29- < div className = "space-y-4" >
30- { groupedApps [ status ] ?. map ( ( app , appIndex ) => (
31- < RoadmapCard key = { app . id } app = { app } index = { appIndex } />
32- ) ) }
30+ { statusOrder . map ( ( status ) => {
31+ const isHidden = hiddenColumns . includes ( status ) ;
32+ return (
33+ < div key = { status } className = "bg-gray-900/70 backdrop-blur-sm rounded-xl shadow-lg p-4 border border-gray-800" >
34+ < h3
35+ className = { `text-lg font-mono tracking-wider mb-4 flex items-center justify-between text-white` }
36+ >
37+ < span className = "flex items-center gap-2" >
38+ < span
39+ className = { `w-3 h-3 rounded-full ${ getOnlyBgStatusColor ( status ) } ${ statusTextColor ( status ) } ` }
40+ > </ span >
41+ { status } ({ groupedApps [ status ] ?. length || 0 } )
42+ </ span >
43+ < button
44+ onClick = { ( ) => toggleColumnVisibility ( status ) }
45+ className = "text-gray-400 hover:text-white transition-colors"
46+ title = { isHidden ? 'Show column' : 'Hide column' }
47+ >
48+ { isHidden ? < EyeSlashIcon size = { 20 } /> : < EyeIcon size = { 20 } /> }
49+ </ button >
50+ </ h3 >
51+ { ! isHidden && (
52+ < div className = "space-y-4" >
53+ { groupedApps [ status ] ?. map ( ( app , appIndex ) => (
54+ < RoadmapCard key = { app . id } app = { app } index = { appIndex } />
55+ ) ) }
56+ </ div >
57+ ) }
3358 </ div >
34- </ div >
35- ) ) }
59+ ) ;
60+ } ) }
3661 </ div >
3762 ) ;
3863} ;
0 commit comments