diff --git a/src/app/api/submit/route.ts b/src/app/api/submit/route.ts index 46d9583..629793d 100644 --- a/src/app/api/submit/route.ts +++ b/src/app/api/submit/route.ts @@ -254,6 +254,7 @@ export async function POST(request: NextRequest) { const fileLocation = path.join(miiUploadsDirectory, "mii.png"); await fs.writeFile(fileLocation, pngBuffer); + await generateMetadataImage(miiRecord, session.user?.name!); } catch (error) { // Clean up if something went wrong await prisma.mii.delete({ where: { id: miiRecord.id } }); @@ -281,7 +282,6 @@ export async function POST(request: NextRequest) { const codeFileLocation = path.join(miiUploadsDirectory, "qr-code.png"); await fs.writeFile(codeFileLocation, codePngBuffer); - await generateMetadataImage(miiRecord, session.user?.name!); } catch (error) { // Clean up if something went wrong await prisma.mii.delete({ where: { id: miiRecord.id } }); diff --git a/src/components/mii/instructions.tsx b/src/components/mii/instructions.tsx index 85a2644..dcdbdd3 100644 --- a/src/components/mii/instructions.tsx +++ b/src/components/mii/instructions.tsx @@ -149,6 +149,13 @@ export default function MiiInstructions({ instructions }: Props) { )} + {hair.subColor2 && ( + + + + )} + {hair.style && {hair.style}} + {hair.isFlipped && {hair.isFlipped ? "Yes" : "No"}} )} {eyebrows &&
} @@ -164,7 +171,11 @@ export default function MiiInstructions({ instructions }: Props) { )} {nose &&
} - {lips &&
} + {lips && ( +
+ {lips.hasLipstick && {lips.hasLipstick ? "Yes" : "No"}} +
+ )} {ears &&
} {glasses && (
@@ -185,7 +196,9 @@ export default function MiiInstructions({ instructions }: Props) {
-
+
+ {other.moustache && other.moustache.isFlipped && {other.moustache.isFlipped ? "Yes" : "No"}} +
@@ -214,24 +227,24 @@ export default function MiiInstructions({ instructions }: Props) { )} {datingPreferences && ( -
-

Dating Preferences

+
+

Dating Preferences

)} {voice && ( -
-

Voice

+
+

Voice

)} {personality && ( -
-

Personality

+
+

Personality

diff --git a/src/components/mii/list/index.tsx b/src/components/mii/list/index.tsx index 50a8c8c..ebe5530 100644 --- a/src/components/mii/list/index.tsx +++ b/src/components/mii/list/index.tsx @@ -197,7 +197,7 @@ export default async function MiiList({ searchParams, userId, inLikesPage }: Pro `/mii/${mii.id}/image?type=image${index}`), ]} /> diff --git a/src/components/submit-form/mii-editor/tabs/misc.tsx b/src/components/submit-form/mii-editor/tabs/misc.tsx index 1518e9b..655091c 100644 --- a/src/components/submit-form/mii-editor/tabs/misc.tsx +++ b/src/components/submit-form/mii-editor/tabs/misc.tsx @@ -133,7 +133,11 @@ export default function HeadTab({ instructions }: Props) { { - setPersonality((p) => ({ ...p, [key]: i })); + setPersonality((p) => { + const updated = { ...p, [key]: i }; + instructions.current.personality = updated; + return updated; + }); instructions.current.personality = personality; }} /> diff --git a/src/components/submit-form/mii-editor/tabs/other.tsx b/src/components/submit-form/mii-editor/tabs/other.tsx index 0dde7f6..6a4b1e2 100644 --- a/src/components/submit-form/mii-editor/tabs/other.tsx +++ b/src/components/submit-form/mii-editor/tabs/other.tsx @@ -21,13 +21,13 @@ const TABS: { name: keyof SwitchMiiInstructions["other"]; length: number }[] = [ export default function OtherTab({ instructions }: Props) { const [tab, setTab] = useState(0); + const [isFlipped, setIsFlipped] = useState(false); // One type/color state per tab const [types, setTypes] = useState(Array(TABS.length).fill(0)); const [colors, setColors] = useState(Array(TABS.length).fill(0)); const currentTab = TABS[tab]; - const isColorPickerDisabled = currentTab.colorsDisabled ? currentTab.colorsDisabled.includes(types[tab]) : false; const setType = (value: number) => { setTypes((prev) => { @@ -78,8 +78,26 @@ export default function OtherTab({ instructions }: Props) {
- + + + {tab === 3 && ( +
+ { + setIsFlipped(e.target.checked); + instructions.current.other.moustache.isFlipped = e.target.checked; + }} + /> + +
+ )}