diff --git a/src/renderer/src/components/sidebar/sidebar.tsx b/src/renderer/src/components/sidebar/sidebar.tsx index aa0dea8e..28118c83 100644 --- a/src/renderer/src/components/sidebar/sidebar.tsx +++ b/src/renderer/src/components/sidebar/sidebar.tsx @@ -14,12 +14,14 @@ import { import { routes } from "./routes"; -import * as styles from "./sidebar.css"; +import "./sidebar.scss"; + import { buildGameDetailsPath } from "@renderer/helpers"; import SteamLogo from "@renderer/assets/steam-logo.svg?react"; import { SidebarProfile } from "./sidebar-profile"; import { sortBy } from "lodash-es"; +import cn from "classnames"; import { CommentDiscussionIcon } from "@primer/octicons-react"; const SIDEBAR_MIN_WIDTH = 200; @@ -168,9 +170,9 @@ export function Sidebar() { return ( diff --git a/src/renderer/src/components/toast/toast.css.ts b/src/renderer/src/components/toast/toast.css.ts deleted file mode 100644 index 03db1040..00000000 --- a/src/renderer/src/components/toast/toast.css.ts +++ /dev/null @@ -1,97 +0,0 @@ -import { keyframes, style } from "@vanilla-extract/css"; - -import { SPACING_UNIT, vars } from "../../theme.css"; -import { recipe } from "@vanilla-extract/recipes"; - -export const enter = keyframes({ - "0%": { - opacity: 0, - transform: "translateY(100%)", - }, - "100%": { - opacity: 1, - transform: "translateY(0)", - }, -}); - -export const exit = keyframes({ - "0%": { - opacity: 1, - transform: "translateY(0)", - }, - "100%": { - opacity: 0, - transform: "translateY(100%)", - }, -}); - -export const toast = recipe({ - base: { - animationDuration: "0.15s", - animationTimingFunction: "ease-in-out", - maxWidth: "420px", - position: "absolute", - backgroundColor: vars.color.background, - borderRadius: "4px", - border: `solid 1px ${vars.color.border}`, - right: "0", - bottom: "0", - overflow: "hidden", - display: "flex", - flexDirection: "column", - justifyContent: "space-between", - zIndex: vars.zIndex.toast, - }, - variants: { - closing: { - true: { - animationName: exit, - transform: "translateY(100%)", - }, - false: { - animationName: enter, - transform: "translateY(0)", - }, - }, - }, -}); - -export const toastContent = style({ - display: "flex", - gap: `${SPACING_UNIT * 2}px`, - padding: `${SPACING_UNIT * 2}px ${SPACING_UNIT * 2}px`, - justifyContent: "center", - alignItems: "center", -}); - -export const progress = style({ - width: "100%", - height: "3px", - "::-webkit-progress-bar": { - backgroundColor: vars.color.darkBackground, - }, - "::-webkit-progress-value": { - backgroundColor: vars.color.muted, - }, -}); - -export const closeButton = style({ - color: vars.color.body, - cursor: "pointer", - transition: "all ease 0.15s", - ":hover": { - color: vars.color.muted, - }, -}); - -export const successIcon = style({ - color: vars.color.success, -}); - -export const errorIcon = style({ - color: vars.color.danger, -}); - -export const warningIcon = style({ - color: vars.color.warning, -}); diff --git a/src/renderer/src/components/toast/toast.tsx b/src/renderer/src/components/toast/toast.tsx index 34c76a3e..116d26fa 100644 --- a/src/renderer/src/components/toast/toast.tsx +++ b/src/renderer/src/components/toast/toast.tsx @@ -6,12 +6,13 @@ import { XIcon, } from "@primer/octicons-react"; -import * as styles from "./toast.css"; -import { SPACING_UNIT } from "@renderer/theme.css"; +import "./toast.scss"; +import cn from "classnames"; export interface ToastProps { visible: boolean; - message: string; + title: string; + message?: string; type: "success" | "error" | "warning"; duration?: number; onClose: () => void; @@ -21,9 +22,10 @@ const INITIAL_PROGRESS = 100; export function Toast({ visible, + title, message, type, - duration = 5000, + duration = 2500, onClose, }: Readonly) { const [isClosing, setIsClosing] = useState(false); @@ -79,12 +81,16 @@ export function Toast({ if (!visible) return null; return ( -
-
+
+
@@ -93,24 +99,26 @@ export function Toast({ display: "flex", justifyContent: "space-between", alignItems: "center", - gap: `${SPACING_UNIT}px`, + gap: `8px`, }} > {type === "success" && ( - + )} {type === "error" && ( - + )} - {type === "warning" && } + {type === "warning" && ( + + )} - {message} + {title}
-

- This is a really really long message that should wrap to the next - line -

+ {message &&

{message}

}
- +
); } diff --git a/src/renderer/src/pages/achievements/achievement-list.tsx b/src/renderer/src/pages/achievements/achievement-list.tsx index 6066f241..8862ce48 100644 --- a/src/renderer/src/pages/achievements/achievement-list.tsx +++ b/src/renderer/src/pages/achievements/achievement-list.tsx @@ -1,43 +1,38 @@ import { useDate } from "@renderer/hooks"; import type { UserAchievement } from "@types"; import { useTranslation } from "react-i18next"; -import * as styles from "./achievements.css"; +import "./achievements.scss"; import { EyeClosedIcon } from "@primer/octicons-react"; import HydraIcon from "@renderer/assets/icons/hydra.svg?react"; import { useSubscription } from "@renderer/hooks/use-subscription"; -import { vars } from "@renderer/theme.css"; interface AchievementListProps { achievements: UserAchievement[]; } -export function AchievementList({ achievements }: AchievementListProps) { +export function AchievementList({ + achievements, +}: Readonly) { const { t } = useTranslation("achievement"); const { showHydraCloudModal } = useSubscription(); const { formatDateTime } = useDate(); return ( -
    +
      {achievements.map((achievement) => ( -
    • +
    • {achievement.displayName} -
      -

      +
      +

      {achievement.hidden && ( @@ -47,48 +42,36 @@ export function AchievementList({ achievements }: AchievementListProps) {

      {achievement.description}

      -
      + +
      {achievement.points != undefined ? (
      - -

      {achievement.points}

      + +

      + {achievement.points} +

      ) : ( )} {achievement.unlockTime != null && (
      {formatDateTime(achievement.unlockTime)}
      diff --git a/src/renderer/src/pages/downloads/download-group.tsx b/src/renderer/src/pages/downloads/download-group.tsx index 2bd1c67c..8c61672c 100644 --- a/src/renderer/src/pages/downloads/download-group.tsx +++ b/src/renderer/src/pages/downloads/download-group.tsx @@ -12,9 +12,8 @@ import { Downloader, formatBytes, steamUrlBuilder } from "@shared"; import { DOWNLOADER_NAME } from "@renderer/constants"; import { useAppSelector, useDownload } from "@renderer/hooks"; -import * as styles from "./download-group.css"; +import "./download-group.scss"; import { useTranslation } from "react-i18next"; -import { SPACING_UNIT, vars } from "@renderer/theme.css"; import { useMemo } from "react"; import { DropdownMenu, @@ -260,44 +259,26 @@ export function DownloadGroup({ if (!library.length) return null; return ( -
      -
      +
      +

      {title}

      - -
      -

      {library.length}

      +
      +

      {library.length}

      -
        +
          {library.map((game) => { return ( -
        • -
          -
          +
        • +
          +
          {game.title} -
          +
          { DOWNLOADER_NAME[ @@ -308,12 +289,12 @@ export function DownloadGroup({
          -
          -
          -
          +
          +
          +
          + {game.executablePath && ( + + )} + + } + /> + + {game.executablePath && ( +
          + + +
          + )} +
          - - - {game.executablePath && ( - - )} - - } - /> - - {game.executablePath && ( -
          - - -
          - )} - {shouldShowWinePrefixConfiguration && ( -
          -
          +
          +

          {t("wine_prefix")}

          -

          +

          {t("wine_prefix_description")}

          @@ -300,11 +305,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.download?.downloadPath && ( + + )} +
          -
          - - {game.download?.downloadPath && ( +
          +
          +

          {t("danger_zone_section_title")}

          +

          + {t("danger_zone_section_description")} +

          +
          + +
          - )} -
          -
          -

          {t("danger_zone_section_title")}

          -

          - {t("danger_zone_section_description")} -

          -
          + -
          - - - - - + +
          diff --git a/src/renderer/src/pages/game-details/sidebar/sidebar.tsx b/src/renderer/src/pages/game-details/sidebar/sidebar.tsx index 3e11be21..36ee24fd 100644 --- a/src/renderer/src/pages/game-details/sidebar/sidebar.tsx +++ b/src/renderer/src/pages/game-details/sidebar/sidebar.tsx @@ -7,7 +7,6 @@ import type { import { useTranslation } from "react-i18next"; import { Button, Link } from "@renderer/components"; -import * as styles from "./sidebar.css"; import { gameDetailsContext } from "@renderer/context"; import { useDate, useFormat, useUserDetails } from "@renderer/hooks"; import { @@ -20,8 +19,8 @@ import { HowLongToBeatSection } from "./how-long-to-beat-section"; import { howLongToBeatEntriesTable } from "@renderer/dexie"; import { SidebarSection } from "../sidebar-section/sidebar-section"; import { buildGameAchievementPath } from "@renderer/helpers"; -import { SPACING_UNIT } from "@renderer/theme.css"; import { useSubscription } from "@renderer/hooks/use-subscription"; +import "./sidebar.scss"; const achievementsPlaceholder: UserAchievement[] = [ { @@ -64,7 +63,6 @@ export function Sidebar() { }>({ isLoading: true, data: null }); const { userDetails, hasActiveSubscription } = useUserDetails(); - const [activeRequirement, setActiveRequirement] = useState("minimum"); @@ -72,10 +70,8 @@ export function Sidebar() { useContext(gameDetailsContext); const { showHydraCloudModal } = useSubscription(); - const { t } = useTranslation("game_details"); const { formatDateTime } = useDate(); - const { numberFormatter } = useFormat(); useEffect(() => { @@ -118,7 +114,7 @@ export function Sidebar() { }, [objectId, shop, gameTitle]); return ( -