Skip to content

Commit

Permalink
Merge pull request #45 from nation3/refactor-rename-voting-power
Browse files Browse the repository at this point in the history
Rename voting power
  • Loading branch information
aahna-ashina authored Sep 22, 2023
2 parents 059cc0e + 2480e17 commit 491fbb4
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions src/pages/[passportId].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ export default function ProfilePage({ citizen, nationCred, veNation, dework, sou
</div>

<div className='mt-8'>
<h2 className="text-2xl">🗳️ Voting Power</h2>
<h2 className="text-2xl">🗳️ Voting Escrow</h2>
<div className='mt-2'>
{router.isFallback ? (
<LoadingIndicator />
Expand All @@ -183,7 +183,7 @@ export default function ProfilePage({ citizen, nationCred, veNation, dework, sou
{router.isFallback ? (
<LoadingIndicator />
) : (
<VotingPowerChart veNation={veNation} />
<VotingEscrowChart veNation={veNation} />
)}
</div>
</div>
Expand Down Expand Up @@ -303,17 +303,17 @@ export function DeworkChart({ citizen, dework }: any) {
)
}

export function VotingPowerChart({ citizen, veNation }: any) {
console.info('VotingPowerChart')
export function VotingEscrowChart({ citizen, veNation }: any) {
console.info('VotingEscrowChart')
const chartData = {
series: [
{
name: 'Passport expiry threshold',
data: new Array(veNation.voting_power_per_week.length).fill(1.5)
data: new Array(veNation.voting_escrow_per_week.length).fill(1.5)
},
{
name: 'Voting power',
data: veNation.voting_power_per_week
name: 'Voting escrow',
data: veNation.voting_escrow_per_week
}
],
options: {
Expand Down Expand Up @@ -403,7 +403,7 @@ export async function getStaticProps(context: any) {
const veNationResponse = await fetch(veNationFileUrl)
const veNationData = await veNationResponse.text()
console.info('veNationData:\n', veNationData)
const venation_voting_power_per_week: number[] = []
const venation_voting_escrow_per_week: number[] = []
Papa.parse(veNationData, {
header: true,
skipEmptyLines: true,
Expand All @@ -412,9 +412,9 @@ export async function getStaticProps(context: any) {
console.info('result:', result)
result.data.forEach((row: any, i: number) => {
console.info(`row ${i}`, row)
venation_voting_power_per_week[i] = Number(row.voting_power)
venation_voting_escrow_per_week[i] = Number(row.voting_power)
})
console.info('venation_voting_power_per_week:', venation_voting_power_per_week)
console.info('venation_voting_escrow_per_week:', venation_voting_escrow_per_week)
}
})

Expand Down Expand Up @@ -489,7 +489,7 @@ export async function getStaticProps(context: any) {
is_active_per_week: nationcred_is_active_per_week
},
veNation: {
voting_power_per_week: venation_voting_power_per_week
voting_escrow_per_week: venation_voting_escrow_per_week
},
dework: {
week_ends: dework_week_ends,
Expand Down

0 comments on commit 491fbb4

Please sign in to comment.