Skip to content

Commit

Permalink
Merge pull request #76 from SeonghyeonKim/main
Browse files Browse the repository at this point in the history
feat: add button
  • Loading branch information
moreal authored Oct 25, 2024
2 parents b4c3eac + b635a19 commit e7d56d3
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion pages/[network]/agent/[address].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { getHeadlessGraphQLSDK } from "../../../utils/headlessGraphQLClient";

interface Agent {
avatars: Avatar[];
address: string;
}

interface Avatar {
Expand All @@ -13,6 +14,7 @@ interface Avatar {
}

interface AgentPageProps {
network: string;
agent: Agent | null
}

Expand Down Expand Up @@ -41,7 +43,7 @@ function Avatar(avatar: Avatar) {
);
}

const AgentPage: NextPage<AgentPageProps> = ({ agent }) => {
const AgentPage: NextPage<AgentPageProps> = ({ agent, network }) => {
if (agent === null) {
return (
<h1>There is no such agent.</h1>
Expand All @@ -58,6 +60,7 @@ const AgentPage: NextPage<AgentPageProps> = ({ agent }) => {
return (
<div>
{agent.avatars.map(avatar => <Avatar key={avatar.address} {...avatar} />)}
<a href = {`/${network}/stake/${agent.address}`} ><button style={style}>Go to Stake</button></a>
</div>
)
}
Expand All @@ -79,6 +82,7 @@ export const getServerSideProps: GetServerSideProps<AgentPageProps> = async (con
return {
props: {
agent: null,
network: network,
}
}
}
Expand All @@ -87,7 +91,9 @@ export const getServerSideProps: GetServerSideProps<AgentPageProps> = async (con
props: {
agent: {
avatars: agentJsonObj.avatarStates as Avatar[],
address: address,
},
network: network,
}
}
}
Expand Down

0 comments on commit e7d56d3

Please sign in to comment.