@@ -25,14 +25,13 @@ const MyCollection = () => {
2525 const [ isSidebarOpen , setIsSidebarOpen ] = useState ( false ) ;
2626 const [ viewMode , setViewMode ] = useState ( 'grid' ) ;
2727 const [ isAuthenticated , setIsAuthenticated ] = useState ( false ) ;
28- const [ token , setToken ] = useState ( null ) ;
2928 const [ isUpdatingPrices , setIsUpdatingPrices ] = useState ( false ) ;
3029 const [ searchTerm , setSearchTerm ] = useState ( "" ) ;
3130 const [ isLoading , setIsLoading ] = useState ( false ) ;
3231 const [ initialData , setInitialData ] = useState ( [ ] ) ;
3332 const [ aggregatedData , setAggregatedData ] = useState ( [ ] ) ;
34- const [ filters , setFilters ] = useState ( { rarity : [ ] , condition : [ ] } ) ;
35- const [ sortConfig , setSortConfig ] = useState ( { key : " number" , direction : "ascending" } ) ;
33+ const [ filters , setFilters ] = useState ( { rarity : [ ] , condition : [ ] , printing : [ ] } ) ;
34+ const [ sortConfig , setSortConfig ] = useState ( { key : ' number' , direction : "ascending" } ) ;
3635 const [ isFilterMenuOpen , setIsFilterMenuOpen ] = useState ( false ) ;
3736 const [ currentPage , setCurrentPage ] = useState ( 1 ) ;
3837 const [ itemsPerPage ] = useState ( 20 ) ;
@@ -42,7 +41,7 @@ const MyCollection = () => {
4241
4342 // Effect to check authentication
4443 // Effect to check authentication
45- useEffect ( ( ) => {
44+ useMemo ( ( ) => {
4645 const validateAuth = async ( ) => {
4746 try {
4847 const response = await fetch ( "/api/auth/validate" , {
@@ -66,11 +65,12 @@ const MyCollection = () => {
6665
6766 const applyFilters = useCallback (
6867 data => {
69- if ( ! filters . rarity . length && ! filters . condition . length ) return data ;
68+ if ( ! filters . rarity . length && ! filters . condition . length && ! filters . printing . length ) return data ;
7069 return data . filter ( card => {
7170 return (
7271 ( ! filters . rarity . length || filters . rarity . includes ( card . rarity ) ) &&
73- ( ! filters . condition . length || filters . condition . includes ( card . condition ) )
72+ ( ! filters . condition . length || filters . condition . includes ( card . condition ) ) &&
73+ ( ! filters . printing . length || filters . printing . includes ( card . printing ) )
7474 ) ;
7575 } ) ;
7676 } ,
@@ -346,9 +346,9 @@ const MyCollection = () => {
346346 ) }
347347 </ div >
348348 { /* Collection Stats */ }
349- < div className = "w-3/4 sm:max-w-[55%] mx-auto p-4 mt-8" >
350- < div className = "glass p-4 rounded-lg" >
351- < h3 className = "text-sm font-semibold text-white/80 mb-3" > Collection Value</ h3 >
349+ < div className = "sm:w-1/3 p-4 mt-8" >
350+ < div className = "text-shadow font-semibold glass p-4 rounded-lg" >
351+ < h3 className = "text-lg text-white/80 mb-3" > Collection Value</ h3 >
352352 < div className = "space-y-2" >
353353 < div className = "flex justify-between" >
354354 < span className = "text-sm" > Total Cards:</ span >
@@ -390,7 +390,7 @@ const MyCollection = () => {
390390 setIsModalOpen = { setIsFilterMenuOpen }
391391 />
392392 { /* View Toggle */ }
393- < div className = "glass flex border border-white/20 rounded-lg overflow-ellipsis w-fit" >
393+ < div className = "glass font-semibold text-shadow flex border border-white/20 rounded-lg overflow-ellipsis w-fit" >
394394 < div className = 'float-left w-1/2' >
395395 < button
396396 onClick = { ( ) => setViewMode ( 'grid' ) }
0 commit comments