1- import { Button , HStack , Text , VStack , Wrap } from '@chakra-ui/react' ;
1+ import { HStack , Text , VStack , Wrap } from '@chakra-ui/react' ;
22import { ArticleCard , LoadingSpinner } from '@components' ;
33import { useGetArticlesData } from '@services' ;
44import { useLocation , useNavigate } from 'react-router-dom' ;
@@ -7,6 +7,7 @@ import { useMemo, useState } from 'react';
77import { groupBy , sortBy } from 'lodash' ;
88import { BASE_NAV_ROUTE } from '@router' ;
99import SortBy , { SortByType } from './components/SortBy' ;
10+ import SearchFeature from './components/SearchFeature' ;
1011
1112const CategoryButton = ( {
1213 category,
@@ -21,14 +22,13 @@ const CategoryButton = ({
2122} ) => {
2223 const navigate = useNavigate ( ) ;
2324 return (
24- < Button
25+ < Text
2526 w = { '100%' }
2627 color = { 'white' }
27- py = { 3 }
28+ py = { 1 }
2829 px = { 5 }
2930 bg = { isSelected ? 'gray.800' : '' }
3031 fontSize = { 20 }
31- variant = { 'ghost' }
3232 border = { '1px solid gray' }
3333 _hover = { { bg : 'gray.600' , cursor : 'pointer' , color : 'violet' } }
3434 onClick = { ( ) => {
@@ -39,7 +39,7 @@ const CategoryButton = ({
3939 } }
4040 >
4141 { category }
42- </ Button >
42+ </ Text >
4343 ) ;
4444} ;
4545
@@ -92,12 +92,12 @@ const ArticlesScreen = () => {
9292 w = { '100%' }
9393 textAlign = { 'center' }
9494 top = { 2 }
95- zIndex = { 2 }
9695 padding = { 2 }
9796 textShadow = { '2px 2px 4px #000000' }
9897 borderBottom = { '1px solid gray' }
9998 bg = { 'rgba(0, 0, 0, 0.5)' }
10099 backdropFilter = { 'blur(10px)' }
100+ zIndex = { 10 }
101101 >
102102 Articles
103103 </ Text >
@@ -119,30 +119,32 @@ const ArticlesScreen = () => {
119119 < HStack >
120120 < StreakStalker dates = { date } />
121121 < SortBy sortBy = { sortByName } setSortBy = { setSortBy } />
122+ < SearchFeature data = { articles } />
122123 </ HStack >
123- < CategoryButton
124- category = { 'All' }
125- setCategory = { setCategory }
126- secondPath = { secondPath }
127- isSelected = { 'All' === category }
128- />
129- { Object . keys ( filteredArticles ) . map (
130- ( group_name : any , index : number ) => (
131- < CategoryButton
132- key = { index }
133- category = { group_name }
134- setCategory = { setCategory }
135- secondPath = { secondPath }
136- isSelected = { group_name === category }
137- />
138- ) ,
139- ) }
124+ < VStack >
125+ < CategoryButton
126+ category = { 'All' }
127+ setCategory = { setCategory }
128+ secondPath = { secondPath }
129+ isSelected = { 'All' === category }
130+ />
131+ { Object . keys ( filteredArticles ) . map (
132+ ( group_name : any , index : number ) => (
133+ < CategoryButton
134+ key = { index }
135+ category = { group_name }
136+ setCategory = { setCategory }
137+ secondPath = { secondPath }
138+ isSelected = { group_name === category }
139+ />
140+ ) ,
141+ ) }
142+ </ VStack >
140143 </ VStack >
141144 < VStack
142145 w = { '80%' }
143146 id = "projects"
144147 rowGap = { 20 }
145- bg = { 'black' }
146148 paddingTop = { 20 }
147149 justifyContent = { 'flex-start' }
148150 >
0 commit comments