Skip to content
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
72 changes: 72 additions & 0 deletions src/app/base-migration/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
import { Header } from "@/components/Header"
import {
Layout,
LayoutBanner,
LayoutHeadline,
LayoutHero,
LayoutMain,
LayoutTitle,
} from "@/components/Layout"
import { Avatar, AvatarImage } from "@/components/ui/Avatar"
import { buttonVariants } from "@/components/ui/Button"
import { Card } from "@/components/ui/Card"
import { ArrowSquareOut } from "@phosphor-icons/react/dist/ssr"
import Image from "next/image"

const Page = () => (
<Layout>
<LayoutHero className="pb-28">
<LayoutBanner>
<Image
src="https://guild-xyz.mypinata.cloud/ipfs/QmbvZpQ6jX6HCe4ecYqaU89z61YT6zZ51yEtQQ3yTHiGxc"
alt="Base cover image"
priority
fill
sizes="100vw"
style={{
filter: "brightness(30%)",
objectFit: "cover",
}}
/>
</LayoutBanner>

<Header />
<LayoutHeadline className="max-w-screen-md">
<Avatar className="row-span-2 size-20 md:size-24">
<AvatarImage
src="https://guild-xyz.mypinata.cloud/ipfs/QmQDHQiTF7KTBiHGC48GSoWPzDg8tWB2XZscTReqaX5tnt"
alt="Base logo"
width={96}
height={96}
/>
</Avatar>
<LayoutTitle className="text-foreground">Base</LayoutTitle>
</LayoutHeadline>
</LayoutHero>

<LayoutMain className="prose mt-16 prose-p:mt-0 prose-p:mb-4 flex max-w-screen-md flex-col prose-headings:font-display prose-headings:text-foreground prose-li:text-foreground text-foreground text-lg marker:text-foreground">
<Card className="bg-card-secondary p-6">
<h2 className="mt-0">Base Guild is migrating to Guild v2</h2>
<p>
During this upgrade, the guild is temporarily unavailable. Your existing
roles are safe and you will be able to claim new roles once we launch.
</p>
<p>Base Guild v2 launches next week!</p>
<p>Stay based!</p>
<a
href="https://era.guild.xyz/explorer"
target="_blank"
className={buttonVariants({
colorScheme: "primary",
className: "mt-8 no-underline",
})}
>
<span>Explore Guild v2</span>
<ArrowSquareOut weight="bold" />
</a>
</Card>
</LayoutMain>
</Layout>
)

export default Page
7 changes: 6 additions & 1 deletion src/middleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ export const config = {

export async function middleware(request: NextRequest) {
const guildUrlName = request.nextUrl.pathname.split("/")[1]

if (guildUrlName === "base") {
return NextResponse.redirect("https://guild.xyz/base-migration")
}

const _redirects = await get("redirects")

const redirects = z
Expand All @@ -29,7 +34,7 @@ export async function middleware(request: NextRequest) {
const sameRedirect = redirects.sameURL.find((urlName) => urlName === guildUrlName)

if (sameRedirect) {
return NextResponse.redirect(`https://era.guild.xyz/${sameRedirect}`)
return NextResponse.redirect(`https://era.guild.xyz/${request.nextUrl.pathname}`)
}

const mappedRedirect = redirects.mapURL.find(
Expand Down
Loading