refactor(collection): useCollectionView + view (Brief 3) #88

Merged
varutasu merged 2 commits from refactor/collection-identifier-split-brief-3 into main 2026-06-03 18:10:21 -04:00
2 changed files with 3 additions and 4 deletions
Showing only changes of commit 91a92baa76 - Show all commits

View file

@ -6,7 +6,7 @@ import { downloadCollectionCardsCsv } from './collection-cards-csv.js';
/** /**
* Card/collection page state and handlers (god-component split). * Card/collection page state and handlers (god-component split).
*/ */
export function useCollectionView() { export function useCollectionView({ user = null, authLoading = true } = {}) {
const router = useRouter(); const router = useRouter();
const { identifier } = router.query; const { identifier } = router.query;
@ -435,7 +435,7 @@ export function useCollectionView() {
} }
}); });
const showInitialLoading = loading; const showInitialLoading = authLoading || loading;
return { return {
cards, cards,
@ -456,7 +456,6 @@ export function useCollectionView() {
handleSearchCards, handleSearchCards,
handleToggleFavorite, handleToggleFavorite,
handleToggleSelect, handleToggleSelect,
id,
identifier, identifier,
isFavorited, isFavorited,
loading, loading,

View file

@ -6,7 +6,7 @@ import { useCollectionView } from '../../lib/use-collection-view.js';
export default function CollectionView() { export default function CollectionView() {
const { user, loading: authLoading } = useAuth(); const { user, loading: authLoading } = useAuth();
const collectionPage = useCollectionView(); const collectionPage = useCollectionView({ user, authLoading });
if (collectionPage.showInitialLoading) { if (collectionPage.showInitialLoading) {
return ( return (