Skip to content

Commit 80026c6

Browse files
committed
Update list-form.tsx
1 parent f358fe7 commit 80026c6

File tree

4 files changed

+41
-18
lines changed

4 files changed

+41
-18
lines changed

apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/(marketplace)/components/list-form.tsx

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { Alert, AlertTitle } from "@/components/ui/alert";
22
import { Button } from "@/components/ui/button";
33
import { Card } from "@/components/ui/card";
4+
import { cn } from "@/lib/utils";
45
import { useDashboardOwnedNFTs } from "@3rdweb-sdk/react/hooks/useDashboardOwnedNFTs";
56
import { useWalletNFTs } from "@3rdweb-sdk/react/hooks/useWalletNFTs";
67
import {
@@ -540,7 +541,7 @@ export const CreateListingsForm: React.FC<CreateListingsFormProps> = ({
540541
>
541542
<div
542543
className={cn(
543-
"rounded-lg overflow-hidden cursor-pointer",
544+
"cursor-pointer overflow-hidden rounded-lg",
544545
isSelected(nft) &&
545546
"outline outline-3 outline-purple-500",
546547
)}
@@ -549,6 +550,17 @@ export const CreateListingsForm: React.FC<CreateListingsFormProps> = ({
549550
? form.setValue("selected", undefined)
550551
: form.setValue("selected", nft)
551552
}
553+
onKeyDown={(e) => {
554+
if (e.key === "Enter" || e.key === " ") {
555+
e.preventDefault();
556+
isSelected(nft)
557+
? form.setValue("selected", undefined)
558+
: form.setValue("selected", nft);
559+
}
560+
}}
561+
tabIndex={0}
562+
role="button"
563+
aria-pressed={isSelected(nft)}
552564
>
553565
<NFTMediaWithEmptyState
554566
metadata={nft.metadata}

apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/_components/claim-conditions/claim-conditions-form/Inputs/ClaimPriceInput.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { cn } from "@/lib/utils";
12
import { Flex } from "@chakra-ui/react";
23
import { CurrencySelector } from "components/shared/CurrencySelector";
34
import { NATIVE_TOKEN_ADDRESS } from "thirdweb";
@@ -36,7 +37,7 @@ export const ClaimPriceInput = (props: {
3637
}
3738
>
3839
<Flex gap={2} flexDir={{ base: "column", md: "row" }}>
39-
<div className="min-w-[70px] w-full md:w-1/2">
40+
<div className="w-full min-w-[70px] md:w-1/2">
4041
<PriceInput
4142
w="full"
4243
value={field.price?.toString() || ""}

apps/dashboard/src/core-ui/batch-upload/batch-table.tsx

Lines changed: 25 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import { CodeClient } from "@/components/ui/code/code.client";
22
import { ToolTipLabel } from "@/components/ui/tooltip";
33
import {
4-
type BoxProps,
54
Flex,
65
IconButton,
76
Image,
@@ -28,6 +27,7 @@ import { useMemo } from "react";
2827
import { type Column, usePagination, useTable } from "react-table";
2928
import type { NFTInput } from "thirdweb/utils";
3029
import { useThirdwebClient } from "../../@/constants/thirdweb.client";
30+
import { cn } from "../../@/lib/utils";
3131

3232
const FileImage: React.FC<ImageProps> = ({ src, ...props }) => {
3333
const client = useThirdwebClient();
@@ -40,17 +40,36 @@ const FileImage: React.FC<ImageProps> = ({ src, ...props }) => {
4040
};
4141

4242
const FileVideo: React.FC<
43-
BoxProps &
44-
Omit<React.ComponentProps<"video">, "ref" | "src"> & { src: string | File }
45-
> = ({ src, ...props }) => {
43+
React.VideoHTMLAttributes<HTMLVideoElement> & { src: string | File }
44+
> = ({
45+
src,
46+
className = "",
47+
autoPlay,
48+
playsInline,
49+
muted,
50+
loop,
51+
...videoProps
52+
}) => {
4653
const client = useThirdwebClient();
4754
const video = useImageFileOrUrl(
4855
typeof src === "string" && src.startsWith("ipfs://")
4956
? replaceIpfsUrl(src, client)
5057
: src,
5158
);
52-
return <video {...props} src={video} />;
59+
60+
return (
61+
<video
62+
src={video}
63+
autoPlay={autoPlay}
64+
playsInline={playsInline}
65+
muted={muted}
66+
loop={loop}
67+
className={cn("h-24 w-24 flex-shrink-0 object-contain", className)}
68+
{...videoProps}
69+
/>
70+
);
5371
};
72+
5473
interface BatchTableProps {
5574
data: NFTInput[];
5675
portalRef: React.RefObject<HTMLDivElement | null>;
@@ -89,16 +108,7 @@ export const BatchTable: React.FC<BatchTableProps> = ({
89108
Header: "Animation Url",
90109
accessor: (row) => row.animation_url,
91110
Cell: ({ cell: { value } }: { cell: { value?: string } }) => (
92-
<FileVideo
93-
flexShrink={0}
94-
boxSize={24}
95-
objectFit="contain"
96-
src={value || ""}
97-
autoPlay
98-
playsInline
99-
muted
100-
loop
101-
/>
111+
<FileVideo src={value || ""} autoPlay playsInline muted loop />
102112
),
103113
},
104114
{ Header: "Name", accessor: (row) => row.name },

apps/dashboard/src/tw-components/card.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export const Card: React.FC<CardProps> = ({
2626
style={{ padding: outlineBorder.width }}
2727
>
2828
<div
29-
className="absolute inset-0 -z-10"
29+
className="-z-10 absolute inset-0"
3030
style={{ background: outlineBorder.gradient }}
3131
/>
3232
<div className={baseClasses} {...props}>

0 commit comments

Comments
 (0)