From 9637b8d0410308bb711a86ac3bf1a08c6d789b71 Mon Sep 17 00:00:00 2001 From: MurakawaTakuya Date: Fri, 17 Jan 2025 00:58:08 +0900 Subject: [PATCH] =?UTF-8?q?=E3=82=AB=E3=83=BC=E3=83=89=E3=81=AE=E8=89=B2?= =?UTF-8?q?=E3=82=92=E5=A4=89=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Components/GoalModal/CreateGoalModal.tsx | 8 ++++++++ src/Components/Progress/StepperBlock.tsx | 6 ++++++ src/utils/API/Goal/createGoal.ts | 2 +- 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/src/Components/GoalModal/CreateGoalModal.tsx b/src/Components/GoalModal/CreateGoalModal.tsx index 6b88cd1c..c91b77ea 100644 --- a/src/Components/GoalModal/CreateGoalModal.tsx +++ b/src/Components/GoalModal/CreateGoalModal.tsx @@ -64,6 +64,14 @@ export default function CreateGoalModal({ const handleSubmit = async (event: React.FormEvent) => { event.preventDefault(); + if (deadline < new Date().toISOString().slice(0, 16)) { + showSnackBar({ + message: "過去の時間を設定することはできません", + type: "warning", + }); + return; + } + const postData: Goal = { userId: user?.userId as string, text: text, diff --git a/src/Components/Progress/StepperBlock.tsx b/src/Components/Progress/StepperBlock.tsx index b29b3edd..42f2d2fe 100644 --- a/src/Components/Progress/StepperBlock.tsx +++ b/src/Components/Progress/StepperBlock.tsx @@ -50,6 +50,12 @@ export const StepperBlock = ({ : outerBorderColors.pending, boxShadow: "1px 1px 8px #d9d9d96b", gap: "6px", + backgroundColor: + resultType == "success" + ? "#eff9f1ad" + : resultType == "failed" + ? "#fff5f5" + : "#f6f8ff", }} >
{ if (error instanceof Error) { if (error.message.includes("past deadline can't be set")) { - snackBarMessage = "過去の時間を指定することはできません"; + snackBarMessage = "過去の時間を設定ることはできません"; } if (error.message.includes("too long comment")) { snackBarMessage = "目標の文字数は100文字以下にしてください";