diff --git a/apps/dashboard/src/pages/group.tsx b/apps/dashboard/src/pages/group.tsx index 6d7f512e..3a33b44c 100644 --- a/apps/dashboard/src/pages/group.tsx +++ b/apps/dashboard/src/pages/group.tsx @@ -57,6 +57,13 @@ export default function GroupPage(): JSX.Element { const [_removeGroupName, setRemoveGroupName] = useState("") const [_selectedMembers, setSelectedMembers] = useState([]) const { admin } = useContext(AuthContext) + const isGroupAdmin = !!( + admin && + _group && + (groupType === "off-chain" + ? _group.admin === admin.id + : _group.admin === admin.address.toLowerCase()) + ) useEffect(() => { ;(async () => { @@ -349,82 +356,87 @@ ${memberIds.join("\n")} ) - {groupType === "off-chain" && !_group.credentials && ( - - - Use API key - - - onApiAccessToggle(event.target.checked) - } - /> - - - - Connect your app to your group using an API key. - + {groupType === "off-chain" && + !_group.credentials && + isGroupAdmin && ( + + + Use API key + + + onApiAccessToggle( + event.target.checked + ) + } + /> + - {_group.apiEnabled && ( - <> - - + + Connect your app to your group using an API + key. + + + {_group.apiEnabled && ( + <> + + - - - - e.preventDefault() - } - icon={ - + + - - - - - - - )} - - )} + closeOnClick={false} + hasArrow + > + + e.preventDefault() + } + icon={ + + } + /> + + + + + + + )} + + )} - {_group.type === "off-chain" && ( + {_group.type === "off-chain" && isGroupAdmin && (