Skip to content

Commit 985d72f

Browse files
authored
Merge branch 'main' into use-glyph/add-external-wallet
2 parents bb4d314 + b8f4966 commit 985d72f

File tree

42 files changed

+117
-895
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+117
-895
lines changed

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

Lines changed: 43 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
import { UploadIcon } from "lucide-react";
1+
import { ArrowDownToLineIcon, UploadIcon } from "lucide-react";
2+
import Papa from "papaparse";
3+
import { handleDownload } from "@/components/blocks/download-file-button";
24
import { FormFieldSetup } from "@/components/blocks/FormFieldSetup";
35
import { Button } from "@/components/ui/button";
46
import {
@@ -9,6 +11,7 @@ import {
911
SelectValue,
1012
} from "@/components/ui/select";
1113
import { cn } from "@/lib/utils";
14+
import type { SnapshotEntry } from "../../legacy-zod-schema";
1215
import { useClaimConditionsFormContext } from "../index";
1316

1417
/**
@@ -118,10 +121,10 @@ export const ClaimerSelection = () => {
118121

119122
{/* Edit or See Snapshot */}
120123
{snapshot ? (
121-
<div className="flex items-center gap-3">
124+
<div className="flex flex-col md:flex-row md:items-center gap-3">
122125
{/* disable the "Edit" button when form is disabled, but not when it's a "See" button */}
123126
<Button
124-
className="gap-2 rounded-md"
127+
className="gap-2"
125128
disabled={disabledSnapshotButton}
126129
onClick={() => setOpenIndex(phaseIndex)}
127130
size="sm"
@@ -130,6 +133,21 @@ export const ClaimerSelection = () => {
130133
<UploadIcon className="size-4" />
131134
</Button>
132135

136+
{snapshot && snapshot.length > 0 && (
137+
<Button
138+
className="gap-2 rounded bg-background"
139+
variant="outline"
140+
disabled={disabledSnapshotButton}
141+
onClick={() => {
142+
downloadSnapshotAsCSV(snapshot);
143+
}}
144+
size="sm"
145+
>
146+
<ArrowDownToLineIcon className="size-4" />
147+
Download
148+
</Button>
149+
)}
150+
133151
<div
134152
className={cn(
135153
"flex gap-2 items-center",
@@ -151,3 +169,25 @@ export const ClaimerSelection = () => {
151169
</FormFieldSetup>
152170
);
153171
};
172+
173+
function downloadSnapshotAsCSV(snapshot: SnapshotEntry[]) {
174+
const csvData = snapshot.map((entry) => ({
175+
address: entry.address,
176+
maxClaimable:
177+
entry.maxClaimable === "0" ? "" : entry.maxClaimable?.toString() || "",
178+
price: entry.price?.toString() || "",
179+
currencyAddress: entry.currencyAddress || "",
180+
}));
181+
182+
const csvContent = Papa.unparse(csvData, {
183+
header: true,
184+
delimiter: ",",
185+
quotes: false,
186+
});
187+
188+
handleDownload({
189+
fileContent: csvContent,
190+
fileNameWithExtension: "snapshot.csv",
191+
fileFormat: "text/csv",
192+
});
193+
}

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

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
11
"use client";
22

3-
import {
4-
ArrowDownToLineIcon,
5-
CircleAlertIcon,
6-
CircleHelpIcon,
7-
PlusIcon,
8-
} from "lucide-react";
3+
import { CircleAlertIcon, CircleHelpIcon, PlusIcon } from "lucide-react";
94
import {
105
createContext,
116
Fragment,
@@ -652,7 +647,6 @@ export const ClaimConditionsForm: React.FC<ClaimConditionsFormProps> = ({
652647
txChainID={contract.chain.id}
653648
type="submit"
654649
>
655-
<ArrowDownToLineIcon className="size-3.5" />
656650
{claimConditionsQuery.isPending
657651
? "Saving Phases"
658652
: "Save Phases"}

apps/portal/redirects.mjs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -865,6 +865,11 @@ const infrastructureRedirects = {
865865
"/storage/how-storage-works": "/infrastructure/storage/how-storage-works",
866866
"/storage/upload-to-ipfs":
867867
"/infrastructure/storage/how-to-use-storage/upload-files-to-ipfs",
868+
// infrastructure redirects to external portal
869+
"/infrastructure/storage/:path*":
870+
"https://portal.thirdweb.com/references/typescript/v5/functions#storage",
871+
"/infrastructure/rpc-edge/:path*":
872+
"https://portal.thirdweb.com/references/typescript/v5/functions#rpc",
868873
};
869874

870875
const glossaryRedirects = {
-867 KB
Binary file not shown.

apps/portal/src/app/infrastructure/layout.tsx

Lines changed: 0 additions & 17 deletions
This file was deleted.

apps/portal/src/app/infrastructure/page.mdx

Lines changed: 0 additions & 77 deletions
This file was deleted.
Binary file not shown.
Binary file not shown.
Binary file not shown.

apps/portal/src/app/infrastructure/rpc-edge/get-started/page.mdx

Lines changed: 0 additions & 153 deletions
This file was deleted.

0 commit comments

Comments
 (0)