Skip to content

Commit

Permalink
feat: update text for admin view
Browse files Browse the repository at this point in the history
  • Loading branch information
bhargavaparoksham committed May 14, 2024
1 parent 4d07a4b commit acf399b
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 5 deletions.
22 changes: 18 additions & 4 deletions packages/round-manager/src/features/round/ViewManageTeam.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,32 @@ 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]);

return (
<div>
<p className="font-bold text-lg mt-2 mb-2">Manage Team</p>
<p className="text-sm text-gray-400 mb-2">View who is on your team.</p>
<p className="text-sm text-gray-400 mb-2">
Only admins can add others to your team.
{isAdmin
? "Add or remove admins and operators to your team. "
: "View who is on your team."}
</p>
<p className="text-sm text-gray-400 mb-2">
{isAdmin
? "Make sure to have at least two admins at all times for security purposes."
: "Only admins can add others to your team."}
</p>
<p className="text-md mt-6 mb-4">View Members</p>
<div className="overflow-x-auto">
Expand Down Expand Up @@ -72,7 +87,6 @@ function AddressRow(props: { address: string }) {
address: props.address as `0x${string}`,
chainId: 1,
});
console.log("ensName", ensName);

return (
<td className="w-2/4 px-6 py-4 whitespace-nowrap text-sm text-gray-400">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@ export default function ViewRoundPage() {
<ViewRoundSettings id={round?.id} />
</Tab.Panel>
<Tab.Panel>
<ViewManageTeam round={round} />
<ViewManageTeam round={round} userAddress={address} />
</Tab.Panel>
{!isDirectRound(round) && (
<>
Expand Down

0 comments on commit acf399b

Please sign in to comment.