Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: nextjs v13 #304

Merged
merged 7 commits into from
Aug 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 9 additions & 22 deletions ui/components/GradientLink.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,13 @@ import Link from 'next/link'
import React from 'react'

export default function GradientLink({ text, href, textSize }: any) {
if (href?.charAt(0) === '/') {
return (
<Link href={href}>
<a
className={`text-${textSize} font-medium bg-gradient-to-r from-n3blue to-n3green text-transparent bg-clip-text`}
>
{text} →
</a>
</Link>
)
} else {
return (
<a
className={`text-${textSize} font-medium bg-gradient-to-r from-n3blue to-n3green text-transparent bg-clip-text`}
href={href}
rel="noopener noreferrer"
target="_blank"
>
{text} →
</a>
)
}
return (
<Link
href={href}
className={`text-${textSize} font-medium bg-gradient-to-r from-n3blue to-n3green text-transparent bg-clip-text`}
target={(href?.charAt(0) === '/') ? "_self" : "_blank"}
>
{text} →
</Link>
)
}
4 changes: 3 additions & 1 deletion ui/components/HomeCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ export default function HomeCard({

{children}

<GradientLink text={linkText} href={href}></GradientLink>
<div className='font-medium bg-gradient-to-r from-n3blue to-n3green text-transparent bg-clip-text'>
{linkText} →
</div>
</div>
</div>
</Link>
Expand Down
37 changes: 14 additions & 23 deletions ui/components/Layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -125,9 +125,7 @@ export default function Layout({ children }: any) {
<div className="pl-6 pt-2 cursor-pointer">
<div className="flex-none hidden lg:block">
<Link href="/" passHref>
<a>
<Image src={Logo} />
</a>
<Image src={Logo} alt="Logo" />
</Link>
</div>
<div className="flex-none lg:hidden">
Expand Down Expand Up @@ -163,19 +161,17 @@ export default function Layout({ children }: any) {
<div className="mt-6 py-4 hidden lg:block">
<div className="px-8 pt-2 cursor-pointer">
<Link href="/" passHref>
<a>
<span>
<Image src={Logo} />
</span>
{/* Logo placeholder for Dark Mode */}
{/* <span className="dark:hidden">
<Image src={LogoDark} />
</span> */}
</a>
<span>
<Image src={Logo} alt="Logo" />
</span>
{/* Logo placeholder for Dark Mode */}
{/* <span className="dark:hidden">
<Image src={LogoDark} />
</span> */}
</Link>
</div>
</div>
<ul className="menu p-4 overflow-y-auto text-base-400 grow">
<ul className="menu p-4 text-base-400 grow">
{nav.map((item: any) => (
<li
className="mt-1 relative py-2 dark:text-slate-300"
Expand All @@ -186,16 +182,10 @@ export default function Layout({ children }: any) {
key={item.href}
>
{item.href.charAt(0) === '/' ? (
<Link href={item.href}>
<a
className={`py-4 ${
router.pathname == item.href ? 'active' : ''
} ${router.pathname !== item.href ? 'dark:hover:bg-slate-700' : ''}`}
>
{item.icon}
{item.name}
<ChevronRightIcon className="h-5 w-5 absolute right-4 opacity-50" />
</a>
<Link href={item.href} className={`py-4 ${router.pathname == item.href ? 'active' : ''} ${router.pathname !== item.href ? 'dark:hover:bg-slate-700' : ''}`}>
{item.icon}
{item.name}
<ChevronRightIcon className="h-5 w-5 absolute right-4 opacity-50" />
</Link>
) : (
<a
Expand Down Expand Up @@ -318,6 +308,7 @@ export default function Layout({ children }: any) {
<div className="h-5 w-5">
<Image
src={(connectorIcons as Indexable)[connector.name]}
alt="Connector icons"
/>
</div>
) : (
Expand Down
8 changes: 4 additions & 4 deletions ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@
"@types/react-dom": "^18.0.4",
"daisyui": "^2.13.5",
"ethers": "^5.7.1",
"next": "12.1.0",
"next": "13",
"nft.storage": "^7.1.1",
"react": "17.0.2",
"react": "^18.3.1",
"react-animated-3d-card": "^1.0.2",
"react-blockies": "^1.4.1",
"react-confetti": "^6.0.1",
"react-dom": "17.0.2",
"react-dom": "^18.3.1",
"react-use": "^17.5.0",
"typescript": "^4.7.4",
"use-nft": "^0.12.0",
Expand All @@ -39,7 +39,7 @@
"autoprefixer": "^10.4.0",
"cypress": "^11",
"eslint": "8.57.0",
"eslint-config-next": "14.2.4",
"eslint-config-next": "13",
"eslint-config-prettier": "^9.1.0",
"jest": "^28.1.3",
"postcss": "^8.4.38",
Expand Down
8 changes: 4 additions & 4 deletions ui/pages/citizen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export default function Citizen() {
}}
onClick={() => addConfetti()}
>
<Image src={passportData.nft.image} layout="fill" />
<Image src={passportData.nft.image} alt="NFT image" layout="fill" />
</Card>
</div>

Expand All @@ -71,15 +71,15 @@ export default function Citizen() {
onClick={() => signMessageAndDownloadPass()}
className="w-40 xl:w-full"
>
<Image src={AddToWallet} layout="responsive" />
<Image src={AddToWallet} alt="Add to wallet" layout="responsive" />
</button>
<a
className="btn btn-primary gap-2 flex-1"
rel="noopener noreferrer"
target="_blank"
href="https://discord.gg/nation3-690584551239581708"
>
<Image src={DiscordIcon} width={24} height={24} />
<Image src={DiscordIcon} alt="Discord icon" width={24} height={24} />
<span className="hidden xl:block">
Access gated channels
</span>
Expand All @@ -90,7 +90,7 @@ export default function Citizen() {
target="_blank"
href="https://vote.nation3.org"
>
<Image src={BallotIcon} width={24} height={24} />
<Image src={BallotIcon} alt="Ballot icon" width={24} height={24} />
<span className="hidden xl:block">Vote on proposals</span>
</a>
</div>
Expand Down
2 changes: 1 addition & 1 deletion ui/pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export default function Index() {
<div className="flex flex-col max-w-3xl">
<h1 className="card-title text-center text-3xl font-semibold mb-2 dark:text-slate-300">
Welcome to Nation3
<Image src={flag} width={36} height={36} />
<Image src={flag} alt="Flag" width={36} height={36} />
</h1>

<p className="mb-8 dark:text-slate-300">
Expand Down
Loading
Loading