mirror of
https://github.com/hydralauncher/hydra.git
synced 2025-02-09 03:37:45 +03:00
refactor: update achievement panel styles
This commit is contained in:
parent
f74061a69b
commit
2d665b2266
@ -3,12 +3,12 @@
|
|||||||
.achievement-panel {
|
.achievement-panel {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
padding: globals.$spacing-unit * 2 globals.$spacing-unit * 3;
|
padding: globals.$spacing-unit * 2 globals.$spacing-unit * 3;
|
||||||
background-color: var(--color-background);
|
background-color: globals.$dark-background-color;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
align-items: start;
|
align-items: start;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
border-bottom: solid 1px var(--color-border);
|
border-bottom: solid 1px globals.$border-color;
|
||||||
|
|
||||||
&__content {
|
&__content {
|
||||||
display: flex;
|
display: flex;
|
||||||
@ -25,12 +25,12 @@
|
|||||||
&__download-details-row {
|
&__download-details-row {
|
||||||
gap: globals.$spacing-unit;
|
gap: globals.$spacing-unit;
|
||||||
display: flex;
|
display: flex;
|
||||||
color: var(--color-body);
|
color: globals.$body-color;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
&__downloads-link {
|
&__downloads-link {
|
||||||
color: var(--color-body);
|
color: globals.$body-color;
|
||||||
text-decoration: underline;
|
text-decoration: underline;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -47,17 +47,17 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
&::-webkit-progress-value {
|
&::-webkit-progress-value {
|
||||||
background-color: var(--color-muted);
|
background-color: globals.$muted-color;
|
||||||
}
|
}
|
||||||
|
|
||||||
&--disabled {
|
&--disabled {
|
||||||
opacity: var(--opacity-disabled);
|
opacity: globals.$disabled-opacity;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
&__link {
|
&__link {
|
||||||
text-align: start;
|
text-align: start;
|
||||||
color: var(--color-body);
|
color: globals.$body-color;
|
||||||
background: none;
|
background: none;
|
||||||
border: none;
|
border: none;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
@ -66,5 +66,32 @@
|
|||||||
text-decoration: underline;
|
text-decoration: underline;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
&--warning {
|
||||||
|
color: globals.$warning-color;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&__grid {
|
||||||
|
display: grid;
|
||||||
|
gap: globals.$spacing-unit * 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
&__grid--with-subscription {
|
||||||
|
grid-template-columns: 3fr 1fr 1fr;
|
||||||
|
}
|
||||||
|
|
||||||
|
&__grid--without-subscription {
|
||||||
|
grid-template-columns: 3fr 2fr;
|
||||||
|
}
|
||||||
|
|
||||||
|
&__points-container {
|
||||||
|
display: flex;
|
||||||
|
gap: globals.$spacing-unit;
|
||||||
|
}
|
||||||
|
|
||||||
|
&__content-icon {
|
||||||
|
width: 18px;
|
||||||
|
height: 18px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3,7 +3,6 @@ import HydraIcon from "@renderer/assets/icons/hydra.svg?react";
|
|||||||
import { UserAchievement } from "@types";
|
import { UserAchievement } from "@types";
|
||||||
import { useSubscription } from "@renderer/hooks/use-subscription";
|
import { useSubscription } from "@renderer/hooks/use-subscription";
|
||||||
import { useUserDetails } from "@renderer/hooks";
|
import { useUserDetails } from "@renderer/hooks";
|
||||||
import { vars } from "@renderer/theme.css";
|
|
||||||
import "./achievement-panel.scss";
|
import "./achievement-panel.scss";
|
||||||
|
|
||||||
export interface AchievementPanelProps {
|
export interface AchievementPanelProps {
|
||||||
@ -30,7 +29,8 @@ export function AchievementPanel({ achievements }: AchievementPanelProps) {
|
|||||||
return (
|
return (
|
||||||
<div className="achievement-panel">
|
<div className="achievement-panel">
|
||||||
<div className="achievement-panel__content">
|
<div className="achievement-panel__content">
|
||||||
{t("earned_points")} <HydraIcon width={20} height={20} />
|
{t("earned_points")}{" "}
|
||||||
|
<HydraIcon className="achievement-panel__content-icon" />
|
||||||
??? / ???
|
??? / ???
|
||||||
</div>
|
</div>
|
||||||
<button
|
<button
|
||||||
@ -38,7 +38,7 @@ export function AchievementPanel({ achievements }: AchievementPanelProps) {
|
|||||||
onClick={() => showHydraCloudModal("achievements-points")}
|
onClick={() => showHydraCloudModal("achievements-points")}
|
||||||
className="achievement-panel__link"
|
className="achievement-panel__link"
|
||||||
>
|
>
|
||||||
<small style={{ color: vars.color.warning }}>
|
<small className="achievement-panel__link--warning">
|
||||||
{t("how_to_earn_achievements_points")}
|
{t("how_to_earn_achievements_points")}
|
||||||
</small>
|
</small>
|
||||||
</button>
|
</button>
|
||||||
@ -49,7 +49,8 @@ export function AchievementPanel({ achievements }: AchievementPanelProps) {
|
|||||||
return (
|
return (
|
||||||
<div className="achievement-panel">
|
<div className="achievement-panel">
|
||||||
<div className="achievement-panel__content">
|
<div className="achievement-panel__content">
|
||||||
{t("earned_points")} <HydraIcon width={20} height={20} />
|
{t("earned_points")}{" "}
|
||||||
|
<HydraIcon className="achievement-panel__content-icon" />
|
||||||
{achievementsPointsEarnedSum} / {achievementsPointsTotal}
|
{achievementsPointsEarnedSum} / {achievementsPointsTotal}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import HydraIcon from "@renderer/assets/icons/hydra.svg?react";
|
import HydraIcon from "@renderer/assets/icons/hydra.svg?react";
|
||||||
import { ComparedAchievements } from "@types";
|
import { ComparedAchievements } from "@types";
|
||||||
import { SPACING_UNIT } from "@renderer/theme.css";
|
|
||||||
import { useUserDetails } from "@renderer/hooks";
|
import { useUserDetails } from "@renderer/hooks";
|
||||||
|
import "./achievement-panel.scss";
|
||||||
|
|
||||||
export interface ComparedAchievementPanelProps {
|
export interface ComparedAchievementPanelProps {
|
||||||
achievements: ComparedAchievements;
|
achievements: ComparedAchievements;
|
||||||
@ -16,25 +16,25 @@ export function ComparedAchievementPanel({
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
className="achievement-panel"
|
className={`achievement-panel achievement-panel__grid ${
|
||||||
style={{
|
hasActiveSubscription
|
||||||
display: "grid",
|
? "achievement-panel__grid--with-subscription"
|
||||||
gridTemplateColumns: hasActiveSubscription ? "3fr 1fr 1fr" : "3fr 2fr",
|
: "achievement-panel__grid--without-subscription"
|
||||||
gap: `${SPACING_UNIT * 2}px`,
|
}`}
|
||||||
}}
|
|
||||||
>
|
>
|
||||||
<div style={{ display: "flex", gap: `${SPACING_UNIT}px` }}>
|
<div className="achievement-panel__points-container">
|
||||||
{t("available_points")} <HydraIcon width={20} height={20} />{" "}
|
{t("available_points")}{" "}
|
||||||
|
<HydraIcon className="achievement-panel__content-icon" />{" "}
|
||||||
{achievements.achievementsPointsTotal}
|
{achievements.achievementsPointsTotal}
|
||||||
</div>
|
</div>
|
||||||
{hasActiveSubscription && (
|
{hasActiveSubscription && (
|
||||||
<div className="achievement-panel__content">
|
<div className="achievement-panel__content">
|
||||||
<HydraIcon width={20} height={20} />
|
<HydraIcon className="achievement-panel__content-icon" />
|
||||||
{achievements.owner.achievementsPointsEarnedSum ?? 0}
|
{achievements.owner.achievementsPointsEarnedSum ?? 0}
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
<div className="achievement-panel__content">
|
<div className="achievement-panel__content">
|
||||||
<HydraIcon width={20} height={20} />
|
<HydraIcon className="achievement-panel__content-icon" />
|
||||||
{achievements.target.achievementsPointsEarnedSum}
|
{achievements.target.achievementsPointsEarnedSum}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
Reference in New Issue
Block a user