mirror of
https://github.com/hydralauncher/hydra.git
synced 2025-02-09 03:37:45 +03:00
full migration to scss
This commit is contained in:
parent
d038398750
commit
138244d5aa
@ -46,7 +46,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
.toast__content {
|
||||
&__content {
|
||||
display: flex;
|
||||
gap: $spacing-unit * 2;
|
||||
padding: $spacing-unit * 2;
|
||||
@ -54,7 +54,7 @@
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.toast__progress {
|
||||
&__progress {
|
||||
width: 100%;
|
||||
height: 5px;
|
||||
|
||||
@ -67,21 +67,26 @@
|
||||
}
|
||||
}
|
||||
|
||||
.toast__close-button {
|
||||
&__close-button {
|
||||
color: $body-color;
|
||||
cursor: pointer;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.toast__success-icon {
|
||||
&__icon-container {
|
||||
display: flex;
|
||||
gap: var(--spacing-unit);
|
||||
}
|
||||
|
||||
&__success-icon {
|
||||
color: $success-color;
|
||||
}
|
||||
|
||||
.toast__error-icon {
|
||||
&__error-icon {
|
||||
color: $danger-color;
|
||||
}
|
||||
|
||||
.toast__warning-icon {
|
||||
&__warning-icon {
|
||||
color: $warning-color;
|
||||
}
|
||||
|
@ -83,7 +83,7 @@ export function Toast({ visible, message, type, onClose }: ToastProps) {
|
||||
})}
|
||||
>
|
||||
<div className="toast__content">
|
||||
<div style={{ display: "flex", gap: `${SPACING_UNIT}px` }}>
|
||||
<div className="toast__icon-container">
|
||||
{type === "success" && (
|
||||
<CheckCircleFillIcon className="toast__success-icon" />
|
||||
)}
|
||||
|
@ -36,7 +36,7 @@ export function AchievementPanel({ achievements }: AchievementPanelProps) {
|
||||
<button
|
||||
type="button"
|
||||
onClick={() => showHydraCloudModal("achievements-points")}
|
||||
className={styles.link}
|
||||
className="achievement-panel__link"
|
||||
>
|
||||
<small style={{ color: "#ffc107" }}>
|
||||
{t("how_to_earn_achievements_points")}
|
||||
|
@ -142,9 +142,9 @@ export function AchievementsContent({
|
||||
|
||||
setGameColor(backgroundColor);
|
||||
};
|
||||
const HERO_HEIGHT = 150;
|
||||
const HERO_HEIGHT = 150;
|
||||
|
||||
const onScroll: React.UIEventHandler<HTMLElement> = (event) => {
|
||||
const onScroll: React.UIEventHandler<HTMLElement> = (event) => {
|
||||
const heroHeight = heroRef.current?.clientHeight ?? HERO_HEIGHT;
|
||||
|
||||
const scrollY = (event.target as HTMLDivElement).scrollTop;
|
||||
@ -155,7 +155,7 @@ const onScroll: React.UIEventHandler<HTMLElement> = (event) => {
|
||||
if (scrollY <= heroHeight && isHeaderStuck) {
|
||||
setIsHeaderStuck(false);
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
const getProfileImage = (
|
||||
user: Pick<UserInfo, "profileImageUrl" | "displayName">
|
||||
|
@ -1,11 +1,12 @@
|
||||
import { useTranslation } from "react-i18next";
|
||||
import * as styles from "./achievement-panel.css";
|
||||
|
||||
import HydraIcon from "@renderer/assets/icons/hydra.svg?react";
|
||||
import { ComparedAchievements } from "@types";
|
||||
import { SPACING_UNIT } from "@renderer/theme.css";
|
||||
import { useUserDetails } from "@renderer/hooks";
|
||||
|
||||
import "./achievement-panel.scss";
|
||||
import "../../scss/_variables.scss";
|
||||
|
||||
export interface ComparedAchievementPanelProps {
|
||||
achievements: ComparedAchievements;
|
||||
}
|
||||
@ -18,24 +19,24 @@ export function ComparedAchievementPanel({
|
||||
|
||||
return (
|
||||
<div
|
||||
className={styles.panel}
|
||||
style={{
|
||||
display: "grid",
|
||||
gridTemplateColumns: hasActiveSubscription ? "3fr 1fr 1fr" : "3fr 2fr",
|
||||
gap: `${SPACING_UNIT * 2}px`,
|
||||
}}
|
||||
className={classNames("achievement-panel", {
|
||||
"achievement-panel--subscribed": hasActiveSubscription,
|
||||
})}
|
||||
>
|
||||
<div style={{ display: "flex", gap: `${SPACING_UNIT}px` }}>
|
||||
{t("available_points")} <HydraIcon width={20} height={20} />{" "}
|
||||
<div className="achievement-panel__points">
|
||||
{t("available_points")}
|
||||
<HydraIcon width={20} height={20} />
|
||||
{achievements.achievementsPointsTotal}
|
||||
</div>
|
||||
|
||||
{hasActiveSubscription && (
|
||||
<div className={styles.content}>
|
||||
<div className="achievement-panel__content">
|
||||
<HydraIcon width={20} height={20} />
|
||||
{achievements.owner.achievementsPointsEarnedSum ?? 0}
|
||||
</div>
|
||||
)}
|
||||
<div className={styles.content}>
|
||||
|
||||
<div className="achievement-panel__content">
|
||||
<HydraIcon width={20} height={20} />
|
||||
{achievements.target.achievementsPointsEarnedSum}
|
||||
</div>
|
||||
|
@ -21,6 +21,13 @@
|
||||
}
|
||||
}
|
||||
|
||||
&__downloads-group {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: $spacing-unit * 2;
|
||||
}
|
||||
|
||||
&__downloads {
|
||||
width: 100%;
|
||||
gap: #{$spacing-unit * 2};
|
||||
|
@ -13,9 +13,9 @@ import { DOWNLOADER_NAME } from "@renderer/constants";
|
||||
import { useAppSelector, useDownload } from "@renderer/hooks";
|
||||
|
||||
import "./download-group.scss";
|
||||
import "../../scss/_variables.scss";
|
||||
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { SPACING_UNIT, vars } from "@renderer/theme.css";
|
||||
import { useMemo } from "react";
|
||||
import {
|
||||
DropdownMenu,
|
||||
@ -240,20 +240,14 @@ export function DownloadGroup({
|
||||
|
||||
return (
|
||||
<div className="download-group">
|
||||
<div
|
||||
style={{
|
||||
display: "flex",
|
||||
alignItems: "center",
|
||||
justifyContent: "space-between",
|
||||
gap: `${SPACING_UNIT * 2}px`,
|
||||
}}
|
||||
<div className="download-group__downloads-group"
|
||||
>
|
||||
<h2>{title}</h2>
|
||||
|
||||
<div
|
||||
style={{
|
||||
flex: 1,
|
||||
backgroundColor: vars.color.border,
|
||||
backgroundColor: "var(--border-color)",
|
||||
height: "1px",
|
||||
}}
|
||||
/>
|
||||
@ -272,7 +266,7 @@ export function DownloadGroup({
|
||||
<div className="download-group__cover-backdrop">
|
||||
<img
|
||||
src={steamUrlBuilder.library(game.objectID)}
|
||||
className={styles.downloadCoverImage}
|
||||
className="download-group__cover-image"
|
||||
alt={game.title}
|
||||
/>
|
||||
|
||||
|
@ -12,8 +12,8 @@ export function DescriptionHeader() {
|
||||
if (!shopDetails) return null;
|
||||
|
||||
return (
|
||||
<div className={styles.descriptionHeader}>
|
||||
<section className={styles.descriptionHeaderInfo}>
|
||||
<div className="description-header">
|
||||
<section className="description-header__info">
|
||||
<p>
|
||||
{t("release_date", {
|
||||
date: shopDetails?.release_date.date,
|
||||
|
@ -25,13 +25,8 @@ export function GameDetailsContent() {
|
||||
|
||||
const { t } = useTranslation("game_details");
|
||||
|
||||
const {
|
||||
objectId,
|
||||
shopDetails,
|
||||
game,
|
||||
gameColor,
|
||||
setGameColor,
|
||||
} = useContext(gameDetailsContext);
|
||||
const { objectId, shopDetails, game, gameColor, setGameColor } =
|
||||
useContext(gameDetailsContext);
|
||||
|
||||
const { showHydraCloudModal } = useSubscription();
|
||||
|
||||
@ -97,7 +92,7 @@ export function GameDetailsContent() {
|
||||
}
|
||||
|
||||
setBackdropOpacity(opacity);
|
||||
};
|
||||
};
|
||||
|
||||
const handleCloudSaveButtonClick = () => {
|
||||
if (!userDetails) {
|
||||
|
Loading…
Reference in New Issue
Block a user