feat: adding cloud sync

This commit is contained in:
Chubby Granny Chaser 2024-09-25 19:37:28 +01:00
parent d88e06e289
commit e64a414309
No known key found for this signature in database
33 changed files with 1352 additions and 84 deletions

View file

@ -9,8 +9,11 @@ import { Sidebar } from "./sidebar/sidebar";
import * as styles from "./game-details.css";
import { useTranslation } from "react-i18next";
import { gameDetailsContext } from "@renderer/context";
import { cloudSyncContext, gameDetailsContext } from "@renderer/context";
import { steamUrlBuilder } from "@shared";
import Lottie from "lottie-react";
import downloadingAnimation from "@renderer/assets/lottie/cloud.json";
const HERO_ANIMATION_THRESHOLD = 25;
@ -30,6 +33,9 @@ export function GameDetailsContent() {
hasNSFWContentBlocked,
} = useContext(gameDetailsContext);
const { supportsCloudSync, setShowCloudSyncModal } =
useContext(cloudSyncContext);
const [backdropOpactiy, setBackdropOpacity] = useState(1);
const handleHeroLoad = async () => {
@ -102,6 +108,33 @@ export function GameDetailsContent() {
className={styles.gameLogo}
alt={game?.title}
/>
{supportsCloudSync && (
<button
type="button"
className={styles.cloudSyncButton}
onClick={() => setShowCloudSyncModal(true)}
>
<div
style={{
width: 16 + 4,
height: 16,
display: "flex",
alignItems: "center",
justifyContent: "center",
position: "relative",
}}
>
<Lottie
animationData={downloadingAnimation}
loop
autoplay
style={{ width: 26, position: "absolute", top: -3 }}
/>
</div>
cloud_sync
</button>
)}
</div>
</div>
</div>