([])
+ const [loading, setLoading] = useState(false)
+
useEffect(() => {
const fetchData = async () => {
+ setLoading(true)
const subgraph = new SemaphoreSubgraph(network)
const groups = await subgraph.getGroups({
@@ -24,18 +27,26 @@ export default function Network() {
setAllGroups(groups)
setFilteredGroups(groups.slice())
+ setLoading(false)
}
fetchData()
}, [])
- const filterGroups = useCallback((groupId: string) => {
- const groups = allGroups.filter((group) => (!groupId ? true : group.id.includes(groupId)))
+ const filterGroups = useCallback(
+ (groupId: string) => {
+ const groups = allGroups.filter((group) => (!groupId ? true : group.id.includes(groupId)))
- setFilteredGroups(groups)
- }, [])
+ setFilteredGroups(groups)
+ },
+ [allGroups]
+ )
- return (
+ return loading ? (
+
+ ) : (
allGroups && (
diff --git a/apps/explorer/src/app/favicon.ico b/apps/explorer/src/app/favicon.ico
deleted file mode 100644
index 718d6fe..0000000
Binary files a/apps/explorer/src/app/favicon.ico and /dev/null differ
diff --git a/apps/explorer/src/app/globals.css b/apps/explorer/src/app/globals.css
index bba55d9..ca782e8 100644
--- a/apps/explorer/src/app/globals.css
+++ b/apps/explorer/src/app/globals.css
@@ -25,3 +25,19 @@ body {
text-wrap: balance;
}
}
+
+.loader {
+ width: 25px;
+ height: 25px;
+ border-radius: 50%;
+ border-top: 2px solid #3555df;
+ border-right: 2px solid transparent;
+ animation: spin 1s linear infinite;
+ z-index: 20;
+}
+
+@keyframes spin {
+ to {
+ transform: rotate(360deg);
+ }
+}
diff --git a/apps/explorer/src/app/layout.tsx b/apps/explorer/src/app/layout.tsx
index 62d743b..bad2c17 100644
--- a/apps/explorer/src/app/layout.tsx
+++ b/apps/explorer/src/app/layout.tsx
@@ -16,7 +16,22 @@ const geistMono = localFont({
export const metadata: Metadata = {
title: "Semaphore Explorer",
- description: "Discover Semaphore groups, view members and zero-knowledge proofs."
+ description: "Discover Semaphore groups, view members and zero-knowledge proofs.",
+ icons: { icon: "/icon.svg", apple: "/apple-icon.png" },
+ metadataBase: new URL("https://explorer.semaphore.pse.dev"),
+ openGraph: {
+ type: "website",
+ url: "https://explorer.semaphore.pse.dev",
+ title: "Semaphore Explorer",
+ description: "Discover Semaphore groups, view members and zero-knowledge proofs.",
+ siteName: "Semaphore Explorer",
+ images: [
+ {
+ url: "https://explorer.semaphore.pse.dev/social-media.png"
+ }
+ ]
+ },
+ twitter: { card: "summary_large_image", images: "https://explorer.semaphore.pse.dev/social-media.png" }
}
export default function RootLayout({