diff --git a/components/CitizenCard.tsx b/components/CitizenCard.tsx
index 63a33ab..fbaaca0 100644
--- a/components/CitizenCard.tsx
+++ b/components/CitizenCard.tsx
@@ -13,7 +13,7 @@ export default function CitizenCard({
votingPower
}: any) {
return (
-
+
@@ -36,7 +36,7 @@ export default function CitizenCard({
🎗️ NationCred: ?/???
🗳️ Voting power: {votingPower.toFixed(2)}
- link
+ link
diff --git a/pages/profile/[passportId].tsx b/pages/[passportId].tsx
similarity index 90%
rename from pages/profile/[passportId].tsx
rename to pages/[passportId].tsx
index 1880d2e..9d06b83 100644
--- a/pages/profile/[passportId].tsx
+++ b/pages/[passportId].tsx
@@ -1,7 +1,7 @@
import { useEffect, useRef, useState } from "react"
import { NextPage } from "next"
import Image from "next/image"
-import dework from '../../public/dework.svg'
+import dework from '../public/dework.svg'
// @ts-expect-error
import Blockies from 'react-blockies'
@@ -34,7 +34,7 @@ ChartJS.register(
Legend
)
-export function NationCredChart({ profile }: any) {
+export function NationCredChart({ citizen }: any) {
console.info('NationCredChart')
const chartRef = useRef
(null)
@@ -55,7 +55,7 @@ export function NationCredChart({ profile }: any) {
colorGradient.addColorStop(1, 'rgba(213, 163, 152, 0.8)')
// Fetch data from datasets repo
- const sourceCredFileUrl: string = `https://raw.githubusercontent.com/nation3/nationcred-datasets/main/data-sources/sourcecred/output/sourcecred-${profile.ownerAddress}.csv`
+ const sourceCredFileUrl: string = `https://raw.githubusercontent.com/nation3/nationcred-datasets/main/data-sources/sourcecred/output/sourcecred-${citizen.passportId}.csv`
console.info('Fetching SourceCred data:', sourceCredFileUrl)
Papa.parse(sourceCredFileUrl, {
download: true,
@@ -120,7 +120,7 @@ export function NationCredChart({ profile }: any) {
return
}
-export function DeworkChart({ profile }: any) {
+export function DeworkChart({ citizen }: any) {
console.info('DeworkChart')
const chartRef = useRef(null)
@@ -141,7 +141,7 @@ export function DeworkChart({ profile }: any) {
colorGradient.addColorStop(1, 'rgba(231, 88, 143, 0.2)')
// Fetch data from datasets repo
- const deworkFileUrl: string = `https://raw.githubusercontent.com/nation3/nationcred-datasets/main/data-sources/dework/output/dework-${profile.ownerAddress}.csv`
+ const deworkFileUrl: string = `https://raw.githubusercontent.com/nation3/nationcred-datasets/main/data-sources/dework/output/dework-${citizen.passportId}.csv`
console.info('Fetching Dework data:', deworkFileUrl)
Papa.parse(deworkFileUrl, {
download: true,
@@ -190,26 +190,26 @@ export function DeworkChart({ profile }: any) {
return
}
-const ProfilePage: NextPage = ({ profile }: any) => {
+const ProfilePage: NextPage = ({ citizen }: any) => {
console.info('ProfilePage')
- console.info('profile:', profile)
+ console.info('citizen:', citizen)
return (
<>
- {profile.ensName ? (
-

+ {citizen.ensName ? (
+

) : (
-
+
)}
- {profile.ensName ? profile.ensName : `${profile.ownerAddress.substring(0, 6)}...${profile.ownerAddress.slice(-4)}`}
+ {citizen.ensName ? citizen.ensName : `${citizen.ownerAddress.substring(0, 6)}...${citizen.ownerAddress.slice(-4)}`}
- Citizen #{profile.passportId}
+ Citizen #{citizen.passportId}
@@ -224,7 +224,7 @@ const ProfilePage: NextPage = ({ profile }: any) => {
@@ -232,13 +232,13 @@ const ProfilePage: NextPage = ({ profile }: any) => {
🗳️ Voting Power
- Voting power: {profile.votingPower.toFixed(2)}
+ Voting power: {citizen.votingPower.toFixed(2)}
@@ -281,7 +281,7 @@ export async function getStaticProps(context: any) {
return {
props: {
- profile: citizen
+ citizen: citizen
}
}
}