@@ -87,8 +87,8 @@ export const ChallengeBoard: React.FC<ChallengeBoardProps> = ({ onChallengeSelec
8787
8888 const filteredChallenges = mockChallenges . filter ( challenge => {
8989 const matchesSearch = challenge . title . toLowerCase ( ) . includes ( searchTerm . toLowerCase ( ) ) ||
90- challenge . description . toLowerCase ( ) . includes ( searchTerm . toLowerCase ( ) ) ||
91- challenge . tags . some ( tag => tag . toLowerCase ( ) . includes ( searchTerm . toLowerCase ( ) ) ) ;
90+ challenge . description . toLowerCase ( ) . includes ( searchTerm . toLowerCase ( ) ) ||
91+ challenge . tags . some ( tag => tag . toLowerCase ( ) . includes ( searchTerm . toLowerCase ( ) ) ) ;
9292
9393 const matchesDomain = selectedDomain === 'All' || challenge . domain === selectedDomain ;
9494 const matchesDifficulty = selectedDifficulty === 'All' || challenge . difficulty === selectedDifficulty ;
@@ -112,26 +112,26 @@ export const ChallengeBoard: React.FC<ChallengeBoardProps> = ({ onChallengeSelec
112112 } ) ) ;
113113
114114 return (
115- < div className = "min-h-screen bg-gray-50 pt-8" >
115+ < div className = "min-h-screen bg-gray-50 dark:bg-gray-900 pt-8 transition-colors duration-300 " >
116116 < div className = "max-w-7xl mx-auto px-4 sm:px-6 lg:px-8" >
117117 { /* Header */ }
118118 < div className = "mb-8" >
119- < h1 className = "text-3xl font-bold text-gray-900 mb-2" > Challenge Board</ h1 >
120- < p className = "text-gray-600" > Discover real-world challenges to level up your skills</ p >
119+ < h1 className = "text-3xl font-bold text-gray-900 dark:text-white mb-2" > Challenge Board</ h1 >
120+ < p className = "text-gray-600 dark:text-gray-400 " > Discover real-world challenges to level up your skills</ p >
121121 </ div >
122122
123123 { /* Filters */ }
124- < div className = "bg-white rounded-xl shadow-sm border border-gray-200 p-6 mb-8" >
124+ < div className = "bg-white dark:bg-gray-800 rounded-xl shadow-sm border border-gray-200 dark:border-gray-700 p-6 mb-8 transition-colors duration-300 " >
125125 < div className = "flex flex-col lg:flex-row lg:items-center lg:justify-between gap-4" >
126126 { /* Search */ }
127127 < div className = "relative flex-1 max-w-md" >
128- < Search className = "absolute left-3 top-1/2 transform -translate-y-1/2 h-4 w-4 text-gray-400" />
128+ < Search className = "absolute left-3 top-1/2 transform -translate-y-1/2 h-4 w-4 text-gray-400 dark:text-gray-500 " />
129129 < input
130130 type = "text"
131131 placeholder = "Search challenges..."
132132 value = { searchTerm }
133133 onChange = { ( e ) => setSearchTerm ( e . target . value ) }
134- className = "w-full pl-10 pr-4 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-purple-500 focus:border-transparent"
134+ className = "w-full pl-10 pr-4 py-2 border border-gray-300 dark:border-gray-600 rounded-lg focus:outline-none focus:ring-2 focus:ring-purple-500 focus:border-transparent bg-white dark:bg-gray-700 text-gray-900 dark:text-white "
135135 />
136136 </ div >
137137
@@ -140,7 +140,7 @@ export const ChallengeBoard: React.FC<ChallengeBoardProps> = ({ onChallengeSelec
140140 < select
141141 value = { selectedDomain }
142142 onChange = { ( e ) => setSelectedDomain ( e . target . value ) }
143- className = "px-3 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-purple-500 focus:border-transparent"
143+ className = "px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-lg focus:outline-none focus:ring-2 focus:ring-purple-500 focus:border-transparent bg-white dark:bg-gray-700 text-gray-900 dark:text-white "
144144 >
145145 { domains . map ( domain => (
146146 < option key = { domain } value = { domain } > { domain } Domain</ option >
@@ -150,7 +150,7 @@ export const ChallengeBoard: React.FC<ChallengeBoardProps> = ({ onChallengeSelec
150150 < select
151151 value = { selectedDifficulty }
152152 onChange = { ( e ) => setSelectedDifficulty ( e . target . value ) }
153- className = "px-3 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-purple-500 focus:border-transparent"
153+ className = "px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-lg focus:outline-none focus:ring-2 focus:ring-purple-500 focus:border-transparent bg-white dark:bg-gray-700 text-gray-900 dark:text-white "
154154 >
155155 { difficulties . map ( difficulty => (
156156 < option key = { difficulty } value = { difficulty } >
@@ -159,16 +159,24 @@ export const ChallengeBoard: React.FC<ChallengeBoardProps> = ({ onChallengeSelec
159159 ) ) }
160160 </ select >
161161
162- < div className = "flex border border-gray-300 rounded-lg" >
162+ < div className = "flex border border-gray-300 dark:border-gray-600 rounded-lg" >
163163 < button
164164 onClick = { ( ) => setViewMode ( 'grid' ) }
165- className = { `p-2 ${ viewMode === 'grid' ? 'bg-purple-100 text-purple-600' : 'text-gray-600 hover:bg-gray-100' } transition-colors` }
165+ className = { `p-2 transition-colors duration-200 ${
166+ viewMode === 'grid'
167+ ? 'bg-purple-100 text-purple-600 dark:bg-purple-900 dark:text-purple-400'
168+ : 'text-gray-600 dark:text-gray-400 hover:bg-gray-100 dark:hover:bg-gray-700'
169+ } `}
166170 >
167171 < Grid className = "h-4 w-4" />
168172 </ button >
169173 < button
170174 onClick = { ( ) => setViewMode ( 'list' ) }
171- className = { `p-2 ${ viewMode === 'list' ? 'bg-purple-100 text-purple-600' : 'text-gray-600 hover:bg-gray-100' } transition-colors` }
175+ className = { `p-2 transition-colors duration-200 ${
176+ viewMode === 'list'
177+ ? 'bg-purple-100 text-purple-600 dark:bg-purple-900 dark:text-purple-400'
178+ : 'text-gray-600 dark:text-gray-400 hover:bg-gray-100 dark:hover:bg-gray-700'
179+ } `}
172180 >
173181 < List className = "h-4 w-4" />
174182 </ button >
@@ -177,8 +185,8 @@ export const ChallengeBoard: React.FC<ChallengeBoardProps> = ({ onChallengeSelec
177185 </ div >
178186
179187 { /* Results count */ }
180- < div className = "mt-4 pt-4 border-t border-gray-200" >
181- < p className = "text-sm text-gray-600" >
188+ < div className = "mt-4 pt-4 border-t border-gray-200 dark:border-gray-700 " >
189+ < p className = "text-sm text-gray-600 dark:text-gray-400 " >
182190 Showing { challengesWithBookmarks . length } of { mockChallenges . length } challenges
183191 </ p >
184192 </ div >
@@ -190,24 +198,24 @@ export const ChallengeBoard: React.FC<ChallengeBoardProps> = ({ onChallengeSelec
190198 ? 'grid-cols-1 md:grid-cols-2 lg:grid-cols-3'
191199 : 'grid-cols-1'
192200 } `} >
193- { challengesWithBookmarks . map ( ( challenge ) => (
194- < ChallengeCard
195- key = { challenge . id }
196- challenge = { challenge }
197- onSelect = { onChallengeSelect }
198- onBookmark = { handleBookmark }
199- />
200- ) ) }
201+ { challengesWithBookmarks . length > 0 ? (
202+ challengesWithBookmarks . map ( ( challenge ) => (
203+ < ChallengeCard
204+ key = { challenge . id }
205+ challenge = { challenge }
206+ onSelect = { onChallengeSelect }
207+ onBookmark = { handleBookmark }
208+ />
209+ ) )
210+ ) : (
211+ < div className = "text-center py-12 col-span-full" >
212+ < Filter className = "h-12 w-12 text-gray-400 dark:text-gray-600 mx-auto mb-4" />
213+ < h3 className = "text-lg font-medium text-gray-900 dark:text-white mb-2" > No challenges found</ h3 >
214+ < p className = "text-gray-600 dark:text-gray-400" > Try adjusting your search or filters</ p >
215+ </ div >
216+ ) }
201217 </ div >
202-
203- { challengesWithBookmarks . length === 0 && (
204- < div className = "text-center py-12" >
205- < Filter className = "h-12 w-12 text-gray-400 mx-auto mb-4" />
206- < h3 className = "text-lg font-medium text-gray-900 mb-2" > No challenges found</ h3 >
207- < p className = "text-gray-600" > Try adjusting your search or filters</ p >
208- </ div >
209- ) }
210218 </ div >
211219 </ div >
212220 ) ;
213- } ;
221+ } ;
0 commit comments