diff --git a/package.json b/package.json index 27958b3f..4305828a 100644 --- a/package.json +++ b/package.json @@ -122,5 +122,6 @@ "typescript": "^5.3.3", "vite": "^5.0.12", "vite-plugin-svgr": "^4.2.0" - } + }, + "packageManager": "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e" } diff --git a/src/locales/de/translation.json b/src/locales/de/translation.json index dad29fa8..2b1fb9f3 100644 --- a/src/locales/de/translation.json +++ b/src/locales/de/translation.json @@ -21,7 +21,8 @@ "queued": "{{title}} (In Warteschlange)", "game_has_no_executable": "Spiel hat keine ausführbare Datei gewählt", "sign_in": "Anmelden", - "favorites": "Favoriten" + "favorites": "Favoriten", + "playable_button_title": "Nur Spiele anzeigen, die du jetzt spielen kannst" }, "header": { "search": "Spiele suchen", diff --git a/src/locales/en/translation.json b/src/locales/en/translation.json index 4adc5585..ee4254e2 100644 --- a/src/locales/en/translation.json +++ b/src/locales/en/translation.json @@ -27,7 +27,8 @@ "sign_in": "Sign in", "friends": "Friends", "need_help": "Need help?", - "favorites": "Favorites" + "favorites": "Favorites", + "playable_button_title": "Show only games you can play now" }, "header": { "search": "Search games", diff --git a/src/locales/es/translation.json b/src/locales/es/translation.json index 716f7b33..f91a9809 100644 --- a/src/locales/es/translation.json +++ b/src/locales/es/translation.json @@ -27,7 +27,8 @@ "sign_in": "Iniciar sesión", "friends": "Amigos", "need_help": "¿Necesitas ayuda?", - "favorites": "Favoritos" + "favorites": "Favoritos", + "playable_button_title": "Mostrar solo juegos que puedes jugar ahora" }, "header": { "search": "Buscar juegos", diff --git a/src/locales/fr/translation.json b/src/locales/fr/translation.json index aab6e019..e959f98a 100644 --- a/src/locales/fr/translation.json +++ b/src/locales/fr/translation.json @@ -27,7 +27,8 @@ "sign_in": "Se connecter", "friends": "Amis", "need_help": "Besoin d'aide ?", - "favorites": "Favoris" + "favorites": "Favoris", + "playable_button_title": "Afficher uniquement les jeux que vous pouvez jouer maintenant" }, "header": { "search": "Rechercher", diff --git a/src/locales/it/translation.json b/src/locales/it/translation.json index 5e69a733..b23d1244 100644 --- a/src/locales/it/translation.json +++ b/src/locales/it/translation.json @@ -15,7 +15,8 @@ "downloading": "{{title}} ({{percentage}} - Download…)", "filter": "Filtra libreria", "home": "Home", - "favorites": "Preferiti" + "favorites": "Preferiti", + "playable_button_title": "Mostra solo i giochi che puoi giocare ora" }, "header": { "search": "Cerca", diff --git a/src/locales/pl/translation.json b/src/locales/pl/translation.json index 1d55099e..86751b0e 100644 --- a/src/locales/pl/translation.json +++ b/src/locales/pl/translation.json @@ -13,9 +13,10 @@ "downloading_metadata": "{{title}} (Pobieranie metadata…)", "paused": "{{title}} (Zatrzymano)", "downloading": "{{title}} ({{percentage}} - Pobieranie…)", - "filter": "Filtruj biblioteke", + "filter": "Filtruj bibliotekę", "home": "Główna", - "favorites": "Ulubione" + "favorites": "Ulubione", + "playable_button_title": "Pokaż tylko gry, w które możesz grać teraz" }, "header": { "search": "Szukaj", diff --git a/src/locales/ru/translation.json b/src/locales/ru/translation.json index 804e0cc5..7724e10d 100644 --- a/src/locales/ru/translation.json +++ b/src/locales/ru/translation.json @@ -27,7 +27,8 @@ "sign_in": "Войти", "friends": "Друзья", "need_help": "Нужна помощь?", - "favorites": "Избранное" + "favorites": "Избранное", + "playable_button_title": "Показать только игры, в которые можно играть сейчас" }, "header": { "search": "Поиск", diff --git a/src/locales/uk/translation.json b/src/locales/uk/translation.json index bed8a167..48a3972d 100644 --- a/src/locales/uk/translation.json +++ b/src/locales/uk/translation.json @@ -27,7 +27,8 @@ "sign_in": "Увійти", "favorites": "Улюблені", "friends": "Друзі", - "need_help": "Потрібна допомога?" + "need_help": "Потрібна допомога?", + "playable_button_title": "Показати лише ігри, які можна грати зараз" }, "header": { "search": "Пошук", diff --git a/src/renderer/src/components/sidebar/sidebar.scss b/src/renderer/src/components/sidebar/sidebar.scss index b626835f..45b3f598 100644 --- a/src/renderer/src/components/sidebar/sidebar.scss +++ b/src/renderer/src/components/sidebar/sidebar.scss @@ -98,6 +98,12 @@ background-size: cover; } + &__section-header { + display: flex; + justify-content: space-between; + align-items: center; + } + &__section-title { text-transform: uppercase; font-weight: bold; @@ -133,7 +139,11 @@ } &__help-button-icon { - background: linear-gradient(0deg, #16b195 50%, #3e62c0 100%); + background: linear-gradient( + 0deg, + globals.$brand-teal 50%, + globals.$brand-blue 100% + ); width: 24px; height: 24px; display: flex; @@ -142,4 +152,24 @@ color: #fff; border-radius: 50%; } + + &__play-button { + background: none; + border: none; + color: globals.$muted-color; + cursor: pointer; + padding: 0; + + &:active { + color: rgba(255, 255, 255, 0.5); + } + + &--active { + color: globals.$brand-teal; + } + + svg { + display: block; + } + } } diff --git a/src/renderer/src/components/sidebar/sidebar.tsx b/src/renderer/src/components/sidebar/sidebar.tsx index f9c8c47a..42e87e32 100644 --- a/src/renderer/src/components/sidebar/sidebar.tsx +++ b/src/renderer/src/components/sidebar/sidebar.tsx @@ -21,7 +21,7 @@ import { buildGameDetailsPath } from "@renderer/helpers"; import { SidebarProfile } from "./sidebar-profile"; import { sortBy } from "lodash-es"; import cn from "classnames"; -import { CommentDiscussionIcon } from "@primer/octicons-react"; +import { CommentDiscussionIcon, PlayIcon } from "@primer/octicons-react"; import { SidebarGameItem } from "./sidebar-game-item"; import { setFriendRequestCount } from "@renderer/features/user-details-slice"; import { useDispatch } from "react-redux"; @@ -32,6 +32,8 @@ const SIDEBAR_MAX_WIDTH = 450; const initialSidebarWidth = window.localStorage.getItem("sidebarWidth"); +const isGamePlayable = (game: LibraryGame) => Boolean(game.executablePath); + export function Sidebar() { const filterRef = useRef(null); @@ -60,6 +62,12 @@ export function Sidebar() { const { showWarningToast } = useToast(); + const [showPlayableOnly, setShowPlayableOnly] = useState(false); + + const handlePlayButtonClick = () => { + setShowPlayableOnly(!showPlayableOnly); + }; + useEffect(() => { updateLibrary(); }, [lastPacket?.gameId, updateLibrary]); @@ -242,7 +250,20 @@ export function Sidebar() { )}
- {t("my_library")} +
+ + {t("my_library")} + + +
{filteredLibrary .filter((game) => !game.favorite) + .filter((game) => !showPlayableOnly || isGamePlayable(game)) .map((game) => (