Skip to content

Commit

Permalink
fix genshin image load
Browse files Browse the repository at this point in the history
  • Loading branch information
djsisson committed Nov 7, 2024
1 parent a553962 commit fc05d3f
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 17 deletions.
9 changes: 0 additions & 9 deletions src/app/genshin/components/Character.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -96,17 +96,8 @@ export default function Character({ data }: { data: Cities }) {
currentCharacter={currentCharacter.name}
handleTouchEnd={handleTouchEnd}
handleTouchStart={handleTouchStart}
setCharacterLoading={setCharacterLoading}
/>
))}
{/* {currentCharacter.name && (
<Profile
currentCharacter={currentCharacter.name}
handleTouchEnd={handleTouchEnd}
handleTouchStart={handleTouchStart}
setCharacterLoading={setCharacterLoading}
/>
)} */}
<div className="absolute left-[35%] top-[20%] z-20 h-[30%] w-[30%] max-w-96 sm:left-[25%]">
{currentCharacter.name && <CharInfo character={currentCharacter} />}
</div>
Expand Down
9 changes: 1 addition & 8 deletions src/app/genshin/components/Profile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,16 @@ export default function Profile({
currentCharacter,
handleTouchEnd,
handleTouchStart,
setCharacterLoading,
charName,
}: {
currentCharacter: string;
handleTouchEnd: (e: React.TouchEvent<HTMLDivElement>) => void;
handleTouchStart: (e: React.TouchEvent<HTMLDivElement>) => void;
setCharacterLoading: React.Dispatch<React.SetStateAction<boolean>>;
charName: string;
}) {
return (
<div
className={`absolute left-0 top-0 z-20 h-svh w-svw overflow-clip ${currentCharacter != charName && "hidden"}`}
className={`absolute left-0 top-0 h-svh w-svw overflow-clip ${currentCharacter != charName && "opacity-0"} ${currentCharacter == charName ? "z-20" : "z-0"}`}
>
<Image
onTouchEnd={(e) => handleTouchEnd(e)}
Expand All @@ -33,11 +31,6 @@ export default function Profile({
alt={charName}
fill={true}
priority={currentCharacter == charName}
// onLoad={(e) => {
// setCharacterLoading(false);
// e.currentTarget.classList.add("animate-slide-in");
// e.currentTarget.classList.remove("opacity-0");
// }}
placeholder="blur"
/>
</div>
Expand Down

0 comments on commit fc05d3f

Please sign in to comment.