Skip to content

Commit

Permalink
カードの色を変更
Browse files Browse the repository at this point in the history
  • Loading branch information
MurakawaTakuya committed Jan 16, 2025
1 parent 6a5ffa2 commit 9637b8d
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
8 changes: 8 additions & 0 deletions src/Components/GoalModal/CreateGoalModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
6 changes: 6 additions & 0 deletions src/Components/Progress/StepperBlock.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,12 @@ export const StepperBlock = ({
: outerBorderColors.pending,
boxShadow: "1px 1px 8px #d9d9d96b",
gap: "6px",
backgroundColor:
resultType == "success"
? "#eff9f1ad"
: resultType == "failed"
? "#fff5f5"
: "#f6f8ff",
}}
>
<div
Expand Down
2 changes: 1 addition & 1 deletion src/utils/API/Goal/createGoal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export const handleCreateGoalError = (error: unknown) => {

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文字以下にしてください";
Expand Down

0 comments on commit 9637b8d

Please sign in to comment.