-
Notifications
You must be signed in to change notification settings - Fork 439
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add join profile action card (#1451)
* feat: add join profile action card * feat: add mountain icon and restrict card popup * chore: prevent pointer event overlay
- Loading branch information
1 parent
1dfe3db
commit ad31993
Showing
2 changed files
with
47 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 45 additions & 0 deletions
45
src/app/(marketing)/profile/_components/JoinProfileAction.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> | ||
) | ||
} |