-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: add SNS support, fix broken zustand persistance store in SS…
…R, stub gallery routes
- Loading branch information
1 parent
ab60209
commit 6e5f41a
Showing
14 changed files
with
315 additions
and
129 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
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,29 @@ | ||
"use client"; | ||
|
||
import { useAppState } from "@/hooks/useAppState"; | ||
import { redirect } from "next/navigation"; | ||
import { CollectionImageCard } from "@/components/collection/collection-image-card"; | ||
|
||
type ViewProps = { | ||
params: { | ||
id: string; | ||
}; | ||
}; | ||
|
||
export default function View({ params }: ViewProps) { | ||
const collection = useAppState( | ||
(state) => state.collections.published[params.id] | ||
); | ||
if (!collection) redirect("/"); | ||
|
||
return ( | ||
<div className="flex justify-stretch"> | ||
<main className="flex-1 p-8"> | ||
<h1 className="text-2xl font-bold">{collection?.name}</h1> | ||
{collection?.items.map((item, idx) => ( | ||
<CollectionImageCard key={idx} item={item} /> | ||
))} | ||
</main> | ||
</div> | ||
); | ||
} |
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
Binary file not shown.
Binary file not shown.
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
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
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,24 @@ | ||
import { Avatar, AvatarFallback, AvatarImage } from "./ui/avatar"; | ||
import { PersonIcon } from "@radix-ui/react-icons"; | ||
import { useConnection } from "@solana/wallet-adapter-react"; | ||
import { usePrimaryDomain, useProfilePic } from "@bonfida/sns-react"; | ||
import { PublicKey } from "@solana/web3.js"; | ||
|
||
export type AvatarSNSProps = { | ||
publicKey: PublicKey; | ||
}; | ||
|
||
export function AvatarSNS({ publicKey }: AvatarSNSProps) { | ||
const { connection } = useConnection(); | ||
const { domain } = usePrimaryDomain(connection, publicKey); | ||
const { profileUrl } = useProfilePic(connection, domain); | ||
|
||
return ( | ||
<Avatar className="w-6 h-6"> | ||
<AvatarImage src={profileUrl || undefined} /> | ||
<AvatarFallback> | ||
<PersonIcon /> | ||
</AvatarFallback> | ||
</Avatar> | ||
); | ||
} |
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,26 @@ | ||
import { AspectRatio } from "@radix-ui/react-aspect-ratio"; | ||
import { ImageWithFallback } from "../image-with-fallback"; | ||
import { Collection } from "@/hooks/useCreateCollectionQuery"; | ||
import { ImageIcon } from "@radix-ui/react-icons"; | ||
|
||
export type CollectionImageCardProps = { | ||
item: Collection; | ||
}; | ||
|
||
export function CollectionImageCard({ item }: CollectionImageCardProps) { | ||
return ( | ||
<div className="flex flex-col items-center justify-center w-40 h-40 bg-white rounded-lg shadow-md"> | ||
<AspectRatio ratio={1 / 1}> | ||
<ImageWithFallback src={item.image} alt={item.name}> | ||
<div className="flex items-center justify-center w-full h-full p-4 text-muted-foreground"> | ||
<ImageIcon /> | ||
</div> | ||
</ImageWithFallback> | ||
</AspectRatio> | ||
<div className="flex flex-col items-center justify-center p-4"> | ||
<h3 className="text-lg font-semibold">Collection Name</h3> | ||
<p className="text-sm text-gray-500">3 items</p> | ||
</div> | ||
</div> | ||
); | ||
} |
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 |
---|---|---|
@@ -1,3 +1,5 @@ | ||
"use client"; | ||
|
||
import { | ||
NavigationMenu, | ||
NavigationMenuItem, | ||
|
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
Oops, something went wrong.