From d1defc232d1d1cbda512d0f40bce7ea3c9142553 Mon Sep 17 00:00:00 2001 From: MurakawaTakuya Date: Sun, 29 Dec 2024 18:55:21 +0900 Subject: [PATCH] =?UTF-8?q?=E7=94=BB=E5=83=8F=E3=81=AE=E3=83=AD=E3=83=BC?= =?UTF-8?q?=E3=83=87=E3=82=A3=E3=83=B3=E3=82=B0=E5=AE=9F=E8=A3=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Components/Progress/Progress.tsx | 63 ++++++++++++++++++---------- src/styles/globals.scss | 2 +- 2 files changed, 42 insertions(+), 23 deletions(-) diff --git a/src/Components/Progress/Progress.tsx b/src/Components/Progress/Progress.tsx index 0c7a723..af73fea 100644 --- a/src/Components/Progress/Progress.tsx +++ b/src/Components/Progress/Progress.tsx @@ -5,13 +5,14 @@ import { useUser } from "@/utils/UserContext"; import AppRegistrationRoundedIcon from "@mui/icons-material/AppRegistrationRounded"; import CheckRoundedIcon from "@mui/icons-material/CheckRounded"; import CloseIcon from "@mui/icons-material/Close"; +import { CssVarsProvider, Divider, extendTheme } from "@mui/joy"; import Card from "@mui/joy/Card"; import CardContent from "@mui/joy/CardContent"; +import Skeleton from "@mui/joy/Skeleton"; import Step, { stepClasses } from "@mui/joy/Step"; import StepIndicator, { stepIndicatorClasses } from "@mui/joy/StepIndicator"; import Stepper from "@mui/joy/Stepper"; import Typography, { typographyClasses } from "@mui/joy/Typography"; -import { Divider } from "@mui/material"; import { getDownloadURL, getStorage, ref } from "firebase/storage"; import { ReactNode, useState } from "react"; import DeleteGoalModal from "../DeleteGoalModal/DeleteGoalModal"; @@ -117,7 +118,7 @@ const SuccessStep = ({ user: User; }) => { const [imageURL, setImageURL] = useState(""); - const [imageLoading, setImageLoading] = useState(true); + const [imageLoaded, setImageLoaded] = useState(false); const post = result.post; if (!post) { @@ -129,14 +130,22 @@ const SuccessStep = ({ getDownloadURL(imageRef) .then((url) => { - console.log("Image URL:", url); setImageURL(url); - setImageLoading(false); }) .catch((error) => { console.error("Error fetching image URL:", error); }); + const theme = extendTheme({ + components: { + JoySkeleton: { + defaultProps: { + animation: "wave", + }, + }, + }, + }); + return ( - {!imageLoading && ( - - )} - +
+ + + {imageURL && ( + setImageLoaded(true)} + /> + )} + + +
+
{formatStringToDate(post.submittedAt)}に完了 @@ -379,7 +398,7 @@ const StepperBlock = ({ sx={{ width: "87%", margin: "10px auto", - padding: "13px", + padding: "10px 13px", borderRadius: "8px", border: "1px solid", borderColor: diff --git a/src/styles/globals.scss b/src/styles/globals.scss index 8206f44..76ef4cb 100644 --- a/src/styles/globals.scss +++ b/src/styles/globals.scss @@ -18,5 +18,5 @@ body { main { background: white; - padding-bottom: 100px; + padding-bottom: 130px; }