diff --git a/src/renderer/src/pages/profile/profile-content/profile-content.tsx b/src/renderer/src/pages/profile/profile-content/profile-content.tsx index a117c12a..6e20e686 100644 --- a/src/renderer/src/pages/profile/profile-content/profile-content.tsx +++ b/src/renderer/src/pages/profile/profile-content/profile-content.tsx @@ -24,7 +24,6 @@ import { MAX_MINUTES_TO_SHOW_IN_PLAYTIME } from "@renderer/constants"; import { ProfileTabs, type ProfileTabType } from "./profile-tabs"; import { LibraryTab } from "./library-tab"; import { ReviewsTab } from "./reviews-tab"; -import { WrappedConfirmModal } from "./wrapped-tab"; import { AnimatePresence } from "framer-motion"; import "./profile-content.scss"; @@ -105,7 +104,6 @@ export function ProfileContent() { const [votingReviews, setVotingReviews] = useState>(new Set()); const [deleteModalVisible, setDeleteModalVisible] = useState(false); const [reviewToDelete, setReviewToDelete] = useState(null); - const [wrappedModalVisible, setWrappedModalVisible] = useState(false); const dispatch = useAppDispatch(); @@ -388,7 +386,6 @@ export function ProfileContent() { activeTab={activeTab} reviewsTotalCount={reviewsTotalCount} onTabChange={setActiveTab} - onWrappedClick={() => setWrappedModalVisible(true)} />
@@ -442,13 +439,6 @@ export function ProfileContent() { onClose={handleDeleteCancel} onConfirm={handleDeleteConfirm} /> - - setWrappedModalVisible(false)} - /> ); }, [ @@ -470,7 +460,6 @@ export function ProfileContent() { isLoadingReviews, votingReviews, deleteModalVisible, - wrappedModalVisible, ]); return ( diff --git a/src/renderer/src/pages/profile/profile-content/profile-tabs.tsx b/src/renderer/src/pages/profile/profile-content/profile-tabs.tsx index 9eac8843..84d1dd4d 100644 --- a/src/renderer/src/pages/profile/profile-content/profile-tabs.tsx +++ b/src/renderer/src/pages/profile/profile-content/profile-tabs.tsx @@ -8,14 +8,12 @@ interface ProfileTabsProps { activeTab: ProfileTabType; reviewsTotalCount: number; onTabChange: (tab: ProfileTabType) => void; - onWrappedClick: () => void; } export function ProfileTabs({ activeTab, reviewsTotalCount, onTabChange, - onWrappedClick, }: Readonly) { const { t } = useTranslation("user_profile"); @@ -66,15 +64,6 @@ export function ProfileTabs({ /> )}
-
- -
); } diff --git a/src/renderer/src/pages/profile/profile-content/wrapped-tab.scss b/src/renderer/src/pages/profile/profile-content/wrapped-tab.scss index 6669586d..0dc45d8d 100644 --- a/src/renderer/src/pages/profile/profile-content/wrapped-tab.scss +++ b/src/renderer/src/pages/profile/profile-content/wrapped-tab.scss @@ -58,11 +58,32 @@ } &__content { + position: relative; border-radius: 8px; overflow: hidden; border: 1px solid rgba(255, 255, 255, 0.1); box-shadow: 0 8px 48px rgba(0, 0, 0, 0.5); pointer-events: auto; + background: rgba(0, 0, 0, 0.5); + } + + &__loader { + position: absolute; + inset: 0; + display: flex; + align-items: center; + justify-content: center; + background: rgba(0, 0, 0, 0.5); + z-index: 1; + } + + &__spinner { + width: 40px; + height: 40px; + border: 3px solid rgba(255, 255, 255, 0.2); + border-top-color: white; + border-radius: 50%; + animation: wrapped-spin 0.8s linear infinite; } &__iframe { @@ -71,3 +92,9 @@ border: none; } } + +@keyframes wrapped-spin { + to { + transform: rotate(360deg); + } +} diff --git a/src/renderer/src/pages/profile/profile-content/wrapped-tab.tsx b/src/renderer/src/pages/profile/profile-content/wrapped-tab.tsx index 1716fcc0..a7ca2797 100644 --- a/src/renderer/src/pages/profile/profile-content/wrapped-tab.tsx +++ b/src/renderer/src/pages/profile/profile-content/wrapped-tab.tsx @@ -1,12 +1,9 @@ -import { useState, useEffect } from "react"; -import { useTranslation } from "react-i18next"; +import { useEffect, useState } from "react"; import { XIcon } from "@primer/octicons-react"; -import { ConfirmationModal } from "@renderer/components"; import "./wrapped-tab.scss"; -interface WrappedModalProps { +interface WrappedFullscreenModalProps { userId: string; - displayName: string; isOpen: boolean; onClose: () => void; } @@ -29,18 +26,16 @@ const getScaleConfigForHeight = (height: number): ScaleConfig => { return SCALE_CONFIGS[0.25]; }; -export function WrappedConfirmModal({ +export function WrappedFullscreenModal({ userId, - displayName, isOpen, onClose, -}: Readonly) { - const { t } = useTranslation("user_profile"); - const [showFullscreen, setShowFullscreen] = useState(false); +}: Readonly) { const [config, setConfig] = useState(SCALE_CONFIGS[0.5]); + const [isLoading, setIsLoading] = useState(true); useEffect(() => { - if (!showFullscreen) return; + if (!isOpen) return; const updateConfig = () => { setConfig(getScaleConfigForHeight(window.innerHeight)); @@ -49,56 +44,51 @@ export function WrappedConfirmModal({ updateConfig(); window.addEventListener("resize", updateConfig); return () => window.removeEventListener("resize", updateConfig); - }, [showFullscreen]); + }, [isOpen]); - const handleConfirm = () => { - onClose(); - setShowFullscreen(true); - }; + useEffect(() => { + if (isOpen) { + setIsLoading(true); + } + }, [isOpen]); + + if (!isOpen) return null; return ( - <> - + - {showFullscreen && ( - - - -
-