diff --git a/apps/dashboard/src/api/semaphoreAPI.ts b/apps/dashboard/src/api/semaphoreAPI.ts index 47a8ac0f..3409fca8 100644 --- a/apps/dashboard/src/api/semaphoreAPI.ts +++ b/apps/dashboard/src/api/semaphoreAPI.ts @@ -63,38 +63,3 @@ export async function getGroup(groupId: string): Promise { return null } } - -/** - * It returns the Semaphore on-chain groups on Goerli for a specific admin. - * @param adminAddress The admin address. - * @returns The list of groups. - */ -export async function getGoerliGroups( - adminAddress: string -): Promise { - const goerliSubgraph = new SemaphoreSubgraph("goerli") - - try { - const groups = await goerliSubgraph.getGroups({ - members: true, - filters: { admin: adminAddress } - }) - - return groups.map((group) => { - const groupName = parseGroupName(group.id) - - return { - id: group.id, - name: groupName, - treeDepth: group.merkleTree.depth, - members: group.members as string[], - admin: group.admin as string, - type: "on-chain" - } - }) - } catch (error) { - console.error(error) - - return null - } -} diff --git a/apps/dashboard/src/components/goerli-group.tsx b/apps/dashboard/src/components/goerli-group.tsx deleted file mode 100644 index 712dd8f9..00000000 --- a/apps/dashboard/src/components/goerli-group.tsx +++ /dev/null @@ -1,63 +0,0 @@ -import { - Box, - Icon, - IconButton, - Input, - InputGroup, - InputRightElement, - Text, - Tooltip, - useClipboard -} from "@chakra-ui/react" -import { FiCopy } from "react-icons/fi" - -export type GoerliGroupCardProps = { - name: string - id: string -} - -export default function GoerliGroupCard({ - name, - id -}: GoerliGroupCardProps): JSX.Element { - const { hasCopied: hasCopiedGroupId, onCopy: onCopyGroupId } = - useClipboard(id) - return ( - - {name} - - - - - - - e.preventDefault()} - icon={ - - } - /> - - - - - ) -} diff --git a/apps/dashboard/src/pages/groups.tsx b/apps/dashboard/src/pages/groups.tsx index 877105d2..b1ae40b8 100644 --- a/apps/dashboard/src/pages/groups.tsx +++ b/apps/dashboard/src/pages/groups.tsx @@ -11,29 +11,22 @@ import { InputRightElement, Spinner, Text, - VStack, - Stack, - Link as ChakraLink + VStack } from "@chakra-ui/react" import { useCallback, useContext, useEffect, useState } from "react" import { FiSearch } from "react-icons/fi" import { Link, useNavigate } from "react-router-dom" import { getGroups as getOffchainGroups } from "../api/bandadaAPI" -import { - getGroups as getOnchainGroups, - getGoerliGroups -} from "../api/semaphoreAPI" +import { getGroups as getOnchainGroups } from "../api/semaphoreAPI" import GroupCard from "../components/group-card" import { AuthContext } from "../context/auth-context" import { Group } from "../types" -import GoerliGroupCard from "../components/goerli-group" import ApiKeyComponent from "../components/api-key" export default function GroupsPage(): JSX.Element { const { admin } = useContext(AuthContext) const [_isLoading, setIsLoading] = useState(false) const [_groups, setGroups] = useState([]) - const [_goerliGroups, setGoerliGroups] = useState([]) const [_searchField, setSearchField] = useState("") const navigate = useNavigate() @@ -59,11 +52,6 @@ export default function GroupsPage(): JSX.Element { }) ]) - const goerliGroups = await getGoerliGroups(admin.address) - if (goerliGroups) { - setGoerliGroups((groups) => [...groups, ...goerliGroups]) - } - setIsLoading(false) } })() @@ -165,36 +153,6 @@ export default function GroupsPage(): JSX.Element { ))} )} - - {!_isLoading && _goerliGroups.length > 0 && ( - - - Groups on Goerli (name/id) - - The Goerli network is deprecated. - - {_goerliGroups.map((group) => ( - - ))} - - - To fetch more information about the Goerli groups - you can use the{" "} - - @semaphore-protocol/data - {" "} - package. - - - )} )