mirror of
https://github.com/trafficlunar/tomodachi-share.git
synced 2026-09-27 19:41:46 +00:00
Compare commits
No commits in common. "59866a00a5c6e341966bbec337bdc17c389384d2" and "ba06950881dbb9338fa7b7df18b12f2233ac4044" have entirely different histories.
59866a00a5
...
ba06950881
6 changed files with 95 additions and 124 deletions
Binary file not shown.
|
Before Width: | Height: | Size: 20 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 145 KiB |
|
|
@ -80,93 +80,87 @@ export default function MiiList({ parentPage, userId, bypassCache }: Props) {
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<p className="text-xs mb-2 text-zinc-600 text-right">Not finding what you're looking for? Try including controversial Miis in filters.</p>
|
<div className="grid grid-cols-4 gap-4 max-lg:grid-cols-3 max-md:grid-cols-2 max-[30rem]:grid-cols-1">
|
||||||
|
{data.miis.map((mii) => (
|
||||||
|
<div
|
||||||
|
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"}`}
|
||||||
|
>
|
||||||
|
<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>
|
||||||
|
|
||||||
{data.miis.length !== 0 ? (
|
<Link to={`/mii/${mii.id}`} className="overflow-hidden rounded-xl bg-zinc-300 shrink-0">
|
||||||
<div className="grid grid-cols-4 gap-4 max-lg:grid-cols-3 max-md:grid-cols-2 max-[30rem]:grid-cols-1">
|
<img
|
||||||
{data.miis.map((mii) => (
|
src={`${import.meta.env.VITE_API_URL}/mii/${mii.id}/image?type=mii`}
|
||||||
<div
|
width={240}
|
||||||
key={mii.id}
|
height={160}
|
||||||
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"}`}
|
alt="mii image"
|
||||||
>
|
className="w-full h-auto aspect-3/2 object-contain"
|
||||||
<div className="absolute top-2 left-2 z-10 flex flex-col gap-1">
|
/>
|
||||||
{mii.in_queue && (
|
</Link>
|
||||||
<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" />
|
<div className="p-4 flex flex-col gap-1 h-full">
|
||||||
In Queue
|
<div className="flex justify-between">
|
||||||
</div>
|
<Link to={`/mii/${mii.id}`} className="relative font-bold text-2xl line-clamp-1 w-full text-ellipsis wrap-break-word" title={mii.name}>
|
||||||
)}
|
{mii.name}
|
||||||
{mii.needsFixing && (
|
</Link>
|
||||||
<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">
|
<div title={mii.platform === "SWITCH" ? "Switch" : "3DS"} className="text-[1.25rem] opacity-25">
|
||||||
<Icon icon="mdi:alert-outline" className="text-base" />
|
{mii.platform === "SWITCH" ? (
|
||||||
Needs Fixing
|
<Icon icon="cib:nintendo-switch" className="text-red-400" />
|
||||||
</div>
|
) : (
|
||||||
)}
|
<Icon icon="cib:nintendo-3ds" className="text-sky-400" />
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<Link to={`/mii/${mii.id}`} className="overflow-hidden rounded-xl bg-zinc-300 shrink-0">
|
<div id="tags" className="flex flex-wrap gap-1">
|
||||||
<img
|
{mii.tags.map((tag: string) => (
|
||||||
src={`${import.meta.env.VITE_API_URL}/mii/${mii.id}/image?type=mii`}
|
<Link to={`?tags=${tag}`} key={tag} className="px-2 py-1 bg-orange-300 rounded-full text-xs">
|
||||||
width={240}
|
{tag}
|
||||||
height={160}
|
|
||||||
alt="mii image"
|
|
||||||
className="w-full h-auto aspect-3/2 object-contain"
|
|
||||||
/>
|
|
||||||
</Link>
|
|
||||||
|
|
||||||
<div className="p-4 flex flex-col gap-1 h-full">
|
|
||||||
<div className="flex justify-between">
|
|
||||||
<Link to={`/mii/${mii.id}`} className="relative font-bold text-2xl line-clamp-1 w-full text-ellipsis wrap-break-word" title={mii.name}>
|
|
||||||
{mii.name}
|
|
||||||
</Link>
|
</Link>
|
||||||
<div title={mii.platform === "SWITCH" ? "Switch" : "3DS"} className="text-[1.25rem] opacity-25">
|
))}
|
||||||
{mii.platform === "SWITCH" ? (
|
</div>
|
||||||
<Icon icon="cib:nintendo-switch" className="text-red-400" />
|
|
||||||
) : (
|
<div className="mt-auto grid grid-cols-2 items-center">
|
||||||
<Icon icon="cib:nintendo-3ds" className="text-sky-400" />
|
<LikeButton likes={mii.likeCount} miiId={mii.id} isLiked={likedIds.has(mii.id)} abbreviate />
|
||||||
)}
|
|
||||||
|
{!userId && (
|
||||||
|
<Link to={`/profile/${mii.user?.id}`} className="text-sm text-right overflow-hidden text-ellipsis whitespace-nowrap">
|
||||||
|
@{mii.user?.name}
|
||||||
|
</Link>
|
||||||
|
)}
|
||||||
|
|
||||||
|
{userId && Number($session?.user?.id) == userId && (
|
||||||
|
<div className="flex gap-1 text-2xl justify-end text-zinc-400">
|
||||||
|
<Link to={`/edit/${mii.id}`} title="Edit Mii" aria-label="Edit Mii" data-tooltip="Edit">
|
||||||
|
<Icon icon="mdi:pencil" />
|
||||||
|
</Link>
|
||||||
|
<DeleteMiiButton miiId={mii.id} miiName={mii.name} likes={mii.likeCount} />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
)}
|
||||||
|
|
||||||
<div id="tags" className="flex flex-wrap gap-1">
|
|
||||||
{mii.tags.map((tag: string) => (
|
|
||||||
<Link to={`?tags=${tag}`} key={tag} className="px-2 py-1 bg-orange-300 rounded-full text-xs">
|
|
||||||
{tag}
|
|
||||||
</Link>
|
|
||||||
))}
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="mt-auto grid grid-cols-2 items-center">
|
|
||||||
<LikeButton likes={mii.likeCount} miiId={mii.id} isLiked={likedIds.has(mii.id)} abbreviate />
|
|
||||||
|
|
||||||
{!userId && (
|
|
||||||
<Link to={`/profile/${mii.user?.id}`} className="text-sm text-right overflow-hidden text-ellipsis whitespace-nowrap">
|
|
||||||
@{mii.user?.name}
|
|
||||||
</Link>
|
|
||||||
)}
|
|
||||||
|
|
||||||
{userId && Number($session?.user?.id) == userId && (
|
|
||||||
<div className="flex gap-1 text-2xl justify-end text-zinc-400">
|
|
||||||
<Link to={`/edit/${mii.id}`} title="Edit Mii" aria-label="Edit Mii" data-tooltip="Edit">
|
|
||||||
<Icon icon="mdi:pencil" />
|
|
||||||
</Link>
|
|
||||||
<DeleteMiiButton miiId={mii.id} miiName={mii.name} likes={mii.likeCount} />
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
))}
|
</div>
|
||||||
</div>
|
))}
|
||||||
) : (
|
</div>
|
||||||
<p className="text-2xl font-bold text-center">No Miis found!</p>
|
|
||||||
)}
|
|
||||||
<Pagination lastPage={data.lastPage} />
|
<Pagination lastPage={data.lastPage} />
|
||||||
</div>
|
</div>
|
||||||
) : (
|
) : (
|
||||||
<>
|
<>
|
||||||
<p className="text-2xl font-bold *:text-center">No Miis found, has the server died?</p>
|
<p className="text-2xl text-center">No Miis found, has the server died?</p>
|
||||||
<p className="text-center">Try refreshing!</p>
|
<p className="text-center font-bold text-lg">Please try refreshing first!</p>
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
</>
|
</>
|
||||||
|
|
|
||||||
|
|
@ -161,19 +161,17 @@ export default function Tutorial({ tutorials, isOpen, setIsOpen }: Props) {
|
||||||
{slide.text}
|
{slide.text}
|
||||||
</a>
|
</a>
|
||||||
) : (
|
) : (
|
||||||
<p className={`mb-2 text-center ${slide.imageSrc ? "text-sm" : "text-lg font-medium mt-auto mb-auto"}`}>{slide.text}</p>
|
<p className="text-sm text-zinc-500 mb-2 text-center">{slide.text}</p>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{slide.imageSrc && (
|
<img
|
||||||
<img
|
src={slide.imageSrc ?? "/missing.svg"}
|
||||||
src={slide.imageSrc ?? "/missing.svg"}
|
alt="step image"
|
||||||
alt="step image"
|
width={396}
|
||||||
width={396}
|
height={320}
|
||||||
height={320}
|
loading="eager"
|
||||||
loading="eager"
|
className="rounded-lg w-full h-full object-contain bg-black flex-1"
|
||||||
className="rounded-lg w-full h-full object-contain bg-black flex-1"
|
/>
|
||||||
/>
|
|
||||||
)}
|
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -3,11 +3,7 @@ import { createPortal } from "react-dom";
|
||||||
import { Icon } from "@iconify/react";
|
import { Icon } from "@iconify/react";
|
||||||
import Tutorial from ".";
|
import Tutorial from ".";
|
||||||
|
|
||||||
interface Props {
|
export default function SwitchAddMiiTutorialButton() {
|
||||||
hasShareMiiFile: boolean;
|
|
||||||
}
|
|
||||||
|
|
||||||
export default function SwitchAddMiiTutorialButton({ hasShareMiiFile }: Props) {
|
|
||||||
const [isOpen, setIsOpen] = useState(false);
|
const [isOpen, setIsOpen] = useState(false);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|
@ -26,37 +22,20 @@ export default function SwitchAddMiiTutorialButton({ hasShareMiiFile }: Props) {
|
||||||
thumbnail: "/tutorial/switch/adding-mii/modded/thumbnail.png",
|
thumbnail: "/tutorial/switch/adding-mii/modded/thumbnail.png",
|
||||||
steps: [
|
steps: [
|
||||||
{ type: "start" },
|
{ type: "start" },
|
||||||
...(hasShareMiiFile
|
{
|
||||||
? [
|
text: "1. Download ShareMii - click here for link",
|
||||||
{
|
link: "https://gamebanana.com/tools/22305",
|
||||||
text: "1. Download ShareMii - click here for link",
|
imageSrc: "/tutorial/switch/adding-mii/modded/step1.jpg",
|
||||||
link: "https://gamebanana.com/tools/22305",
|
},
|
||||||
imageSrc: "/tutorial/switch/adding-mii/modded/step1.jpg",
|
{
|
||||||
},
|
text: "2. Download the .ltd file, it is above the instructions next to all the other buttons",
|
||||||
{
|
imageSrc: "/tutorial/switch/adding-mii/modded/step2.png",
|
||||||
text: "2. Download the .ltd file, it is above the instructions next to all the other buttons",
|
},
|
||||||
imageSrc: "/tutorial/switch/adding-mii/modded/step2.png",
|
{
|
||||||
},
|
text: "3. Follow the instructions by the creator (scroll down to importing) - click here for link",
|
||||||
{
|
link: "https://docs.google.com/document/d/e/2PACX-1vRSaPbTe0pijDSETzdeGhvQ7zYHlx9Qnxn7WdUqG9cveZYyk405A0LSbYnl8ygTNI_ZZqMrIZLeHenr/pub",
|
||||||
text: "3. Follow the instructions by the creator (scroll down to importing) - click here for link",
|
imageSrc: "/tutorial/switch/adding-mii/modded/step3.jpg",
|
||||||
link: "https://docs.google.com/document/d/e/2PACX-1vRSaPbTe0pijDSETzdeGhvQ7zYHlx9Qnxn7WdUqG9cveZYyk405A0LSbYnl8ygTNI_ZZqMrIZLeHenr/pub",
|
},
|
||||||
imageSrc: "/tutorial/switch/adding-mii/modded/step3.jpg",
|
|
||||||
},
|
|
||||||
]
|
|
||||||
: [
|
|
||||||
{ text: "This Mii does not have a ShareMii file. You can filter the search to only show Miis that do: (go to next step)" },
|
|
||||||
{
|
|
||||||
text: "1. Go back to the search page, open the filters and press 'Has ShareMii File'",
|
|
||||||
imageSrc: "/tutorial/switch/adding-mii/modded/filter.png",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
text: "2. The search will automatically update to show only Miis with ShareMii files",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
text: "3. Open the tutorial again on those Miis to find out how to use the ShareMii file. (You should see this as the first step)",
|
|
||||||
imageSrc: "/tutorial/switch/adding-mii/modded/success.png",
|
|
||||||
},
|
|
||||||
]),
|
|
||||||
{ type: "finish" },
|
{ type: "finish" },
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -388,7 +388,7 @@ export default function MiiPage() {
|
||||||
<Icon icon="material-symbols:flag-rounded" />
|
<Icon icon="material-symbols:flag-rounded" />
|
||||||
<span>Report</span>
|
<span>Report</span>
|
||||||
</Link>
|
</Link>
|
||||||
{mii.platform === "THREE_DS" ? <ThreeDsScanTutorialButton /> : <SwitchAddMiiTutorialButton hasShareMiiFile={mii.isFromSaveFile} />}
|
{mii.platform === "THREE_DS" ? <ThreeDsScanTutorialButton /> : <SwitchAddMiiTutorialButton />}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* Instructions */}
|
{/* Instructions */}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue