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

add join profile action card #1451

Merged
merged 4 commits into from
Aug 26, 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
2 changes: 2 additions & 0 deletions src/app/(marketing)/profile/[username]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import { ArrowRight } from "@phosphor-icons/react/dist/ssr"
import { env } from "env"
import Image from "next/image"
import { notFound, redirect } from "next/navigation"
import { JoinProfileAction } from "../_components/JoinProfileAction"
import { Profile } from "../_components/Profile"
import { ProfileColorBanner } from "../_components/ProfileColorBanner"
import { ProfileHero } from "../_components/ProfileHero"
Expand Down Expand Up @@ -146,6 +147,7 @@ const Page = async ({ params: { username } }: { params: { username: string } })
</p>
</LayoutFooter>
</Layout>
<JoinProfileAction />
</SWRProvider>
)
}
Expand Down
45 changes: 45 additions & 0 deletions src/app/(marketing)/profile/_components/JoinProfileAction.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
"use client"

import { Anchor } from "@/components/ui/Anchor"
import { Card } from "@/components/ui/Card"
import { REFERRER_USER_SEARCH_PARAM_KEY } from "@app/(marketing)/create-profile/(onboarding)/constants"
import { ArrowRight, Mountains } from "@phosphor-icons/react"
import useUser from "components/[guild]/hooks/useUser"
import { useProfile } from "../_hooks/useProfile"

export const JoinProfileAction = () => {
const profile = useProfile()
const user = useUser()
if (!profile.data || user.guildProfile) {
return
}
return (
<div className="pointer-events-none fixed bottom-6 flex w-full justify-center px-4">
<Anchor
variant="unstyled"
className="slide-in-from-bottom fade-in pointer-events-auto animate-in rounded-2xl duration-700"
href={`/create-profile/claim-pass?${REFERRER_USER_SEARCH_PARAM_KEY}=${profile.data.username}`}
>
<Card
className="flex max-w-md items-center gap-3 border border-transparent p-4 font-medium leading-tight"
style={{
background:
"padding-box linear-gradient(hsl(var(--card-secondary)), hsl(var(--card-secondary))), border-box linear-gradient(45deg, hsl(var(--primary)), violet, yellow, orange)",
}}
>
<div className="flex aspect-square items-center justify-center rounded-2xl border bg-card p-2">
<Mountains className="size-5" weight="fill" />
</div>
<div className="text-pretty">
Join{" "}
<span className="font-extrabold text-primary-subtle">
{profile.data.name || profile.data.username}
</span>{" "}
on their adventure
<ArrowRight weight="bold" className="ml-2 inline size-4" />
</div>
</Card>
</Anchor>
</div>
)
}
Loading