diff --git a/src/app/ModelingPage.js b/src/app/ModelingPage.js index 6b11c49..1b71041 100644 --- a/src/app/ModelingPage.js +++ b/src/app/ModelingPage.js @@ -18,46 +18,76 @@ function ModelingPage() { return ( Modeling Hub - Item models we need - + ); } -function ItemModelsList() { +function ItemModelsSection() { const { loading, error, data } = useQuery(gql` query ModelingPage { - itemsThatNeedModels { - id - name - thumbnailUrl + standardItems: itemsThatNeedModels { + ...ItemFields speciesThatNeedModels { id name } } + babyItems: itemsThatNeedModels(colorId: "6") { + ...ItemFields + speciesThatNeedModels(colorId: "6") { + id + name + } + } + + maraquanItems: itemsThatNeedModels(colorId: "44") { + ...ItemFields + speciesThatNeedModels(colorId: "44") { + id + name + } + } + + mutantItems: itemsThatNeedModels(colorId: "46") { + ...ItemFields + speciesThatNeedModels(colorId: "46") { + id + name + } + } + currentUser { itemsTheyOwn { id } } } + + fragment ItemFields on Item { + id + name + thumbnailUrl + } `); if (loading) { return ( - - - - Checking all the items… + <> + Items we need modeled + + + + Checking all the items… + - + ); } @@ -65,15 +95,47 @@ function ItemModelsList() { return {error.message}; } - const items = data.itemsThatNeedModels - // enough MMEs are broken that I just don't want to deal right now! - .filter((item) => !item.name.includes("MME")) - .sort((a, b) => a.name.localeCompare(b.name)); - const ownedItemIds = new Set( data.currentUser?.itemsTheyOwn?.map((item) => item.id) ); + return ( + <> + Items we need modeled + + + Items we need modeled on Baby pets + + + + Items we need modeled on Maraquan pets + + + Items we need modeled on Mutant pets + + + ); +} + +function ItemModelsColorSection({ items, ownedItemIds }) { + items = items + // enough MMEs are broken that I just don't want to deal right now! + // TODO: solve this with our new database omission feature instead? + .filter((item) => !item.name.includes("MME")) + .sort((a, b) => a.name.localeCompare(b.name)); + return ( {items.map((item) => (