-
Notifications
You must be signed in to change notification settings - Fork 619
Dashboard: Add NFT creation wizard in Asset page #7315
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
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,6 @@ | ||
| --- | ||
| "thirdweb": patch | ||
| --- | ||
|
|
||
| - Add support for blob urls in `MediaRenderer` component | ||
| - Fix `className` prop not set in loading state of `MediaRenderer` component |
This file contains hidden or 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 hidden or 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
53 changes: 53 additions & 0 deletions
53
apps/dashboard/src/@/components/blocks/drop-zone/drop-zone.stories.tsx
This file contains hidden or 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,53 @@ | ||
| import type { Meta, StoryObj } from "@storybook/react"; | ||
| import { DropZone } from "./drop-zone"; | ||
|
|
||
| const meta = { | ||
| title: "blocks/DropZone", | ||
| component: DropZone, | ||
| decorators: [ | ||
| (Story) => ( | ||
| <div className="container max-w-6xl py-10"> | ||
| <Story /> | ||
| </div> | ||
| ), | ||
| ], | ||
| } satisfies Meta<typeof DropZone>; | ||
|
|
||
| export default meta; | ||
| type Story = StoryObj<typeof meta>; | ||
|
|
||
| export const Default: Story = { | ||
| args: { | ||
| isError: false, | ||
| onDrop: () => {}, | ||
| title: "This is a title", | ||
| description: "This is a description for drop zone", | ||
| accept: undefined, | ||
| resetButton: undefined, | ||
| }, | ||
| }; | ||
|
|
||
| export const ErrorState: Story = { | ||
| args: { | ||
| isError: true, | ||
| onDrop: () => {}, | ||
| title: "this is title", | ||
| description: "This is a description", | ||
| accept: undefined, | ||
| resetButton: undefined, | ||
| }, | ||
| }; | ||
|
|
||
| export const ErrorStateWithResetButton: Story = { | ||
| args: { | ||
| isError: true, | ||
| onDrop: () => {}, | ||
| title: "this is title", | ||
| description: "This is a description", | ||
| accept: undefined, | ||
| resetButton: { | ||
| label: "Remove Files", | ||
| onClick: () => {}, | ||
| }, | ||
| }, | ||
| }; |
81 changes: 81 additions & 0 deletions
81
apps/dashboard/src/@/components/blocks/drop-zone/drop-zone.tsx
This file contains hidden or 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,81 @@ | ||
| import { Button } from "@/components/ui/button"; | ||
| import { cn } from "@/lib/utils"; | ||
| import { UploadIcon, XIcon } from "lucide-react"; | ||
| import { useDropzone } from "react-dropzone"; | ||
|
|
||
| export function DropZone(props: { | ||
| isError: boolean; | ||
| onDrop: (acceptedFiles: File[]) => void; | ||
| title: string; | ||
| description: string; | ||
| resetButton: | ||
| | { | ||
| label: string; | ||
| onClick: () => void; | ||
| } | ||
| | undefined; | ||
| className?: string; | ||
| accept: string | undefined; | ||
| }) { | ||
| const { getRootProps, getInputProps } = useDropzone({ | ||
| onDrop: props.onDrop, | ||
| }); | ||
|
|
||
| const { resetButton } = props; | ||
|
|
||
| return ( | ||
| <div | ||
| className={cn( | ||
| "flex cursor-pointer items-center justify-center rounded-md border border-dashed bg-card py-10 hover:border-active-border", | ||
| props.isError && | ||
| "border-red-500 bg-red-200/30 text-red-500 hover:border-red-600 dark:border-red-900 dark:bg-red-900/30 dark:hover:border-red-800", | ||
| props.className, | ||
| )} | ||
| {...getRootProps()} | ||
| > | ||
| <input {...getInputProps()} accept={props.accept} /> | ||
| <div className="flex flex-col items-center justify-center gap-3"> | ||
| {!props.isError && ( | ||
| <div className="flex flex-col items-center"> | ||
| <div className="mb-3 flex size-11 items-center justify-center rounded-full border bg-card"> | ||
| <UploadIcon className="size-5" /> | ||
| </div> | ||
| <h2 className="mb-0.5 text-center font-medium text-lg"> | ||
| {props.title} | ||
| </h2> | ||
| <p className="text-center font-medium text-muted-foreground text-sm"> | ||
| {props.description} | ||
| </p> | ||
| </div> | ||
| )} | ||
|
|
||
| {props.isError && ( | ||
| <div className="flex flex-col items-center"> | ||
| <div className="mb-3 flex size-11 items-center justify-center rounded-full border border-red-500 bg-red-200/50 text-red-500 dark:border-red-900 dark:bg-red-900/30 dark:text-foreground"> | ||
| <XIcon className="size-5" /> | ||
| </div> | ||
| <h2 className="mb-0.5 text-center font-medium text-foreground text-lg"> | ||
| {props.title} | ||
| </h2> | ||
| <p className="text-balance text-center text-sm"> | ||
| {props.description} | ||
| </p> | ||
|
|
||
| {resetButton && ( | ||
| <Button | ||
| className="relative z-50 mt-4" | ||
| size="sm" | ||
| onClick={(e) => { | ||
| e.stopPropagation(); | ||
| resetButton.onClick(); | ||
| }} | ||
| > | ||
| {resetButton.label} | ||
| </Button> | ||
| )} | ||
| </div> | ||
| )} | ||
| </div> | ||
| </div> | ||
| ); | ||
| } | ||
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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,4 @@ | ||
| export function fileToBlobUrl(file: File) { | ||
| const blob = new Blob([file], { type: file.type }); | ||
| return URL.createObjectURL(blob); | ||
| } |
2 changes: 1 addition & 1 deletion
2
apps/dashboard/src/app/(app)/(dashboard)/(bridge)/routes/page.tsx
This file contains hidden or 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 hidden or 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 hidden or 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.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.