fix: create game-item__plus-wrapper--added classname

This commit is contained in:
Victor Sales
2025-06-21 14:38:01 -03:00
parent c7ecd541d5
commit 6a94c3c812
2 changed files with 10 additions and 11 deletions

View File

@@ -16,6 +16,11 @@
&:hover {
background-color: rgba(255, 255, 255, 0.05);
.game-item__plus-wrapper {
opacity: 1;
pointer-events: auto;
}
}
&__plus-wrapper {
@@ -28,16 +33,7 @@
cursor: pointer;
}
&:hover .game-item__plus-wrapper {
opacity: 1;
pointer-events: auto;
}
&__plus-wrapper.added {
opacity: 0.5;
}
&:hover .game-item__plus-wrapper.added {
&__plus-wrapper--added {
opacity: 0.5;
}

View File

@@ -8,6 +8,7 @@ import "./game-item.scss";
import { useTranslation } from "react-i18next";
import { CatalogueSearchResult } from "@types";
import { QuestionIcon, PlusIcon, CheckIcon } from "@primer/octicons-react";
import cn from "classnames";
export interface GameItemProps {
game: CatalogueSearchResult;
@@ -116,7 +117,9 @@ export function GameItem({ game }: GameItemProps) {
</div>
</div>
<div
className={"game-item__plus-wrapper" + (added ? " added" : "")}
className={cn("game-item__plus-wrapper", {
"game-item__plus-wrapper--added": added,
})}
role="button"
tabIndex={0}
onClick={addGameToLibrary}