From 28a2f1dda5796eda394f887f4ffa5152926b3f75 Mon Sep 17 00:00:00 2001 From: Hachi-R Date: Tue, 21 Jan 2025 17:41:58 -0300 Subject: [PATCH] refactor: fix some styles in game details modals --- .../modals/download-settings-modal.scss | 3 +- .../modals/game-options-modal.scss | 68 ++++- .../modals/game-options-modal.tsx | 234 +++++++++--------- 3 files changed, 189 insertions(+), 116 deletions(-) diff --git a/src/renderer/src/pages/game-details/modals/download-settings-modal.scss b/src/renderer/src/pages/game-details/modals/download-settings-modal.scss index 5aa58197..d98a95ad 100644 --- a/src/renderer/src/pages/game-details/modals/download-settings-modal.scss +++ b/src/renderer/src/pages/game-details/modals/download-settings-modal.scss @@ -10,11 +10,12 @@ &__downloads-path-field { display: flex; + flex-direction: column; gap: globals.$spacing-unit; } &__hint-text { - font-size: globals.$small-font-size; + font-size: 12px; color: globals.$body-color; } diff --git a/src/renderer/src/pages/game-details/modals/game-options-modal.scss b/src/renderer/src/pages/game-details/modals/game-options-modal.scss index 0a3c0246..00113260 100644 --- a/src/renderer/src/pages/game-details/modals/game-options-modal.scss +++ b/src/renderer/src/pages/game-details/modals/game-options-modal.scss @@ -7,18 +7,80 @@ flex-direction: column; } - &__header { + &__section { display: flex; flex-direction: column; gap: globals.$spacing-unit; } - &__header-description { - font-weight: 400; + &__header { + display: flex; + flex-direction: column; + gap: globals.$spacing-unit; + + &-description { + font-weight: 400; + } } &__row { display: flex; gap: globals.$spacing-unit; } + + &__executable-field { + display: flex; + flex-direction: column; + gap: globals.$spacing-unit; + + &-input { + width: 100%; + } + + &-buttons { + display: flex; + gap: globals.$spacing-unit; + } + } + + &__wine-prefix { + display: flex; + flex-direction: column; + gap: calc(globals.$spacing-unit * 2); + + &-input { + width: 100%; + } + } + + &__launch-options { + display: flex; + flex-direction: column; + gap: globals.$spacing-unit; + + &-input { + width: 100%; + } + } + + &__downloads { + display: flex; + flex-direction: column; + gap: globals.$spacing-unit; + } + + &__danger-zone { + display: flex; + flex-direction: column; + gap: globals.$spacing-unit; + + &-description { + font-weight: 400; + } + + &-buttons { + display: flex; + gap: globals.$spacing-unit; + } + } } diff --git a/src/renderer/src/pages/game-details/modals/game-options-modal.tsx b/src/renderer/src/pages/game-details/modals/game-options-modal.tsx index 2a826c04..ec6a8b07 100644 --- a/src/renderer/src/pages/game-details/modals/game-options-modal.tsx +++ b/src/renderer/src/pages/game-details/modals/game-options-modal.tsx @@ -2,7 +2,6 @@ import { useContext, useRef, useState } from "react"; import { useTranslation } from "react-i18next"; import { Button, Modal, TextField } from "@renderer/components"; import type { Game } from "@types"; -import * as styles from "./game-options-modal.css"; import { gameDetailsContext } from "@renderer/context"; import { DeleteGameModal } from "@renderer/pages/downloads/delete-game-modal"; import { useDownload, useToast, useUserDetails } from "@renderer/hooks"; @@ -179,14 +178,12 @@ export function GameOptionsModal({ onClose={() => setShowDeleteModal(false)} deleteGame={handleDeleteGame} /> - setShowRemoveGameModal(false)} removeGameFromLibrary={handleRemoveGameFromLibrary} game={game} /> - setShowResetAchievementsModal(false)} @@ -201,58 +198,65 @@ export function GameOptionsModal({ large={true} >
-
-

{t("executable_section_title")}

-

- {t("executable_section_description")} -

+
+
+

{t("executable_section_title")}

+

+ {t("executable_section_description")} +

+
+ +
+ + + {game.executablePath && ( + + )} + + } + /> + + {game.executablePath && ( +
+ + +
+ )} +
- - - {game.executablePath && ( - - )} - - } - /> - - {game.executablePath && ( -
- - -
- )} - {shouldShowWinePrefixConfiguration && ( -
-
+
+

{t("wine_prefix")}

-

+

{t("wine_prefix_description")}

@@ -287,11 +291,13 @@ export function GameOptionsModal({ )} {shouldShowLaunchOptionsConfiguration && ( -
-

{t("launch_options")}

-

- {t("launch_options_description")} -

+
+
+

{t("launch_options")}

+

+ {t("launch_options_description")} +

+
)} -
-

{t("downloads_secion_title")}

-

- {t("downloads_section_description")} -

+
+
+

{t("downloads_secion_title")}

+

+ {t("downloads_section_description")} +

+
+ +
+ + {game.downloadPath && ( + + )} +
-
- - {game.downloadPath && ( +
+
+

{t("danger_zone_section_title")}

+

+ {t("danger_zone_section_description")} +

+
+ +
- )} -
-
-

{t("danger_zone_section_title")}

-

- {t("danger_zone_section_description")} -

-
+ -
- - - - - + +