addded nameplates

This commit is contained in:
Polaris
2024-07-26 14:08:36 -04:00
parent 5af3b9236b
commit ce82e860bd
5 changed files with 284 additions and 28 deletions

View File

@ -1,6 +1,5 @@
"use server";
//https://github.com/vercel/next.js/discussions/63862
import React from "react";
import { AvatarCustomization } from "@/components/(customization)/avatarcustomization/page";
import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs";
@ -8,8 +7,8 @@ import ChunithmScorePlaylog from "@/components/scoreplaylog/page";
import { getAllAvatarParts } from "@/components/(customization)/avatarcustomization/actions";
import { TrophyCustomization } from "@/components/(customization)/trophycustomization/page";
import { getTrophies } from "@/components/(customization)/trophycustomization/actions";
// the number is the category id for the specific part
import { NameplateCustomization } from "@/components/(customization)/nameplatecustomization/page";
import { getNamePlates } from "@/components/(customization)/nameplatecustomization/actions";
const getAvatarHeadAccessories = async () => {
const avatarParts = await getAllAvatarParts(2); // head
@ -25,19 +24,27 @@ const getAvatarItemAccessories = async () => {
const avatarParts = await getAllAvatarParts(5); // item_l item_r
return { avatarParts };
};
const getAvatarBackAccessories = async () => {
const avatarParts = await getAllAvatarParts(7); // back
return { avatarParts };
};
const getAvatarWearAccessories = async () => {
const avatarParts = await getAllAvatarParts(1); // wear
return { avatarParts };
};
const getAllTrophies = async () => {
const statictrophies = await getTrophies();
return { statictrophies };
};
const getAllNameplates = async () => {
const namePlates = await getNamePlates();
return { namePlates };
};
const Page = async () => {
const AvatarHeadAccessories = await getAvatarHeadAccessories();
const AvatarFaceAccessories = await getAvatarFaceAccessories();
@ -45,6 +52,8 @@ const Page = async () => {
const AvatarBackAccessories = await getAvatarBackAccessories();
const AvatarWearAccessories = await getAvatarWearAccessories();
const AllPlayerTrophies = await getAllTrophies();
const AllStaticNameplates = await getAllNameplates();
return (
<div className="p-10">
<Tabs defaultValue="scores">
@ -65,7 +74,14 @@ const Page = async () => {
avatarWearSelectionData={AvatarWearAccessories}
/>
<div className="pt-4">
<TrophyCustomization allTrophies={AllPlayerTrophies} />
<NameplateCustomization
playerNamePlateSelectionData={AllStaticNameplates}
/>
</div>
<div className="pt-4">
<TrophyCustomization
playerTrophySelectionData={AllPlayerTrophies}
/>
</div>
</div>
<div></div>