Skip to content

Commit

Permalink
feat: link github username (#22)
Browse files Browse the repository at this point in the history
close #22
  • Loading branch information
aahna-ashina committed Sep 19, 2023
1 parent ebdd1e3 commit 933cf48
Show file tree
Hide file tree
Showing 4 changed files with 121 additions and 3 deletions.
110 changes: 110 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
"eslint-config-next": "13.3.0",
"next": "13.3.0",
"papaparse": "^5.4.1",
"passport-github2": "^0.1.12",
"postcss": "8.4.21",
"react": "18.2.0",
"react-apexcharts": "^1.4.0",
Expand Down
11 changes: 9 additions & 2 deletions src/components/ProfileDetailsGitHub.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,17 @@ export default function ProfileDetailsGitHub({ address }: any) {
}
console.info('gitHubUsername:', gitHubUsername)
if (!gitHubUsername) {
return <code>Not linked</code>
return (
<>
<code>Not linked</code>
<Link className="ml-4 font-bold text-transparent bg-clip-text bg-gradient-to-br from-sky-400 to-green-400" href={`https://etherscan.io/address/0xb989c0c17a3bce679d7586d9e55b6eab11c18687#writeContract#F1`}>
Update ↗
</Link>
</>
)
} else {
return (
<Link target="_blank" className="font-bold text-transparent bg-clip-text bg-gradient-to-br from-blue-400 to-green-400" href={`https://github.com/${gitHubUsername}`}>
<Link target="_blank" className="font-bold text-transparent bg-clip-text bg-gradient-to-br from-sky-400 to-green-400" href={`https://github.com/${gitHubUsername}`}>
<code>@{gitHubUsername}</code>
</Link>
)
Expand Down
2 changes: 1 addition & 1 deletion src/pages/[passportId].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ export default function ProfilePage({ citizen, nationCred, veNation, dework, sou
<ul>
<li className='text-ellipsis overflow-hidden'>
<span className='text-gray-400 '>Ethereum address</span><br />
<Link target='_blank' className="font-bold text-transparent bg-clip-text bg-gradient-to-br from-blue-400 to-green-400" href={`https://etherscan.io/address/${citizen.ownerAddress}`}>
<Link target='_blank' className="font-bold text-transparent bg-clip-text bg-gradient-to-br from-sky-400 to-green-400" href={`https://etherscan.io/address/${citizen.ownerAddress}`}>
<code>{citizen.ownerAddress}</code>
</Link>
</li>
Expand Down

0 comments on commit 933cf48

Please sign in to comment.