Skip to content

Commit

Permalink
Merge pull request #10 from aahna-ashina/dw-920/voting-power
Browse files Browse the repository at this point in the history
feat: display voting power per citizen
  • Loading branch information
aahna-ashina authored Nov 17, 2022
2 parents 9e74b1a + 07188d8 commit 4247291
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
8 changes: 5 additions & 3 deletions components/CitizenCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ import { IdentificationIcon } from '@heroicons/react/24/outline'
export default function CitizenCard({
passportId,
ethAddress,
ensName
ensName,
votingPower
}: any) {
return (
<Link href={`/profile/${passportId}`} passHref>
Expand All @@ -25,15 +26,16 @@ export default function CitizenCard({
<img className="mask mask-circle h-12 w-12" src={`https://cdn.stamp.fyi/avatar/eth:${ethAddress}?s=144`} />
</>
) : (
<Blockies className="mask mask-circle" seed={Math.random().toString()} size={12} />
<Blockies className="mask mask-circle" seed={ethAddress} size={12} />
)}

<h2 className="px-3 card-title text-center font-medium">
{ensName ? ensName : `${ethAddress.substring(0, 6)}...${ethAddress.slice(-4)}`}
</h2>
</div>

🎗️ NationCred: ?/???
🎗️ NationCred: ?/???<br />
🗳️ Voting power: {votingPower.toFixed(2)}

<GradientLink text="View citizen profile" href={`/profile/${passportId}`}>link</GradientLink>
</div>
Expand Down
1 change: 1 addition & 0 deletions pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ export function CitizenList() {
passportId={citizen.passport_id}
ethAddress={citizen.eth_address}
ensName={citizen.ens_name}
votingPower={citizen.voting_power}
/>
))
}
Expand Down

0 comments on commit 4247291

Please sign in to comment.