-
Time Range
-
-
- Clear
-
+
+
+ Time
+ {!hasValue && (
+
+ )}
+ >
+ }
+ buttonClassname={clsx(
+ 'text-sm px-2 sm:px-3 py-1 flex items-center justify-center font-medium border border-pink-500 rounded-full hover:opacity-80 active:opacity-70 transition-all',
+ hasValue ? ' bg-pink-500 text-white pr-7 sm:pr-8' : 'text-pink-500',
+ )}
+ panelClassname="w-60"
+ >
+ {({ close }) => (
+
+
+
Time Range
+
+
+ Clear
+
+
+
+
Start Time
+
+ End Time
+
+
+
onClickApply(close)}
+ >
+ Apply
+
-
-
Start Time
-
- End Time
-
-
- onClickApply(close)}>
- Apply
-
-
- )}
-
+ )}
+
+ {hasValue &&
}
+
+ );
+}
+
+function ClearButton({ onClick }: { onClick: () => void }) {
+ return (
+
+
+
+
+
);
}
diff --git a/src/features/chains/queries/useScrapedChains.ts b/src/features/chains/queries/useScrapedChains.ts
index b4040d7..51283a9 100644
--- a/src/features/chains/queries/useScrapedChains.ts
+++ b/src/features/chains/queries/useScrapedChains.ts
@@ -42,7 +42,7 @@ export function useScrapedEvmChains(multiProvider: MultiProvider) {
// https://github.com/hyperlane-xyz/hyperlane-explorer/issues/61
const scrapedEvmChains = objFilter(
multiProvider.metadata,
- (chainName, chainMetadata): chainMetadata is ChainMetadata =>
+ (_, chainMetadata): chainMetadata is ChainMetadata =>
isEvmChain(multiProvider, chainMetadata.chainId) &&
!isPiChain(multiProvider, scrapedChains, chainMetadata.chainId) &&
!isUnscrapedDbChain(multiProvider, chainMetadata.chainId),
diff --git a/src/features/chains/utils.ts b/src/features/chains/utils.ts
index 8469455..7f97cba 100644
--- a/src/features/chains/utils.ts
+++ b/src/features/chains/utils.ts
@@ -23,9 +23,9 @@ export function getChainDisplayName(
chainOrDomainId?: ChainId | DomainId,
shortName = false,
fallbackToId = true,
-) {
+): string {
const metadata = multiProvider.tryGetChainMetadata(chainOrDomainId || 0);
- if (!metadata) return fallbackToId && chainOrDomainId ? chainOrDomainId : 'Unknown';
+ if (!metadata) return fallbackToId && chainOrDomainId ? chainOrDomainId.toString() : 'Unknown';
const displayName = shortName ? metadata.displayNameShort : metadata.displayName;
return toTitleCase(displayName || metadata.displayName || metadata.name);
}
diff --git a/src/store.ts b/src/store.ts
index bad9208..9e2e476 100644
--- a/src/store.ts
+++ b/src/store.ts
@@ -2,7 +2,8 @@ import { create } from 'zustand';
import { persist } from 'zustand/middleware';
import { GithubRegistry, IRegistry } from '@hyperlane-xyz/registry';
-import { ChainMap, MultiProvider } from '@hyperlane-xyz/sdk';
+import { ChainMap, ChainMetadata, MultiProvider } from '@hyperlane-xyz/sdk';
+import { objMap, promiseObjAll } from '@hyperlane-xyz/utils';
import { config } from './consts/config';
import { ChainConfig } from './features/chains/chainConfig';
@@ -91,5 +92,15 @@ async function buildMultiProvider(registry: IRegistry, customChainConfigs: Chain
// TODO improve interface so this pre-cache isn't required
await registry.listRegistryContent();
const registryChainMetadata = await registry.getMetadata();
- return new MultiProvider({ ...registryChainMetadata, ...customChainConfigs });
+ // TODO have the registry do this automatically
+ const metadataWithLogos = await promiseObjAll(
+ objMap(
+ registryChainMetadata,
+ async (chainName, metadata): Promise
=> ({
+ ...metadata,
+ logoURI: (await registry.getChainLogoUri(chainName)) || undefined,
+ }),
+ ),
+ );
+ return new MultiProvider({ ...metadataWithLogos, ...customChainConfigs });
}
diff --git a/src/styles/Color.ts b/src/styles/Color.ts
index e507117..bf4db16 100644
--- a/src/styles/Color.ts
+++ b/src/styles/Color.ts
@@ -10,7 +10,7 @@ export const Color = {
lightGray: themeColors.gray[200],
primary: themeColors.blue[500],
accent: themeColors.pink[500],
- blue: themeColors.blue[200],
- pink: themeColors.pink[200],
+ blue: themeColors.blue[500],
+ pink: themeColors.pink[500],
red: themeColors.red[500],
} as const;
diff --git a/yarn.lock b/yarn.lock
index cb40ddf..7fc31bb 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -2189,6 +2189,7 @@ __metadata:
autoprefixer: "npm:^10.4.15"
bignumber.js: "npm:^9.1.2"
buffer: "npm:^6.0.3"
+ clsx: "npm:^2.1.1"
eslint: "npm:^8.41.0"
eslint-config-next: "npm:^13.4.19"
eslint-config-prettier: "npm:^8.8.0"
@@ -5679,7 +5680,7 @@ __metadata:
languageName: node
linkType: hard
-"clsx@npm:^2.0.0":
+"clsx@npm:^2.0.0, clsx@npm:^2.1.1":
version: 2.1.1
resolution: "clsx@npm:2.1.1"
checksum: cdfb57fa6c7649bbff98d9028c2f0de2f91c86f551179541cf784b1cfdc1562dcb951955f46d54d930a3879931a980e32a46b598acaea274728dbe068deca919