@@ -453,25 +453,27 @@ const MyCollection = () => {
453453 } , [ hasCards ] ) ;
454454
455455 const renderViewToggle = ( ) => (
456- < div className = "rounded-sm border border-white/20 bg-white/10 text-sm font-semibold text-white/80" >
457- < button
458- type = "button"
459- onClick = { ( ) => setViewMode ( "grid" ) }
460- className = { ` flex items-center gap-2 px-4 py-2 transition ${ viewMode === "grid" ? "bg-purple-600 text-white" : "hover:bg-white/10"
461- } ` }
462- >
463- < Grid className = "h-4 w-4" />
464- Grid
465- </ button >
466- < button
467- type = "button"
468- onClick = { ( ) => setViewMode ( "table" ) }
469- className = { `flex items-center gap-2 px-4 py-2 transition ${ viewMode === "table" ? "bg-purple-600 text-white rounded-lg" : "hover:bg-white/10"
470- } ` }
471- >
472- < List className = "h-4 w-4" />
473- Table
474- </ button >
456+ < div className = "flex-grow ml-5 w-full flex items-center justify-around md:justify-between space-x-4" >
457+ < span className = "inline-flex" >
458+ < button
459+ type = "button"
460+ onClick = { ( ) => setViewMode ( "grid" ) }
461+ className = { `p-2 inline-flex justify-center items-center transition ${ viewMode === "grid" ? "bg-purple-600 text-white" : "hover:bg-white/10"
462+ } ` }
463+ >
464+ < Grid className = "h-4 w-4" />
465+ Grid
466+ </ button >
467+ < button
468+ type = "button"
469+ onClick = { ( ) => setViewMode ( "table" ) }
470+ className = { `p-2 ml-2 inline-flex justify-center items-center transition ${ viewMode === "table" ? "bg-purple-600 text-white rounded-lg" : "hover:bg-white/10"
471+ } ` }
472+ >
473+ < List className = "h-4 w-4" />
474+ Table
475+ </ button >
476+ </ span >
475477 </ div >
476478 ) ;
477479
@@ -503,16 +505,16 @@ const MyCollection = () => {
503505 } else {
504506 content = (
505507 < div className = "space-y-10 mx-auto h-full yugioh-bg bg-fixed bg-center bg-no-repeat" >
506- < header className = "space-y-6 rounded-3xl border border-white/10 bg-black/30 backdrop" >
507- < div className = "space-y-2" >
508+ < header className = "space-y-6 rounded-3xl border border-white/10 bg-black/30 backdrop p-2 " >
509+ < div className = "space-y-2 text-center sm:text-left text-pretty " >
508510 < h1 className = "text-3xl font-bold text-shadow md:text-4xl" > My Yu-Gi-Oh! Collection</ h1 >
509511 < p className = "text-white/70" >
510512 Track cards, monitor market prices, and manage your collection with powerful tools.
511513 </ p >
512514 </ div >
513515
514- < div className = "max-w-full w-[80%] sm:w-full mx-auto sm:mx-0 flex flex-col gap-6 lg:flex-row lg:items-center lg:justify-between " >
515- < div className = "grid w-auto gap-4 sm:grid-cols-3" >
516+ < div className = "max-w-full sm:w-fit mx-auto inline- flex flex-col gap-6 lg:flex-row lg:items-center lg:justify-items-stretch " >
517+ < div className = "grid gap-4 sm:grid-cols-3" >
516518 < div className = "glass rounded-2xl border border-white/10 p-5" >
517519 < p className = "text-xs uppercase tracking-wide text-white/60" > Total cards</ p >
518520 < p className = "mt-2 text-3xl font-semibold text-white" > { totalOwnedCards } </ p >
@@ -532,9 +534,9 @@ const MyCollection = () => {
532534 </ header >
533535
534536 < section className = "space-y-6 border border-white/10 p-6 backdrop mx-auto" >
535- < div className = "flex flex-col gap-4 xl :flex-row xl: items-center xl: justify-between" >
536- < div className = "relative w-auto max-w-xl " >
537- < Search className = "pointer-events-none absolute left -4 top-1/2 h-5 w-5 -translate-y-1/2 text-white/50" />
537+ < div className = "py-5 sm:px-4 flex flex-col-reverse md :flex-row items-center justify-between" >
538+ < div className = "flex-shrink-0 mt-5 md:mt-0 max-w-sm sm: max-w-none w-full md:w-auto grid sm:grid-flow-col grid-cols-1 sm:auto-cols-fr gap-4 " >
539+ < Search className = "pointer-events-none absolute mt -4 ml-5 h-5 w-5 text-white/50" />
538540 < input
539541 type = "text"
540542 value = { searchValue }
@@ -547,15 +549,7 @@ const MyCollection = () => {
547549
548550 </ div >
549551
550- { activeFilterBadges . length > 0 && (
551- < div className = "flex flex-wrap gap-2 text-sm text-white/70" >
552- { activeFilterBadges . map ( ( badge ) => (
553- < span key = { badge . id } className = "glass rounded-full px-3 py-1" >
554- { badge . label }
555- </ span >
556- ) ) }
557- </ div >
558- ) }
552+
559553
560554 < div className = "flex flex-wrap items-center gap-3" >
561555 < button
@@ -605,7 +599,9 @@ const MyCollection = () => {
605599 Clear filters
606600 </ button >
607601 ) }
602+
608603 </ div >
604+
609605 { totalItems > ITEMS_PER_PAGE && (
610606 < YugiohPagination
611607 currentPage = { currentPage }
@@ -638,12 +634,22 @@ const MyCollection = () => {
638634 < p className = "mt-2" > Add cards to start tracking your inventory and market prices.</ p >
639635 </ div >
640636 < div className = "flex max-h-24 h-fit items-center gap-3" >
637+
641638 < CardFilter
642639 filters = { filters }
643640 updateFilters = { handleFilterChange }
644641 isModalOpen = { isFilterMenuOpen }
645642 setIsModalOpen = { setIsFilterMenuOpen }
646643 />
644+ { activeFilterBadges . length > 0 && (
645+ < div className = "flex flex-wrap gap-2 text-sm text-white/70" >
646+ { activeFilterBadges . map ( ( badge ) => (
647+ < span key = { badge . id } className = "glass rounded-full px-3 py-1" >
648+ { badge . label }
649+ </ span >
650+ ) ) }
651+ </ div >
652+ ) }
647653 { activeFilterBadges . length > 0 && (
648654 < button
649655 type = "button"
@@ -653,9 +659,13 @@ const MyCollection = () => {
653659 Clear filters
654660 </ button >
655661 ) }
662+
656663 </ div >
664+
657665 </ >
666+
658667 ) }
668+
659669 </ section >
660670 </ div >
661671 ) ;
0 commit comments