From 3156baf78e118ad86c017cd5e3590197434f8315 Mon Sep 17 00:00:00 2001
From: Shisuys
Date: Sat, 11 Jan 2025 11:40:48 -0300
Subject: [PATCH 1/6] Limit visible sources
---
src/locales/pt-BR/translation.json | 1 +
.../src/components/game-card/game-card.tsx | 29 ++++++++++++-------
2 files changed, 19 insertions(+), 11 deletions(-)
diff --git a/src/locales/pt-BR/translation.json b/src/locales/pt-BR/translation.json
index 9c51e68e..563d9f27 100644
--- a/src/locales/pt-BR/translation.json
+++ b/src/locales/pt-BR/translation.json
@@ -280,6 +280,7 @@
"quit": "Fechar"
},
"game_card": {
+ "available": "Disponível",
"no_downloads": "Sem downloads disponíveis"
},
"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 d51a322b..95f15a8e 100644
--- a/src/renderer/src/components/game-card/game-card.tsx
+++ b/src/renderer/src/components/game-card/game-card.tsx
@@ -44,6 +44,9 @@ export function GameCard({ game, ...props }: GameCardProps) {
const { numberFormatter } = useFormat();
+ const firstThreeRepackers = uniqueRepackers.slice(0, 3);
+ const remainingCount = uniqueRepackers.length - 3;
+
return (
- {uniqueRepackers.length > 0 ? (
-
- {uniqueRepackers.map((repacker) => (
- -
- {repacker}
-
- ))}
-
- ) : (
- {t("no_downloads")}
- )}
+
+ {uniqueRepackers.length > 0 ? (
+ <>
+ {firstThreeRepackers.map((repacker) => (
+
{repacker}
+ ))}
+ {remainingCount > 0 && (
+
+{remainingCount} {t("available")}
+ )}
+ >
+ ) : (
+
{t("no_downloads")}
+ )}
+
+
From e804b92f30eff2a4218fb01ffa05d23e26668b00 Mon Sep 17 00:00:00 2001
From: Shisuys
Date: Sat, 11 Jan 2025 11:50:22 -0300
Subject: [PATCH 2/6] Update game-card.tsx
---
src/renderer/src/components/game-card/game-card.tsx | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/src/renderer/src/components/game-card/game-card.tsx b/src/renderer/src/components/game-card/game-card.tsx
index 95f15a8e..7960fb6e 100644
--- a/src/renderer/src/components/game-card/game-card.tsx
+++ b/src/renderer/src/components/game-card/game-card.tsx
@@ -9,6 +9,7 @@ import { Badge } from "../badge/badge";
import { useCallback, useState } from "react";
import { useFormat, useRepacks } from "@renderer/hooks";
import { steamUrlBuilder } from "@shared";
+import { useMemo } from "react";
export interface GameCardProps
extends React.DetailedHTMLProps<
@@ -44,8 +45,8 @@ export function GameCard({ game, ...props }: GameCardProps) {
const { numberFormatter } = useFormat();
- const firstThreeRepackers = uniqueRepackers.slice(0, 3);
- const remainingCount = uniqueRepackers.length - 3;
+ const firstThreeRepackers = useMemo(() => uniqueRepackers.slice(0, 3), [uniqueRepackers]);
+ const remainingCount = useMemo(() => uniqueRepackers.length - 3, [uniqueRepackers]);
return (
-
-
-
-
- {stats ? numberFormatter.format(stats?.playerCount) : "…"}
-
-
-
From dddc5bfd96a34ddc79cfded2ce1df3be003b43be Mon Sep 17 00:00:00 2001
From: Shisuys
Date: Tue, 11 Feb 2025 19:17:58 -0300
Subject: [PATCH 6/6] Update game-card.tsx
---
.../src/components/game-card/game-card.tsx | 66 +++++++++----------
1 file changed, 33 insertions(+), 33 deletions(-)
diff --git a/src/renderer/src/components/game-card/game-card.tsx b/src/renderer/src/components/game-card/game-card.tsx
index 8423ebc1..9859fe1e 100644
--- a/src/renderer/src/components/game-card/game-card.tsx
+++ b/src/renderer/src/components/game-card/game-card.tsx
@@ -75,40 +75,40 @@ export function GameCard({ game, ...props }: GameCardProps) {
{game.title}
-{uniqueRepackers.length > 0 ? (
-
- {firstThreeRepackers.map((repacker) => (
- -
- {repacker}
-
- ))}
- {remainingCount > 0 && (
- -
-
- +{remainingCount} {t("game_card:available", { count: remainingCount })}
-
-
- )}
-
-) : (
- {t("no_downloads")}
-)}
-
-
-
-
-
- {stats ? numberFormatter.format(stats.downloadCount) : "…"}
-
-
-
-
-
- {stats ? numberFormatter.format(stats.playerCount) : "…"}
-
-
-
+ {uniqueRepackers.length > 0 ? (
+
+ {firstThreeRepackers.map((repacker) => (
+ -
+ {repacker}
+
+ ))}
+ {remainingCount > 0 && (
+ -
+
+ +{remainingCount}{" "}
+ {t("game_card:available", { count: remainingCount })}
+
+
+ )}
+
+ ) : (
+ {t("no_downloads")}
+ )}
+
+
+
+
+ {stats ? numberFormatter.format(stats.downloadCount) : "…"}
+
+
+
+
+
+ {stats ? numberFormatter.format(stats.playerCount) : "…"}
+
+
+