- {portals.map(({ ownerAddress, description, id, isRevocable, name }) => {
- const additionalInfo = [
- {
- title: t("common.id"),
- value: id,
- },
- {
- title: t("issuer.portals.ownerAddress"),
- value: ownerAddress,
- },
- {
- title: t("common.revocable"),
- value: isRevocable ? t("common.yes") : t("common.no"),
- },
- ];
-
- return (
-
-
{name}
-
{description}
- {additionalInfo.map((info) => (
-
-
- {info.title}
-
-
- {info.value}
-
-
- ))}
-
- );
- })}
+
+
{t("issuer.portals.title")}
+
+
+
+
+
+ Name
+ |
+
+ Description
+ |
+
+ Attestations
+ |
+
+
+
+ {portals.map(({ id, name, description, attestationCounter }) => (
+
+
+ |
+ {description} |
+ {attestationCounter} |
+
+ ))}
+
+
);
diff --git a/explorer/src/pages/Issuer/components/Schemas/index.tsx b/explorer/src/pages/Issuer/components/Schemas/index.tsx
new file mode 100644
index 00000000..118cc272
--- /dev/null
+++ b/explorer/src/pages/Issuer/components/Schemas/index.tsx
@@ -0,0 +1,75 @@
+import { t } from "i18next";
+import { ArrowUpRight, ChevronRight } from "lucide-react";
+import { useLocation, useNavigate } from "react-router-dom";
+import { useTernaryDarkMode } from "usehooks-ts";
+
+import { Button } from "@/components/Buttons";
+import { EButtonType } from "@/components/Buttons/enum";
+import { AttestationDefinition } from "@/pages/Home/interface.ts";
+import { useNetworkContext } from "@/providers/network-provider/context";
+import { APP_ROUTES, CHAIN_ID_ROUTE } from "@/routes/constants";
+
+import { ISchemasProps } from "./interface";
+
+export const Schemas: React.FC
= ({ issuerSchemas }) => {
+ const {
+ network: { network },
+ } = useNetworkContext();
+ const navigate = useNavigate();
+ const location = useLocation();
+ const { isDarkMode } = useTernaryDarkMode();
+
+ if (issuerSchemas === undefined || issuerSchemas.length === 0) return null;
+
+ const handleSeeAttestationsClick = (portal: string, schema: string) => {
+ const whereClauseJSON = {
+ portal_: { id: portal },
+ schema_: { id: schema },
+ };
+ const whereClause = `?where=${encodeURIComponent(JSON.stringify(whereClauseJSON))}`;
+ navigate(APP_ROUTES.ATTESTATIONS.replace(CHAIN_ID_ROUTE, network) + whereClause, {
+ state: { from: location.pathname },
+ });
+ };
+
+ const displayLogo = (attestationDefinition: AttestationDefinition) => {
+ const Logo: React.FC> =
+ isDarkMode && attestationDefinition.logoDark ? attestationDefinition.logoDark : attestationDefinition.logo;
+ return ;
+ };
+
+ return (
+
+ {issuerSchemas.map((issuerSchema) => (
+
+
+
+ {displayLogo(issuerSchema)}
+
+ {issuerSchema.name}
+
+
{issuerSchema.description}
+
+
+
+ ))}
+
+ );
+};
diff --git a/explorer/src/pages/Issuer/components/Schemas/interface.ts b/explorer/src/pages/Issuer/components/Schemas/interface.ts
new file mode 100644
index 00000000..d02a564c
--- /dev/null
+++ b/explorer/src/pages/Issuer/components/Schemas/interface.ts
@@ -0,0 +1,6 @@
+import { AttestationDefinition } from "@/pages/Home/interface";
+
+export interface ISchemasProps {
+ issuerSchemas?: AttestationDefinition[];
+ CTALink?: string;
+}
diff --git a/explorer/src/pages/Issuer/index.tsx b/explorer/src/pages/Issuer/index.tsx
index 5e9b95e8..27f5660c 100644
--- a/explorer/src/pages/Issuer/index.tsx
+++ b/explorer/src/pages/Issuer/index.tsx
@@ -1,30 +1,36 @@
import { useLocation, useNavigate, useParams } from "react-router-dom";
+import { useTernaryDarkMode } from "usehooks-ts";
import { APP_ROUTES } from "@/routes/constants";
+import { Attestations } from "./components/Attestations";
import { Banner } from "./components/Banner";
import { Description } from "./components/Description";
-import { Portals } from "./components/Portals";
+import { Schemas } from "./components/Schemas";
import { issuersData } from "../Home/data";
export const Issuer: React.FC = () => {
const { id } = useParams();
const navigate = useNavigate();
const location = useLocation();
+ const { isDarkMode } = useTernaryDarkMode();
- const { name, description, CTALink, CTATitle, logo, keywords, address } =
+ const { name, description, CTALink, CTATitle, logo, logoDark, keywords, address, attestationDefinitions } =
issuersData.find((issuer) => issuer.address === id) || {};
- if (!name || !description || !logo || !keywords || !address || !CTATitle) {
+ const IssuerLogo = isDarkMode && logoDark ? logoDark : logo;
+
+ if (!name || !description || !IssuerLogo || !keywords || !address || !CTATitle) {
navigate(APP_ROUTES.HOME, { state: { from: location.pathname } });
return null;
}
return (
-
-
-
-
+
);
};
diff --git a/explorer/src/utils/amountUtils.ts b/explorer/src/utils/amountUtils.ts
index 68317e29..4804ca20 100644
--- a/explorer/src/utils/amountUtils.ts
+++ b/explorer/src/utils/amountUtils.ts
@@ -4,3 +4,13 @@ export const displayAmountWithComma = (str: string | number): string =>
.replace(/\B(?=(\d{3})+(?!\d))/g, ",");
export const randomNumber = (min: number, max: number) => Math.floor(Math.random() * (max - min) + min);
+
+export const formatNumber = (num: number): string => {
+ if (num >= 1_000_000) {
+ return (num / 1_000_000).toFixed(1) + "M";
+ }
+ if (num >= 1_000) {
+ return (num / 1_000).toFixed(1) + "K";
+ }
+ return num.toString();
+};