Skip to content

Commit 7ad4fee

Browse files
committed
Update list-form.tsx
1 parent f358fe7 commit 7ad4fee

File tree

8 files changed

+49
-50
lines changed

8 files changed

+49
-50
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/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/account/components/deposit-native.tsx

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,7 @@ export const DepositNative: React.FC<DepositNativeProps> = ({
3232
const v5Chain = useV5DashboardChain(chain.chainId);
3333

3434
return (
35-
<Card
36-
style={{
37-
display: "flex",
38-
flexDirection: "row",
39-
gap: 16,
40-
alignItems: "center",
41-
}}
42-
maxW={{ base: "100%", md: "49%" }}
43-
>
35+
<Card className="flex max-w-full flex-row items-center gap-4 md:max-w-49%">
4436
<Input
4537
placeholder={`Amount in ${symbol}. ex: 0.001`}
4638
onChange={handleChange}

apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/engine/dedicated/(instance)/[engineId]/webhooks/components/webhooks-table.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ const columns = [
101101
bg="transparent"
102102
boxShadow="none"
103103
label={
104-
<Card bgColor="backgroundHighlight">
104+
<Card className="bg-backgroundHighlight">
105105
<Text>{format(date, "PP pp z")}</Text>
106106
</Card>
107107
}

apps/dashboard/src/components/contract-functions/interactive-abi-function.tsx

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -368,19 +368,7 @@ export const InteractiveAbiFunction: React.FC<InteractiveAbiFunctionProps> = (
368368

369369
return (
370370
<FormProvider {...form}>
371-
<Card
372-
gridColumn={{ base: "span 12", md: "span 9" }}
373-
borderRadius="none"
374-
bg="transparent"
375-
border="none"
376-
as={Flex}
377-
flexDirection="column"
378-
gap={4}
379-
boxShadow="none"
380-
flexGrow={1}
381-
w="100%"
382-
p={0}
383-
>
371+
<Card className="flex w-full flex-grow grid-cols-12 flex-col gap-4 rounded-none border-none bg-transparent p-0 shadow-none md:grid-cols-9">
384372
<Flex
385373
position="relative"
386374
w="100%"

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/core-ui/batch-upload/lazy-mint-form/select-option.tsx

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,12 @@ export const SelectOption: React.FC<SelectOptionProps> = ({
2424
disabledText,
2525
infoText,
2626
className,
27-
...stackProps
2827
}) => {
2928
return (
3029
<Tooltip
3130
label={
3231
disabled && (
33-
<Card bgColor="backgroundHighlight">
32+
<Card className="bg-backgroundHighlight">
3433
<Text>{disabledText}</Text>
3534
</Card>
3635
)
@@ -42,16 +41,13 @@ export const SelectOption: React.FC<SelectOptionProps> = ({
4241
>
4342
<Card
4443
className={cn(
45-
"flex flex-col gap-2 rounded-md p-5",
44+
"flex flex-col gap-2 rounded-md p-5 md:w-[350px]",
4645
disabled
47-
? "pointer-events-none cursor-not-allowed"
46+
? "pointer-events-none cursor-not-allowed bg-backgroundHighlight"
4847
: "cursor-pointer",
48+
isActive && "border-primary-500",
4949
className,
5050
)}
51-
width={{ base: "inherit", md: "350px" }}
52-
borderColor={isActive ? "primary.500" : undefined}
53-
bgColor={disabled ? "backgroundHighlight" : undefined}
54-
{...stackProps}
5551
onClick={onClick}
5652
>
5753
<Flex flexDirection="row" justifyContent="space-between">
@@ -89,7 +85,7 @@ export const SelectOption: React.FC<SelectOptionProps> = ({
8985
p={0}
9086
shouldWrapChildren
9187
label={
92-
<Card bgColor="backgroundHighlight">
88+
<Card className="bg-backgroundHighlight">
9389
<Text>{infoText}</Text>
9490
</Card>
9591
}

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)