From 1bb49c09fb77f976d194970eef18b28325b71feb Mon Sep 17 00:00:00 2001
From: 0xKheops <26880866+0xKheops@users.noreply.github.com>
Date: Fri, 20 Dec 2024 16:56:29 +0900
Subject: [PATCH] chore: cleanup LedgerConnectionStatus
---
.../Shared/ConnectLedgerEthereum.tsx | 4 +--
.../Shared/ConnectLedgerSubstrateGeneric.tsx | 4 +--
.../Shared/ConnectLedgerSubstrateLegacy.tsx | 4 +--
.../Account/LedgerConnectionStatus.tsx | 30 ++-----------------
4 files changed, 8 insertions(+), 34 deletions(-)
diff --git a/apps/extension/src/ui/domains/Account/AccountAdd/AccountAddLedger/Shared/ConnectLedgerEthereum.tsx b/apps/extension/src/ui/domains/Account/AccountAdd/AccountAddLedger/Shared/ConnectLedgerEthereum.tsx
index 9e01d519d..f7ab854de 100644
--- a/apps/extension/src/ui/domains/Account/AccountAdd/AccountAddLedger/Shared/ConnectLedgerEthereum.tsx
+++ b/apps/extension/src/ui/domains/Account/AccountAdd/AccountAddLedger/Shared/ConnectLedgerEthereum.tsx
@@ -18,10 +18,10 @@ export const ConnectLedgerEthereum: FC<{
return (
)
}
diff --git a/apps/extension/src/ui/domains/Account/AccountAdd/AccountAddLedger/Shared/ConnectLedgerSubstrateGeneric.tsx b/apps/extension/src/ui/domains/Account/AccountAdd/AccountAddLedger/Shared/ConnectLedgerSubstrateGeneric.tsx
index e34db1426..2361deca4 100644
--- a/apps/extension/src/ui/domains/Account/AccountAdd/AccountAddLedger/Shared/ConnectLedgerSubstrateGeneric.tsx
+++ b/apps/extension/src/ui/domains/Account/AccountAdd/AccountAddLedger/Shared/ConnectLedgerSubstrateGeneric.tsx
@@ -21,10 +21,10 @@ export const ConnectLedgerSubstrateGeneric: FC<{
return (
)
}
diff --git a/apps/extension/src/ui/domains/Account/AccountAdd/AccountAddLedger/Shared/ConnectLedgerSubstrateLegacy.tsx b/apps/extension/src/ui/domains/Account/AccountAdd/AccountAddLedger/Shared/ConnectLedgerSubstrateLegacy.tsx
index b609278af..0e0747acd 100644
--- a/apps/extension/src/ui/domains/Account/AccountAdd/AccountAddLedger/Shared/ConnectLedgerSubstrateLegacy.tsx
+++ b/apps/extension/src/ui/domains/Account/AccountAdd/AccountAddLedger/Shared/ConnectLedgerSubstrateLegacy.tsx
@@ -17,10 +17,10 @@ export const ConnectLedgerSubstrateLegacy: FC<{
return (
)
}
diff --git a/apps/extension/src/ui/domains/Account/LedgerConnectionStatus.tsx b/apps/extension/src/ui/domains/Account/LedgerConnectionStatus.tsx
index 190fc05c4..3bc7ce7ac 100644
--- a/apps/extension/src/ui/domains/Account/LedgerConnectionStatus.tsx
+++ b/apps/extension/src/ui/domains/Account/LedgerConnectionStatus.tsx
@@ -1,6 +1,5 @@
import { CheckCircleIcon, LoaderIcon, XCircleIcon } from "@talismn/icons"
import { classNames } from "@talismn/util"
-import { FC, ReactNode, useEffect, useState } from "react"
import { useTranslation } from "react-i18next"
import { LedgerStatus } from "@ui/hooks/ledger/common"
@@ -32,47 +31,22 @@ const wrapStrong = (text: string) => {
})
}
-const Container: FC<{ className?: string; onClick?: () => void; children?: ReactNode }> = ({
- className,
- onClick,
- children,
-}) => {
- if (onClick)
- return (
-
- )
- else return
{children}
-}
-
-// TODO cleanup unused properties
export const LedgerConnectionStatus = ({
status,
message,
- requiresManualRetry,
- hideOnSuccess = false,
className,
onRetryClick,
}: LedgerConnectionStatusProps) => {
const { t } = useTranslation()
- const [hide, setHide] = useState(false)
-
- useEffect(() => {
- if (status === "ready" && hideOnSuccess) setTimeout(() => setHide(true), 1000)
- }, [status, hideOnSuccess])
if (!status || status === "unknown") return null
return (
-
{status === "ready" && (
@@ -96,6 +70,6 @@ export const LedgerConnectionStatus = ({
{t("Retry")}
)}
-
+
)
}