Skip to content

Commit 933cf48

Browse files
committed
feat: link github username (#22)
close #22
1 parent ebdd1e3 commit 933cf48

File tree

4 files changed

+121
-3
lines changed

4 files changed

+121
-3
lines changed

package-lock.json

Lines changed: 110 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
"eslint-config-next": "13.3.0",
2020
"next": "13.3.0",
2121
"papaparse": "^5.4.1",
22+
"passport-github2": "^0.1.12",
2223
"postcss": "8.4.21",
2324
"react": "18.2.0",
2425
"react-apexcharts": "^1.4.0",

src/components/ProfileDetailsGitHub.tsx

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,17 @@ export default function ProfileDetailsGitHub({ address }: any) {
2626
}
2727
console.info('gitHubUsername:', gitHubUsername)
2828
if (!gitHubUsername) {
29-
return <code>Not linked</code>
29+
return (
30+
<>
31+
<code>Not linked</code>
32+
<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`}>
33+
Update ↗
34+
</Link>
35+
</>
36+
)
3037
} else {
3138
return (
32-
<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}`}>
39+
<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}`}>
3340
<code>@{gitHubUsername}</code>
3441
</Link>
3542
)

src/pages/[passportId].tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ export default function ProfilePage({ citizen, nationCred, veNation, dework, sou
7171
<ul>
7272
<li className='text-ellipsis overflow-hidden'>
7373
<span className='text-gray-400 '>Ethereum address</span><br />
74-
<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}`}>
74+
<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}`}>
7575
<code>{citizen.ownerAddress}</code>
7676
</Link>
7777
</li>

0 commit comments

Comments
 (0)