Skip to content

Commit 95fd6cf

Browse files
committed
blast disabled state addded
1 parent 101049a commit 95fd6cf

4 files changed

Lines changed: 60 additions & 29 deletions

File tree

app/components/Landing/SafeRecoveryForm.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,7 @@ export default function SafeRecoveryForm() {
130130

131131
{/* Subaccounts List Section */}
132132
<SubaccountsList
133+
selectedChain={userSelection.selectedChain}
133134
userInput={userSelection.consoleAddress}
134135
subaccounts={subaccounts}
135136
selectedAccounts={userSelection.selectedSubaccounts}

app/components/safe-recovery/console-input.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,18 @@ export function ConsoleInput({
1616
onAddressChange,
1717
onChainChange,
1818
}: ConsoleInputProps) {
19+
const isBlast = selectedChain === "Blast";
1920
return (
2021
<div className="w-full max-w-4xl space-y-6">
2122
{/* Input Fields */}
2223
<div className="flex flex-col md:flex-row gap-4">
2324
{/* Console Address Input */}
2425
<input
26+
disabled={isBlast}
2527
type="text"
26-
className="flex items-center px-3 py-2 gap-1 flex-1 rounded-lg border border-[#494C56] bg-[#0D0D10] text-white text-sm focus:ring-2 focus:ring-accent-primary focus:border-accent-primary transition-all"
28+
className={`flex items-center px-3 py-2 gap-1 flex-1 rounded-lg border border-[#494C56] bg-[#0D0D10] text-white text-sm focus:ring-2 focus:ring-accent-primary focus:border-accent-primary transition-all ${
29+
isBlast ? "bg-[#494C56] text-[#A8ADB5] cursor-not-allowed" : ""
30+
}`}
2731
placeholder="Paste your Brahma Account address"
2832
value={consoleAddress}
2933
onChange={(e) => onAddressChange(e.target.value)}

app/components/safe-recovery/subaccounts-list.tsx

Lines changed: 53 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
11
"use client";
22

3+
import { ChainName } from "@/app/config/blockchain";
4+
import { LINKS } from "@/app/config/constants";
5+
import Link from "next/link";
36
import { isAddress } from "viem";
47

58
interface SubaccountsListProps {
69
userInput: string;
10+
selectedChain: ChainName;
711
subaccounts: string[];
812
selectedAccounts: string[];
913
onSelectAccount: (account: string) => void;
@@ -20,39 +24,60 @@ export function SubaccountsList({
2024
onDownloadClick,
2125
isLoading = false,
2226
isDownloading = false,
27+
selectedChain,
2328
}: SubaccountsListProps) {
2429
const isDownloadDisabled = selectedAccounts.length === 0 || isDownloading;
30+
const isBlast = selectedChain === "Blast";
2531

2632
return (
27-
<div className="w-full max-w-4xl space-y-6">
33+
<div className="w-full max-w-4xl flex flex-col gap-6">
34+
{isBlast && (
35+
<p className="text-[#FCAA0D]">
36+
Blast Accounts aren&apos;t supported on the Safe Ul. Head to Protofire
37+
to manage your Sub-Accounts.
38+
</p>
39+
)}
2840
{/* Download Button */}
29-
<div className="flex justify-center">
30-
<button
31-
onClick={onDownloadClick}
32-
disabled={isDownloadDisabled}
33-
className={`flex w-full px-2 py-2 justify-center items-center rounded-lg text-sm font-medium leading-6 transition-all ${
34-
isDownloadDisabled
35-
? "bg-[#494C56] text-[#A8ADB5] cursor-not-allowed gap-1"
36-
: "bg-white text-black cursor-pointer gap-[6px]"
37-
}`}
38-
>
39-
{isDownloading ? (
40-
<>
41-
<div className="animate-spin rounded-full h-5 w-5 border-2 border-gray-400 border-t-black"></div>
42-
Generating...
43-
</>
44-
) : (
45-
<>
46-
<DownloadIcon disabled={isDownloadDisabled} />{" "}
47-
{selectedAccounts.length > 0
48-
? ` Download Json file (${selectedAccounts.length} Selected)`
49-
: userInput
50-
? "Select Sub-Accounts to download JSON"
51-
: "Enter Account Address to view Sub-Accounts"}
52-
</>
53-
)}
54-
</button>
55-
</div>
41+
42+
{isBlast ? (
43+
<Link href={LINKS.PROTOFIRE} target="_blank">
44+
{" "}
45+
<button
46+
className={`flex w-full px-2 py-2 justify-center items-center rounded-lg text-sm font-medium leading-6 transition-all bg-white text-black cursor-pointer gap-[6px]`}
47+
>
48+
Open on Protofire
49+
</button>
50+
</Link>
51+
) : (
52+
<div className="flex justify-center">
53+
<button
54+
onClick={onDownloadClick}
55+
disabled={isDownloadDisabled}
56+
className={`flex w-full px-2 py-2 justify-center items-center rounded-lg text-sm font-medium leading-6 transition-all ${
57+
isDownloadDisabled
58+
? "bg-[#494C56] text-[#A8ADB5] cursor-not-allowed gap-1"
59+
: "bg-white text-black cursor-pointer gap-[6px]"
60+
}`}
61+
>
62+
{isDownloading ? (
63+
<>
64+
<div className="animate-spin rounded-full h-5 w-5 border-2 border-gray-400 border-t-black"></div>
65+
Generating...
66+
</>
67+
) : (
68+
<>
69+
<DownloadIcon disabled={isDownloadDisabled} />{" "}
70+
{selectedAccounts.length > 0
71+
? ` Download Json file (${selectedAccounts.length} Selected)`
72+
: userInput
73+
? "Select Sub-Accounts to download JSON"
74+
: "Enter Account Address to view Sub-Accounts"}
75+
</>
76+
)}
77+
</button>
78+
</div>
79+
)}
80+
5681
{/* Subaccounts Container */}
5782
{!isAddress(userInput) ? (
5883
// Placeholder when no input

app/config/constants.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ export const LINKS = {
3434
TWITTER: "https://x.com/brahmaFi",
3535
SAFE_GLOBAL_UI: "https://app.safe.global",
3636
YOUTUBE: "https://youtu.be/GLECu-9wt_E",
37+
PROTOFIRE: "https://app.safe.protofire.io",
3738
};
3839

3940
// Navigation IDs

0 commit comments

Comments
 (0)