mirror of
https://github.com/trafficlunar/tomodachi-share.git
synced 2026-03-28 19:23:15 +00:00
fix: build errors and responsiveness
This commit is contained in:
parent
db5da72a36
commit
1e30bcad69
5 changed files with 44 additions and 43 deletions
|
|
@ -1,3 +1,5 @@
|
||||||
|
"use client";
|
||||||
|
|
||||||
import { ChangeEvent } from "react";
|
import { ChangeEvent } from "react";
|
||||||
import { MiiGender } from "@prisma/client";
|
import { MiiGender } from "@prisma/client";
|
||||||
import { SwitchMiiInstructions } from "@/types";
|
import { SwitchMiiInstructions } from "@/types";
|
||||||
|
|
@ -22,9 +24,7 @@ export default function DatingPreferencesViewer({ data, onChecked }: Props) {
|
||||||
id={gender}
|
id={gender}
|
||||||
className="checkbox"
|
className="checkbox"
|
||||||
checked={data.includes(genderEnum)}
|
checked={data.includes(genderEnum)}
|
||||||
{...(typeof window !== "undefined" && onChecked
|
{...(onChecked ? { onChange: (e: ChangeEvent<HTMLInputElement>) => onChecked(e, genderEnum) } : { readOnly: true })}
|
||||||
? { onChange: (e: ChangeEvent<HTMLInputElement>) => onChecked(e, genderEnum) }
|
|
||||||
: { readOnly: true })}
|
|
||||||
/>
|
/>
|
||||||
<label htmlFor={gender} className="text-sm select-none">
|
<label htmlFor={gender} className="text-sm select-none">
|
||||||
{gender}
|
{gender}
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,7 @@ export default function VoiceViewer({ data, onClick, onClickTone }: Props) {
|
||||||
min={0}
|
min={0}
|
||||||
max={100}
|
max={100}
|
||||||
step={1}
|
step={1}
|
||||||
value={data[label as keyof typeof data]}
|
value={data[label as keyof typeof data] ?? 50}
|
||||||
disabled={!onClick}
|
disabled={!onClick}
|
||||||
onChange={(e) => {
|
onChange={(e) => {
|
||||||
if (onClick) onClick(e, label);
|
if (onClick) onClick(e, label);
|
||||||
|
|
|
||||||
|
|
@ -64,14 +64,15 @@ export default function ColorPicker({ disabled, color, setColor, tab = "hair" }:
|
||||||
|
|
||||||
{isOpen && (
|
{isOpen && (
|
||||||
<div
|
<div
|
||||||
className={`absolute inset-0 z-10 w-full p-4 bg-orange-100 rounded-lg transition-transform duration-500
|
className={`absolute inset-0 z-10 w-full p-0.5 bg-orange-100 rounded-lg transition-transform duration-500 overflow-x-auto
|
||||||
flex items-center ${isVisible ? "opacity-100" : "opacity-0"}`}
|
${isVisible ? "opacity-100" : "opacity-0"}`}
|
||||||
style={{
|
style={{
|
||||||
transition: isVisible
|
transition: isVisible
|
||||||
? "transform 500ms cubic-bezier(0.34, 1.28, 0.64, 1), opacity 300ms"
|
? "transform 500ms cubic-bezier(0.34, 1.28, 0.64, 1), opacity 300ms"
|
||||||
: "transform 1000ms cubic-bezier(0.55, 0, 0.45, 1), opacity 300ms",
|
: "transform 1000ms cubic-bezier(0.55, 0, 0.45, 1), opacity 300ms",
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
|
<div className="w-max flex items-center">
|
||||||
<div className="mr-8 flex flex-col gap-0.5">
|
<div className="mr-8 flex flex-col gap-0.5">
|
||||||
{COLORS.slice(getExtraSlice().start, getExtraSlice().end).map((c, i) => {
|
{COLORS.slice(getExtraSlice().start, getExtraSlice().end).map((c, i) => {
|
||||||
const actualIndex = i + getExtraSlice().start;
|
const actualIndex = i + getExtraSlice().start;
|
||||||
|
|
@ -112,14 +113,11 @@ export default function ColorPicker({ disabled, color, setColor, tab = "hair" }:
|
||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<button
|
<button type="button" onClick={close} className="h-full w-16 ml-4 cursor-pointer transition-transform hover:scale-115 active:scale-90">
|
||||||
type="button"
|
|
||||||
onClick={close}
|
|
||||||
className="absolute h-full w-16 top-0 right-0 cursor-pointer transition-transform hover:scale-115 active:scale-90"
|
|
||||||
>
|
|
||||||
<Icon icon={"tabler:chevron-right"} className="text-4xl" />
|
<Icon icon={"tabler:chevron-right"} className="text-4xl" />
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
)}
|
)}
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
|
|
|
||||||
|
|
@ -51,7 +51,7 @@ export default function MiiEditor({ instructions }: Props) {
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<div className="w-full h-91 flex flex-col sm:flex-row bg-orange-100 border-2 border-orange-200 rounded-xl overflow-hidden">
|
<div className="w-full h-91 flex flex-col sm:flex-row bg-orange-100 border-2 border-orange-200 rounded-xl overflow-hidden">
|
||||||
<div className="h-9 flex flex-row sm:flex-col">
|
<div className="w-full flex flex-row sm:flex-col max-sm:max-h-9 sm:max-w-9">
|
||||||
{(Object.keys(TAB_COMPONENTS) as Tab[]).map((t) => (
|
{(Object.keys(TAB_COMPONENTS) as Tab[]).map((t) => (
|
||||||
<button
|
<button
|
||||||
key={t}
|
key={t}
|
||||||
|
|
|
||||||
|
|
@ -34,7 +34,10 @@ export default function OtherTab({ instructions }: Props) {
|
||||||
return copy;
|
return copy;
|
||||||
});
|
});
|
||||||
|
|
||||||
instructions.current.other[currentTab.name].color = value;
|
const target = instructions.current.other[currentTab.name];
|
||||||
|
if ("color" in target) {
|
||||||
|
target.color = value;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue