From cdb0f4bc72aa22adf978217e0e27c5fb824d7491 Mon Sep 17 00:00:00 2001 From: jc <46619361+juancwu@users.noreply.github.com> Date: Thu, 16 May 2024 23:52:32 -0400 Subject: [PATCH] update team edit close date --- src/pages/MyTeam.page.tsx | 109 +++++++++++++++++++++----------------- 1 file changed, 61 insertions(+), 48 deletions(-) diff --git a/src/pages/MyTeam.page.tsx b/src/pages/MyTeam.page.tsx index d8020968..01706e14 100644 --- a/src/pages/MyTeam.page.tsx +++ b/src/pages/MyTeam.page.tsx @@ -36,7 +36,7 @@ import { useUserStore } from "@/stores/user.store"; type SearchTeamNameFn = (name: string) => Promise; -const teamNameUpdateCloseDate = "2024-05-17T00:00:00"; +const teamEditCloseDate = "2024-05-17T00:00:00"; export const MyTeamPage = () => { // const [team, setTeam] = useState(null); @@ -487,15 +487,19 @@ export const MyTeamPage = () => { : "My Teammates"} {/* members length has to be less than 3 because the logged in user is not in the list */} - {team.isOwner && team.members.length < 3 && ( - - )} + {team.isOwner && + team.members.length < 3 && + isBefore(new Date(), teamEditCloseDate) && ( + + )} {/* separator */}
@@ -530,24 +534,25 @@ export const MyTeamPage = () => { ))} - {team && team.isOwner && ( -
- -
- )} + {team && + team.isOwner && + isBefore(new Date(), teamEditCloseDate) && ( +
+ +
+ )}

Team Name

{team.isOwner && - isBefore( - new Date(), - teamNameUpdateCloseDate - ) && ( + isBefore(new Date(), teamEditCloseDate) && (
- {team && team.isOwner && ( -
-
-

Delete Team?

-

Are you sure you want to delete your team?

-

Retype your team name to confirm deletion.

-
- setConfirmDelete(e.target.value)} - /> -
- + {team && + team.isOwner && + isBefore(new Date(), teamEditCloseDate) && ( +
+
+

Delete Team?

+

+ Are you sure you want to delete your team? +

+

+ Retype your team name to confirm deletion. +

+
+ + setConfirmDelete(e.target.value) + } + /> +
+ +
-
- )} + )}