diff --git a/src/locales/en/translation.json b/src/locales/en/translation.json index 5ea8fac4..4613f8f4 100644 --- a/src/locales/en/translation.json +++ b/src/locales/en/translation.json @@ -362,6 +362,8 @@ "quit": "Quit" }, "game_card": { + "available_one": "Available", + "available_other": "Available", "no_downloads": "No downloads available" }, "binary_not_found_modal": { diff --git a/src/locales/es/translation.json b/src/locales/es/translation.json index e3fbf2b0..469ae45f 100644 --- a/src/locales/es/translation.json +++ b/src/locales/es/translation.json @@ -362,6 +362,8 @@ "quit": "Salir" }, "game_card": { + "available_one": "Disponible", + "available_other": "Disponibles", "no_downloads": "No hay descargas disponibles" }, "binary_not_found_modal": { diff --git a/src/locales/pt-BR/translation.json b/src/locales/pt-BR/translation.json index f21e8e8f..7f746ac4 100644 --- a/src/locales/pt-BR/translation.json +++ b/src/locales/pt-BR/translation.json @@ -347,6 +347,8 @@ "quit": "Fechar" }, "game_card": { + "available_one": "Disponível", + "available_other": "Disponíveis", "no_downloads": "Sem downloads disponíveis" }, "binary_not_found_modal": { diff --git a/src/locales/ru/translation.json b/src/locales/ru/translation.json index d65ae0f4..ca43ddc5 100644 --- a/src/locales/ru/translation.json +++ b/src/locales/ru/translation.json @@ -360,6 +360,8 @@ "quit": "Выйти" }, "game_card": { + "available_one": "Доступный", + "available_other": "Доступный", "no_downloads": "Нет доступных источников" }, "binary_not_found_modal": { diff --git a/src/renderer/src/components/game-card/game-card.tsx b/src/renderer/src/components/game-card/game-card.tsx index 12dcda49..9859fe1e 100644 --- a/src/renderer/src/components/game-card/game-card.tsx +++ b/src/renderer/src/components/game-card/game-card.tsx @@ -7,7 +7,7 @@ import "./game-card.scss"; import { useTranslation } from "react-i18next"; import { Badge } from "../badge/badge"; -import { useCallback, useState } from "react"; +import { useCallback, useState, useMemo } from "react"; import { useFormat, useRepacks } from "@renderer/hooks"; import { steamUrlBuilder } from "@shared"; @@ -45,6 +45,15 @@ export function GameCard({ game, ...props }: GameCardProps) { const { numberFormatter } = useFormat(); + const firstThreeRepackers = useMemo( + () => uniqueRepackers.slice(0, 3), + [uniqueRepackers] + ); + const remainingCount = useMemo( + () => uniqueRepackers.length - 3, + [uniqueRepackers] + ); + return (