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 uses: actions/setup-node@v4
with: with:
node-version: 20.11.1 node-version: 20.11.1
cache: "yarn"
- name: Install dependencies - name: Install dependencies
run: yarn run: yarn
@ -27,7 +26,6 @@ jobs:
uses: actions/setup-python@v5 uses: actions/setup-python@v5
with: with:
python-version: 3.9 python-version: 3.9
cache: "pip"
- name: Install dependencies - name: Install dependencies
run: pip install -r requirements.txt 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 { useContext, useEffect, useMemo, useRef, useState } from "react";
import { useTranslation } from "react-i18next"; import { useTranslation } from "react-i18next";
import * as styles from "./achievements.css"; import * as styles from "./achievements.css";
import { formatDownloadProgress } from "@renderer/helpers"; import {
buildGameDetailsPath,
formatDownloadProgress,
} from "@renderer/helpers";
import { import {
CheckCircleIcon, CheckCircleIcon,
LockIcon, LockIcon,
@ -16,6 +19,7 @@ import { gameDetailsContext } from "@renderer/context";
import { UserAchievement } from "@types"; import { UserAchievement } from "@types";
import { average } from "color.js"; import { average } from "color.js";
import Color from "color"; import Color from "color";
import { Link } from "@renderer/components";
interface UserInfo { interface UserInfo {
userId: string; userId: string;
@ -95,7 +99,9 @@ function AchievementSummary({ user, isComparison }: AchievementSummaryProps) {
}} }}
> >
<LockIcon size={24} /> <LockIcon size={24} />
<h3>{t("subscription_needed")}</h3> <h3>
<Link to={""}>{t("subscription_needed")}</Link>
</h3>
</div> </div>
<div <div
style={{ style={{
@ -403,11 +409,15 @@ export function AchievementsContent({ otherUser }: AchievementsContentProps) {
> >
<div ref={heroRef} className={styles.hero}> <div ref={heroRef} className={styles.hero}>
<div className={styles.heroContent}> <div className={styles.heroContent}>
<img <Link
src={steamUrlBuilder.logo(objectId)} to={buildGameDetailsPath({ shop, objectId, title: gameTitle })}
className={styles.gameLogo} >
alt={gameTitle} <img
/> src={steamUrlBuilder.logo(objectId)}
className={styles.gameLogo}
alt={gameTitle}
/>
</Link>
</div> </div>
</div> </div>

View File

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