From d1f525046e2153832dc1ce551c65c426a75228c6 Mon Sep 17 00:00:00 2001 From: Junichi Sugiura Date: Fri, 14 Jun 2024 13:08:25 +0200 Subject: [PATCH] Replace Error component with ErrorAlert (#367) * Set text color to background * Replace all old Error component with ErrorAlert --- .../src/components/DeploymentRequired.tsx | 4 +- packages/keychain/src/components/Error.tsx | 50 ------------------- .../keychain/src/components/ErrorAlert.tsx | 11 ++-- .../keychain/src/components/Execute/Fees.tsx | 2 - .../keychain/src/components/Execute/index.tsx | 7 +++ .../src/components/bridge/BridgeEth.tsx | 9 +--- .../keychain/src/components/connect/Login.tsx | 9 ++-- .../src/components/layout/Footer/index.tsx | 1 + 8 files changed, 23 insertions(+), 70 deletions(-) delete mode 100644 packages/keychain/src/components/Error.tsx diff --git a/packages/keychain/src/components/DeploymentRequired.tsx b/packages/keychain/src/components/DeploymentRequired.tsx index c5f4cdbfe..4004ac385 100644 --- a/packages/keychain/src/components/DeploymentRequired.tsx +++ b/packages/keychain/src/components/DeploymentRequired.tsx @@ -88,7 +88,7 @@ export function DeploymentRequired({ description={ error ? ( <> - + Please come by{" "} - {error.message} + {error.message} ) : undefined } diff --git a/packages/keychain/src/components/Error.tsx b/packages/keychain/src/components/Error.tsx deleted file mode 100644 index 740065c5f..000000000 --- a/packages/keychain/src/components/Error.tsx +++ /dev/null @@ -1,50 +0,0 @@ -import { - Text, - VStack, - Accordion, - AccordionItem, - AccordionButton, - AccordionPanel, - AccordionIcon, - Spacer, -} from "@chakra-ui/react"; -import { motion } from "framer-motion"; - -export function Error({ error }: { error?: Error }) { - if (!error) return null; - - return ( - - - - - Error Expected - - - - - - - - - - - Error Details - - - {error.message} - - - - - ); -} diff --git a/packages/keychain/src/components/ErrorAlert.tsx b/packages/keychain/src/components/ErrorAlert.tsx index 8a9ec7746..5ab8c62dc 100644 --- a/packages/keychain/src/components/ErrorAlert.tsx +++ b/packages/keychain/src/components/ErrorAlert.tsx @@ -27,11 +27,11 @@ export function ErrorAlert({ animate={{ height: "auto" }} allowToggle variant="error" - color="text.primary" + color="solid.bg" fontSize="sm" > - + - {description && } + {/* color does not seems to be applied */} + {description && } {description && ( - - {description} + + {description} )} diff --git a/packages/keychain/src/components/Execute/Fees.tsx b/packages/keychain/src/components/Execute/Fees.tsx index 81f92c9bf..8f6be53c8 100644 --- a/packages/keychain/src/components/Execute/Fees.tsx +++ b/packages/keychain/src/components/Execute/Fees.tsx @@ -10,7 +10,6 @@ import { import { constants } from "starknet"; import { formatUnits } from "viem"; -import { Error } from "components/Error"; import { useChainId } from "hooks/connection"; async function fetchEthPrice() { @@ -80,7 +79,6 @@ export function Fees({ return ( <> -