Skip to content

Commit

Permalink
xme
Browse files Browse the repository at this point in the history
  • Loading branch information
zlenner committed Feb 7, 2024
1 parent 2ea60d6 commit a267819
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 10 deletions.
23 changes: 16 additions & 7 deletions src/hooks/useData/useLoadData.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,22 @@ export const useLoadData = () => {

for (const row of pti_data) {
const form33Constituency = form33[row.Constituency]
if (form33Constituency?.Candidates) {
form33Constituency.Candidates = form33Constituency.Candidates.map(
(candidate) => ({
...candidate,
symbol_url: candidate.symbol_url.replace('azaadvote.com', 'capry.dev')
})
)
}
const pti_candidate_from_form_33 =
form33Constituency &&
form33Constituency.Candidates.find(
(candidate) =>
form33Constituency.Candidates.find((candidate) => {
return (
candidate['symbol_url'] ===
'https://symbols.azaadvote.com/' + row.symbolfile + '.png'
)
'https://symbols.capry.dev/' + row.symbolfile + '.png'
)
})

if (form33Constituency && !pti_candidate_from_form_33) {
seatsWithNoMatchingPTISymbol.push(row.Constituency)
Expand All @@ -89,20 +98,20 @@ export const useLoadData = () => {
candidate_name: row.Candidate,
candidate_symbol: {
text: row['Symbol'],
url: 'https://symbols.azaadvote.com/' + row['symbolfile'] + '.png',
url: 'https://symbols.capry.dev/' + row['symbolfile'] + '.png',
symbolfile: row['symbolfile']
}
},
candidates: form33Constituency?.Candidates.map((candidate) => {
let pti_backed =
candidate.symbol_url ===
'https://symbols.azaadvote.com/' + row.symbolfile + '.png'
'https://symbols.capry.dev/' + row.symbolfile + '.png'
// SPECIAL CASES

// Gohar Ali Khan NA-10 Buner
if (
row.Constituency === 'NA-10' &&
candidate.symbol_url === 'https://symbols.azaadvote.com/teapot.png'
candidate.symbol_url === 'https://symbols.capry.dev/teapot.png'
) {
pti_backed = true
}
Expand Down
7 changes: 4 additions & 3 deletions src/routes/components/Selection/SampleBallot.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ const SampleBallot = ({
const { value: QRCodeURL } = useAsyncRefresh(() => {
return new Promise((resolve, reject) => {
QRCode.toDataURL(
`https://azaadvote.com/${selectedSeat.seat}/ballot-paper`,
`https://zlenner.github.io/azaad-vote/${selectedSeat.seat}/ballot-paper`,
function (err, url) {
resolve(url)
}
Expand Down Expand Up @@ -114,7 +114,7 @@ const SampleBallot = ({
<IoMdWarning className="mr-4 text-4xl" />
<span className="text-sm">
Known issues in ballot paper of this constituency because of bad
data quality from ECP.{' '}
data quality from ECP. This website is blocked so use a VPN.
<a
href={'https://fix.azaadvote.com/' + selectedSeat.seat}
className="text-blue-500 hover:underline"
Expand Down Expand Up @@ -207,7 +207,8 @@ const SampleBallot = ({
)}
<div className="flex pt-3 mt-1 items-center border-dashed">
<div className="font-mono tracking-tight">
https://azaadvote.com/{selectedSeat.seat}/ballot-paper
https://zlenner.github.io/azaad-vote/{selectedSeat.seat}
/ballot-paper
</div>
<img
className="ml-auto"
Expand Down

0 comments on commit a267819

Please sign in to comment.