Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add button #76

Merged
merged 1 commit into from
Oct 25, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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