diff --git a/packages/keychain/package.json b/packages/keychain/package.json index 2a17360cd..bfcc6d6e8 100644 --- a/packages/keychain/package.json +++ b/packages/keychain/package.json @@ -83,6 +83,7 @@ "jsdom": "^25.0.1", "playwright": "^1.47.1", "postcss": "^8.4.35", + "postcss-import": "^16.1.0", "prettier": "^2.7.1", "rollup-plugin-visualizer": "^5.12.0", "start-server-and-test": "^2.0.9", diff --git a/packages/keychain/src/components/Animation.tsx b/packages/keychain/src/components/Animation.tsx deleted file mode 100644 index 2e9a2be2e..000000000 --- a/packages/keychain/src/components/Animation.tsx +++ /dev/null @@ -1,27 +0,0 @@ -import { Box, Flex } from "@chakra-ui/react"; -import { ReactElement } from "react"; - -export function FullPageAnimation({ - show, - View, -}: { - show: boolean; - View: ReactElement; -}) { - return ( - - {View} - - ); -} diff --git a/packages/keychain/src/components/ControllerErrorAlert.stories.tsx b/packages/keychain/src/components/ControllerErrorAlert.stories.tsx index c2d4414c2..6bb923615 100644 --- a/packages/keychain/src/components/ControllerErrorAlert.stories.tsx +++ b/packages/keychain/src/components/ControllerErrorAlert.stories.tsx @@ -1,6 +1,5 @@ import type { Meta, StoryObj } from "@storybook/react"; import { ControllerErrorAlert as CtrlErrAlert } from "./ErrorAlert"; -import { VStack } from "@chakra-ui/react"; import { ErrorCode } from "@cartridge/account-wasm/controller"; import { starknetTransactionExecutionErrorTestCases } from "@/utils/errors"; @@ -17,7 +16,7 @@ export const All: Story = {}; function ControllerErrorAlert() { return ( - +
@@ -37,6 +36,28 @@ function ControllerErrorAlert() { }} /> ))} - + + + + +
); } diff --git a/packages/keychain/src/components/ErrorAlert.tsx b/packages/keychain/src/components/ErrorAlert.tsx index ce4869ba1..aad025c27 100644 --- a/packages/keychain/src/components/ErrorAlert.tsx +++ b/packages/keychain/src/components/ErrorAlert.tsx @@ -9,8 +9,8 @@ import { AccordionTrigger, AccordionContent, cn, + Separator, } from "@cartridge/ui-next"; -import { Text, HStack, VStack, Divider } from "@chakra-ui/react"; import React, { ReactElement, useCallback, @@ -269,27 +269,25 @@ export function ControllerErrorAlert({ description = ; } catch { title = "Execution error"; - description = {error.data}; + description = error.data; } break; case ErrorCode.StarknetValidationFailure: { const parsedError = parseValidationError(error); title = parsedError.summary; copyText = parsedError.raw; - description = ( - - {Object.entries(parsedError.details).map(([key, value]) => ( - - {key}: {typeof value === "bigint" ? value.toString() : value} - - ))} - - ); + description = + typeof parsedError.details === "string" ? ( + parsedError.details + ) : ( +
+ {Object.entries(parsedError.details).map(([key, value]) => ( +
+ {key}: {typeof value === "bigint" ? value.toString() : value} +
+ ))} +
+ ); variant = "warning"; isExpanded = true; break; @@ -330,27 +328,17 @@ function StackTraceDisplay({ ); return ( - +
{stackTrace.map((trace, i, arr) => ( - +
{Object.entries(trace).map( ([key, value]) => value && ( - - +
+
{key} - +
{key === "address" || key === "class" ? ( ) : key === "selector" ? ( - +
{formatAddress(value as string, { size: "sm", })} - +
) : ( - - {(value as string[]).map((line, index) => ( - +
+ {(value as string[]).map((line, i) => ( +
{line} - +
))} - +
)} - +
), )} - - {i !== arr.length - 1 && } +
+ {i !== arr.length - 1 && }
))} - +
); } diff --git a/packages/keychain/src/components/ErrorBoundary.tsx b/packages/keychain/src/components/ErrorBoundary.tsx index 34464b2e6..11aa73462 100644 --- a/packages/keychain/src/components/ErrorBoundary.tsx +++ b/packages/keychain/src/components/ErrorBoundary.tsx @@ -1,7 +1,6 @@ import React, { PropsWithChildren, useEffect } from "react"; import { Container, Content, Footer } from "./layout"; import { AlertIcon, ExternalIcon, Button } from "@cartridge/ui-next"; -import { HStack, Text } from "@chakra-ui/react"; import { useConnection } from "@/hooks/connection"; import { CARTRIDGE_DISCORD_LINK } from "@/const"; import { usePostHog } from "posthog-js/react"; @@ -48,33 +47,12 @@ export function ErrorPage({ error }: { error: Error }) { icon={} > - - - {error.message} - - +
+

{error.message}

+
- - - Get help - +
+

Get help

Cartridge Discord
-
+