feat: add link to game in achievements page

This commit is contained in:
Zamitto 2024-10-19 13:45:21 -03:00
parent f7b9a88219
commit 89bb099caa
3 changed files with 21 additions and 9 deletions

View File

@ -18,7 +18,6 @@ jobs:
uses: actions/setup-node@v4
with:
node-version: 20.11.1
cache: "yarn"
- name: Install dependencies
run: yarn
@ -27,7 +26,6 @@ jobs:
uses: actions/setup-python@v5
with:
python-version: 3.9
cache: "pip"
- name: Install dependencies
run: pip install -r requirements.txt

View File

@ -4,7 +4,10 @@ import { steamUrlBuilder } from "@shared";
import { useContext, useEffect, useMemo, useRef, useState } from "react";
import { useTranslation } from "react-i18next";
import * as styles from "./achievements.css";
import { formatDownloadProgress } from "@renderer/helpers";
import {
buildGameDetailsPath,
formatDownloadProgress,
} from "@renderer/helpers";
import {
CheckCircleIcon,
LockIcon,
@ -16,6 +19,7 @@ import { gameDetailsContext } from "@renderer/context";
import { UserAchievement } from "@types";
import { average } from "color.js";
import Color from "color";
import { Link } from "@renderer/components";
interface UserInfo {
userId: string;
@ -95,7 +99,9 @@ function AchievementSummary({ user, isComparison }: AchievementSummaryProps) {
}}
>
<LockIcon size={24} />
<h3>{t("subscription_needed")}</h3>
<h3>
<Link to={""}>{t("subscription_needed")}</Link>
</h3>
</div>
<div
style={{
@ -403,11 +409,15 @@ export function AchievementsContent({ otherUser }: AchievementsContentProps) {
>
<div ref={heroRef} className={styles.hero}>
<div className={styles.heroContent}>
<img
src={steamUrlBuilder.logo(objectId)}
className={styles.gameLogo}
alt={gameTitle}
/>
<Link
to={buildGameDetailsPath({ shop, objectId, title: gameTitle })}
>
<img
src={steamUrlBuilder.logo(objectId)}
className={styles.gameLogo}
alt={gameTitle}
/>
</Link>
</div>
</div>

View File

@ -62,6 +62,10 @@ export const gameLogo = style({
width: LOGO_MAX_WIDTH,
height: LOGO_HEIGHT,
objectFit: "contain",
transition: "all ease 0.2s",
":hover": {
transform: "scale(1.05)",
},
});
export const container = style({