mirror of
https://github.com/trafficlunar/tomodachi-share.git
synced 2026-06-27 22:24:14 +00:00
feat: needs fixing miis
This commit is contained in:
parent
781682e24e
commit
4275f710b0
9 changed files with 100 additions and 38 deletions
|
|
@ -86,12 +86,20 @@ export default function MiiList({ parentPage, userId, bypassCache }: Props) {
|
|||
key={mii.id}
|
||||
className={`flex flex-col relative bg-zinc-50 rounded-3xl border-2 shadow-lg p-[0.8rem] transition hover:scale-105 hover:bg-cyan-100 hover:border-cyan-600 ${mii.quarantined ? "border-red-300 bg-red-50!" : mii.in_queue ? "border-zinc-400 opacity-70" : "border-zinc-300"}`}
|
||||
>
|
||||
{mii.in_queue && (
|
||||
<div className="absolute top-2 left-2 z-10 bg-zinc-500 text-white text-xs font-semibold px-2 py-1 rounded-full shadow-sm flex items-center gap-1">
|
||||
<Icon icon="mdi:clock-outline" className="text-base" />
|
||||
In Queue
|
||||
</div>
|
||||
)}
|
||||
<div className="absolute top-2 left-2 z-10 flex flex-col gap-1">
|
||||
{mii.in_queue && (
|
||||
<div className="bg-zinc-500 text-white text-xs font-semibold px-2 py-1 rounded-full shadow-sm flex items-center gap-1 w-fit">
|
||||
<Icon icon="mdi:clock-outline" className="text-base" />
|
||||
In Queue
|
||||
</div>
|
||||
)}
|
||||
{mii.needsFixing && (
|
||||
<div className="bg-orange-500 text-white text-xs font-semibold px-2 py-1 rounded-full shadow-sm flex items-center gap-1 w-fit">
|
||||
<Icon icon="mdi:alert-outline" className="text-base" />
|
||||
Needs Fixing
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
|
||||
<Link to={`/mii/${mii.id}`} className="overflow-hidden rounded-xl bg-zinc-300 shrink-0">
|
||||
<img
|
||||
|
|
|
|||
|
|
@ -54,6 +54,7 @@ export default function EditMiiPage() {
|
|||
const instructions = useRef<SwitchMiiInstructions>(defaultInstructions);
|
||||
|
||||
const [quarantined, setQuarantined] = useState(false);
|
||||
const [needsFixingReason, setNeedsFixingReason] = useState("");
|
||||
const hasCustomImagesChanged = useRef(false);
|
||||
const hasMiiPortraitChanged = useRef(false);
|
||||
const hasMiiFeaturesChanged = useRef(false);
|
||||
|
|
@ -80,6 +81,7 @@ export default function EditMiiPage() {
|
|||
if (makeup != mii.makeup) formData.append("makeup", makeup);
|
||||
if (miiPortraitUri) formData.append("miiPortraitUri", miiPortraitUri);
|
||||
if (quarantined != mii.quarantined) formData.append("quarantined", JSON.stringify(quarantined));
|
||||
if (needsFixingReason !== mii.needsFixing) formData.append("needsFixingReason", needsFixingReason);
|
||||
if (youtubeId != mii.youtubeId) formData.append("youtubeId", youtubeId);
|
||||
if (minifyInstructions(structuredClone(instructions.current)) !== (mii.instructions as object))
|
||||
formData.append("instructions", JSON.stringify(instructions.current));
|
||||
|
|
@ -185,6 +187,7 @@ export default function EditMiiPage() {
|
|||
setMiiFeaturesUri(`${API_URL}/mii/${data.id}/image?type=features`);
|
||||
setYouTubeId(data.youtubeId ?? "");
|
||||
setQuarantined(data.quarantined);
|
||||
setNeedsFixingReason(data.needsFixing);
|
||||
instructions.current = deepMerge(defaultInstructions, (data.instructions as object) ?? {});
|
||||
setLoading(false);
|
||||
})
|
||||
|
|
@ -297,6 +300,22 @@ export default function EditMiiPage() {
|
|||
<input type="checkbox" id="quarantined" className="checkbox-alt" checked={quarantined} onChange={(e) => setQuarantined(e.target.checked)} />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="w-full grid grid-cols-3 items-center">
|
||||
<label htmlFor="needsFixing" className="font-semibold py-2">
|
||||
Needs Fixing
|
||||
</label>
|
||||
|
||||
<div className="col-span-2 flex gap-1">
|
||||
<input
|
||||
id="needsFixing"
|
||||
placeholder="Put the reason here..."
|
||||
className="pill input w-full col-span-2"
|
||||
value={needsFixingReason ?? ""}
|
||||
onChange={(e) => setNeedsFixingReason(e.target.value)}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</>
|
||||
)}
|
||||
|
||||
|
|
|
|||
|
|
@ -101,6 +101,16 @@ export default function MiiPage() {
|
|||
</p>
|
||||
</div>
|
||||
)}
|
||||
{mii.needsFixing && (
|
||||
<div className="bg-orange-50 border-2 border-orange-400 rounded-2xl shadow-lg p-4 flex items-start gap-3 text-orange-700">
|
||||
<Icon icon="material-symbols:warning-rounded" className="text-2xl shrink-0" />
|
||||
<p className="font-medium">
|
||||
This Mii won't show up on the main page until fixes are made.
|
||||
<br />
|
||||
Reason: {mii.needsFixing}
|
||||
</p>
|
||||
</div>
|
||||
)}
|
||||
<div className="relative grid grid-cols-3 gap-4 max-md:grid-cols-1">
|
||||
<div className="bg-amber-50 rounded-3xl border-2 border-amber-500 shadow-lg p-4 h-min flex flex-col items-center max-w-md w-full max-md:place-self-center max-md:row-start-2">
|
||||
{/* Mii Image */}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue