diff --git a/src/components/DownloadSection.css b/src/components/DownloadSection.css index 428fef6..11bcef2 100644 --- a/src/components/DownloadSection.css +++ b/src/components/DownloadSection.css @@ -38,3 +38,9 @@ opacity: 0.9; transform: translateY(-1px); } + +.download-preparing { + font-size: 0.9rem; + color: rgba(255, 255, 255, 0.4); + margin: 0; +} diff --git a/src/components/DownloadSection.jsx b/src/components/DownloadSection.jsx index daab2a0..e918b29 100644 --- a/src/components/DownloadSection.jsx +++ b/src/components/DownloadSection.jsx @@ -6,11 +6,14 @@ import './DownloadSection.css'; export default function DownloadSection() { const [info, setInfo] = useState(null); + const [ready, setReady] = useState(false); const { user } = useAuth(); const navigate = useNavigate(); useEffect(() => { - getDownloadInfo().then(setInfo); + getDownloadInfo() + .then((data) => { setInfo(data); setReady(true); }) + .catch(() => setReady(true)); }, []); const handleDownload = (e) => { @@ -20,18 +23,24 @@ export default function DownloadSection() { } }; - if (!info) return null; + if (!ready) return null; return (

게임 런처 다운로드

-

- {info.fileName} · {info.fileSize} · {info.version} -

- - {user ? '다운로드' : '로그인 후 다운로드'} - + {info ? ( + <> +

+ {info.fileName} · {info.fileSize} · {info.version} +

+ + {user ? '다운로드' : '로그인 후 다운로드'} + + + ) : ( +

런처 준비 중입니다. 잠시 후 다시 확인해주세요.

+ )}
);