From acf399bc39b8a7ba652c67735e3f4b40a1ba7e0e Mon Sep 17 00:00:00 2001 From: eagle Date: Tue, 14 May 2024 19:01:57 +0530 Subject: [PATCH] feat: update text for admin view --- .../src/features/round/ViewManageTeam.tsx | 22 +++++++++++++++---- .../src/features/round/ViewRoundPage.tsx | 2 +- 2 files changed, 19 insertions(+), 5 deletions(-) diff --git a/packages/round-manager/src/features/round/ViewManageTeam.tsx b/packages/round-manager/src/features/round/ViewManageTeam.tsx index 70e7d0bf9..444db79f6 100644 --- a/packages/round-manager/src/features/round/ViewManageTeam.tsx +++ b/packages/round-manager/src/features/round/ViewManageTeam.tsx @@ -11,7 +11,16 @@ const sortDataByRole = (data: AddressAndRole[]): AddressAndRole[] => { }); }; -export default function ViewManageTeam(props: { round: Round | undefined }) { +export default function ViewManageTeam(props: { + round: Round | undefined; + userAddress: string; +}) { + const isAdmin = props.round?.roles?.some( + (role) => + role.address.toLowerCase() === props.userAddress.toLowerCase() && + role.role === "ADMIN" + ); + const sortedRoles = useMemo(() => { return sortDataByRole(props.round?.roles || []); }, [props.round?.roles]); @@ -19,9 +28,15 @@ export default function ViewManageTeam(props: { round: Round | undefined }) { return (

Manage Team

-

View who is on your team.

- Only admins can add others to your team. + {isAdmin + ? "Add or remove admins and operators to your team. " + : "View who is on your team."} +

+

+ {isAdmin + ? "Make sure to have at least two admins at all times for security purposes." + : "Only admins can add others to your team."}

View Members

@@ -72,7 +87,6 @@ function AddressRow(props: { address: string }) { address: props.address as `0x${string}`, chainId: 1, }); - console.log("ensName", ensName); return ( diff --git a/packages/round-manager/src/features/round/ViewRoundPage.tsx b/packages/round-manager/src/features/round/ViewRoundPage.tsx index e21cf0bbb..bbdab4bce 100644 --- a/packages/round-manager/src/features/round/ViewRoundPage.tsx +++ b/packages/round-manager/src/features/round/ViewRoundPage.tsx @@ -366,7 +366,7 @@ export default function ViewRoundPage() { - + {!isDirectRound(round) && ( <>