Skip to content

Commit

Permalink
fixed type error now building
Browse files Browse the repository at this point in the history
  • Loading branch information
Oba-One committed Jul 31, 2024
1 parent e911ad4 commit e1cf5f2
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 25 deletions.
40 changes: 16 additions & 24 deletions packages/client/src/components/Project/Info.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,6 @@ import React from "react";

import { Collaspe } from "@/components/Collaspe";

type Contract = {
id: string;
contractAddress: string;
deployerAddress: string;
deploymentHash: string;
chainId: number;
};

export interface ProjectInfoProps {
repositories: string[];
contracts: Contract[];
Expand Down Expand Up @@ -62,24 +54,24 @@ export const ProjectInfo: React.FC<ProjectInfoProps> = ({
<Collaspe title="Contracts">
<ul>
{contracts?.map((contract) => {
if (!contract) {
return null;
}
if (!contract) {
return null;
}

const blockExplorerUrl = getBlockExplorerLink({
contractAddress: contract.contractAddress,
chainId: contract.chainId,
});
const blockExplorerUrl = getBlockExplorerLink({
contractAddress: contract.contractAddress,
chainId: contract.chainId,
});

return (
<li key={blockExplorerUrl}>
<Link
target="_blank"
href={blockExplorerUrl}
>{`${contract.chainId} - ${contract.contractAddress}`}</Link>
</li>
);
})}
return (
<li key={blockExplorerUrl}>
<Link
target="_blank"
href={blockExplorerUrl}
>{`${contract.chainId} - ${contract.contractAddress}`}</Link>
</li>
);
})}
</ul>
</Collaspe>
<Collaspe title="Funding">
Expand Down
10 changes: 9 additions & 1 deletion packages/client/src/types/app.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,14 @@ declare interface Metric extends CreateMetric {
createdAt: string;
}

type Contract = {
id: string;
contractAddress: string;
deployerAddress: string;
deploymentHash: string;
chainId: number;
};

declare interface ProjectGrant {
title: string;
date: string;
Expand All @@ -91,7 +99,7 @@ declare interface Project extends ProjectItem {
metrics: ProjectMetric[];
endorsements: Endorsement[];
repositories: string[];
contracts: string[];
contracts: Contract[];
funding: ProjectGrant[];
socials: string[];
}
Expand Down

0 comments on commit e1cf5f2

Please sign in to comment.