mirror of
https://github.com/trafficlunar/tomodachi-share.git
synced 2026-05-13 13:17:45 +00:00
fix: admin page issues
This commit is contained in:
parent
ce1c7a667a
commit
e81f054e3a
1 changed files with 10 additions and 3 deletions
|
|
@ -9,6 +9,7 @@ import { Icon } from "@iconify/react";
|
||||||
import LikeButton from "../../like-button";
|
import LikeButton from "../../like-button";
|
||||||
import { useStore } from "@nanostores/react";
|
import { useStore } from "@nanostores/react";
|
||||||
import { session } from "../../../session";
|
import { session } from "../../../session";
|
||||||
|
import Carousel from "../../carousel";
|
||||||
|
|
||||||
interface ApiResponse {
|
interface ApiResponse {
|
||||||
totalCount: number;
|
totalCount: number;
|
||||||
|
|
@ -79,7 +80,7 @@ export default function MiiList({ parentPage, userId }: Props) {
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
<Link to={`/mii/${mii.id}`} className="overflow-hidden rounded-xl bg-zinc-300 shrink-0">
|
{parentPage !== "admin" ? <Link to={`/mii/${mii.id}`} className="overflow-hidden rounded-xl bg-zinc-300 shrink-0">
|
||||||
<img
|
<img
|
||||||
src={`${import.meta.env.VITE_API_URL}/mii/${mii.id}/image?type=mii`}
|
src={`${import.meta.env.VITE_API_URL}/mii/${mii.id}/image?type=mii`}
|
||||||
width={240}
|
width={240}
|
||||||
|
|
@ -87,7 +88,13 @@ export default function MiiList({ parentPage, userId }: Props) {
|
||||||
alt="mii image"
|
alt="mii image"
|
||||||
className="w-full h-auto aspect-3/2 object-contain"
|
className="w-full h-auto aspect-3/2 object-contain"
|
||||||
/>
|
/>
|
||||||
</Link>
|
</Link> : <Carousel
|
||||||
|
images={[
|
||||||
|
`${import.meta.env.VITE_API_URL}/mii/${mii.id}/image?type=mii`,
|
||||||
|
...(mii.platform === "THREE_DS" ? [`${import.meta.env.VITE_API_URL}/mii/${mii.id}/image?type=qr-code`] : [`${import.meta.env.VITE_API_URL}/mii/${mii.id}/image?type=features`]),
|
||||||
|
...Array.from({ length: mii.imageCount }, (_, index) => `${import.meta.env.VITE_API_URL}/mii/${mii.id}/image?type=image${index}`),
|
||||||
|
]}
|
||||||
|
/>}
|
||||||
|
|
||||||
<div className="p-4 flex flex-col gap-1 h-full">
|
<div className="p-4 flex flex-col gap-1 h-full">
|
||||||
<div className="flex justify-between">
|
<div className="flex justify-between">
|
||||||
|
|
@ -134,7 +141,7 @@ export default function MiiList({ parentPage, userId }: Props) {
|
||||||
<div className="flex gap-1 text-3xl justify-center">
|
<div className="flex gap-1 text-3xl justify-center">
|
||||||
<button
|
<button
|
||||||
onClick={async () => {
|
onClick={async () => {
|
||||||
await fetch(`/api/admin/accept-mii?id=${mii.id}`, { method: "PATCH" });
|
await fetch(`${import.meta.env.VITE_API_URL}/api/admin/accept-mii?id=${mii.id}`, { method: "PATCH", credentials: "include" });
|
||||||
}}
|
}}
|
||||||
className="cursor-pointer text-zinc-400 hover:text-green-500 transition-colors p-1 bg-white rounded-md shadow-sm border border-zinc-200 hover:border-green-500"
|
className="cursor-pointer text-zinc-400 hover:text-green-500 transition-colors p-1 bg-white rounded-md shadow-sm border border-zinc-200 hover:border-green-500"
|
||||||
title="Accept Mii"
|
title="Accept Mii"
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue