Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 24f4e5a

Browse files
committed
[Dashboard] Fix JSON donwload in upload-step.tsx (thirdweb-dev#5491)
## Problem solved Short description of the bug fixed or feature added <!-- start pr-codex --> --- ## PR-Codex overview This PR focuses on refactoring the `UploadStep` component in `upload-step.tsx` to replace `Heading` and `Link` components with standard HTML elements like `p` and `a`, enhancing simplicity and readability. ### Detailed summary - Replaced `Heading` components with `p` elements for text display. - Changed `Link` components to `a` elements for file downloads. - Updated class names for styling consistency. - Simplified the conditional rendering structure. > ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}` <!-- end pr-codex -->
1 parent b5baeae commit 24f4e5a

File tree

1 file changed

+18
-28
lines changed

1 file changed

+18
-28
lines changed

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

Lines changed: 18 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@ import { UnorderedList } from "@/components/ui/List/List";
22
import { InlineCode } from "@/components/ui/inline-code";
33
import { cn } from "@/lib/utils";
44
import { UploadIcon } from "lucide-react";
5-
import Link from "next/link";
6-
import { Heading, Text } from "tw-components";
75

86
interface UploadStepProps {
97
// biome-ignore lint/suspicious/noExplicitAny: FIXME
@@ -39,50 +37,44 @@ export const UploadStep: React.FC<UploadStepProps> = ({
3937
)}
4038
/>
4139
{isDragActive ? (
42-
<Heading
43-
as={Text}
44-
size="label.md"
45-
color="gray.600"
46-
textAlign="center"
47-
>
40+
<p className="text-center text-muted-foreground">
4841
Drop the files here
49-
</Heading>
42+
</p>
5043
) : (
51-
<Heading
52-
as={Text}
53-
size="label.md"
54-
lineHeight={1.2}
55-
color={hasFailed ? "red.500" : "gray.600"}
56-
textAlign="center"
44+
<p
45+
className={cn(
46+
"text-center leading-[1.2]",
47+
hasFailed ? "text-red-500" : "text-muted-foreground",
48+
)}
5749
>
5850
{hasFailed
5951
? `No valid CSV or JSON file found. Please make sure your NFT metadata includes at least a "name" field and try again.`
6052
: "Drag & Drop files or folders here, or click to select files"}
61-
</Heading>
53+
</p>
6254
)}
6355
</div>
6456
</div>
6557
</div>
6658
<div className="flex w-full flex-col gap-2 md:w-1/2">
67-
<Heading size="subtitle.sm">Requirements</Heading>
59+
<p className="text-lg">Requirements</p>
6860
<UnorderedList>
6961
<li>
7062
Files <em>must</em> contain one .csv or .json file with metadata. -{" "}
71-
<Link
63+
<a
7264
download
7365
className="text-link-foreground hover:text-foreground"
7466
href="/example.csv"
7567
>
7668
Download example.csv
77-
</Link>
69+
</a>
7870
.{" "}
79-
<Link
71+
<a
8072
download
8173
className="text-link-foreground hover:text-foreground"
8274
href="/example.json"
8375
>
8476
Download example.json
85-
</Link>
77+
</a>
8678
.
8779
</li>
8880
<li>
@@ -100,9 +92,7 @@ export const UploadStep: React.FC<UploadStepProps> = ({
10092
<strong>at the same time</strong>.
10193
</li>
10294
</UnorderedList>
103-
<Heading size="subtitle.sm" mt={4}>
104-
Options
105-
</Heading>
95+
<p className="mt-4 text-lg">Options</p>
10696
<UnorderedList>
10797
<li>
10898
Images and other file types can be used in combination.
@@ -120,25 +110,25 @@ export const UploadStep: React.FC<UploadStepProps> = ({
120110
can add an <InlineCode code="image" /> and/or
121111
<InlineCode code="animation_url" /> column and add the IPFS hashes
122112
there.{" "}
123-
<Link
113+
<a
124114
download
125115
className="text-link-foreground hover:text-foreground"
126116
href="/example-with-ipfs.csv"
127117
>
128118
Download example.csv
129-
</Link>
119+
</a>
130120
</li>
131121
<li>
132122
If you want to make your media files map to your NFTs, you can add
133123
the name of your files to the <InlineCode code="image" /> and
134124
<InlineCode code="animation_url" /> column.{" "}
135-
<Link
125+
<a
136126
download
137127
className="text-link-foreground hover:text-foreground"
138128
href="/example-with-maps.csv"
139129
>
140130
Download example.csv
141-
</Link>
131+
</a>
142132
</li>
143133
</UnorderedList>
144134
</div>

0 commit comments

Comments
 (0)