Skip to content

Commit

Permalink
Replace chakra icon props with tw classes
Browse files Browse the repository at this point in the history
  • Loading branch information
JunichiSugiura committed Dec 20, 2024
1 parent 3106e80 commit 5ca0356
Show file tree
Hide file tree
Showing 9 changed files with 27 additions and 35 deletions.
4 changes: 2 additions & 2 deletions packages/keychain/src/components/DeployController.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ export function DeployController({
return (
<Container
variant="expanded"
icon={<WandIcon fontSize="5xl" variant="line" />}
icon={<WandIcon variant="line" size="lg" />}
title="Deploy Controller"
description="This will initialize your controller on the new network"
>
Expand Down Expand Up @@ -199,7 +199,7 @@ export function DeployController({
return (
<Container
variant="expanded"
icon={<CheckIcon fontSize="5xl" />}
icon={<CheckIcon size="lg" />}
title="Success!"
description={`Your controller has been deployed on ${chainName}`}
>
Expand Down
18 changes: 5 additions & 13 deletions packages/keychain/src/components/ErrorAlert.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import {
CopyIcon,
CheckIcon,
ErrorAlertIcon,
ErrorAlertIconProps,
} from "@cartridge/ui-next";
import {
Text,
Expand All @@ -19,12 +20,7 @@ import {
Divider,
} from "@chakra-ui/react";
import { motion } from "framer-motion";
import React, {
ComponentProps,
ReactElement,
useEffect,
useState,
} from "react";
import React, { ReactElement, useEffect, useState } from "react";
import { ErrorCode } from "@cartridge/account-wasm/controller";
import { ControllerError } from "@/utils/connection";
import { useConnection } from "@/hooks/connection";
Expand Down Expand Up @@ -75,11 +71,7 @@ export function ErrorAlert({
<HStack alignItems="flex-start">
{variant && (
<ErrorAlertIcon
variant={
variant as ComponentProps<
typeof ErrorAlertIcon
>["variant"]
}
variant={variant as ErrorAlertIconProps["variant"]}
size="xs"
/>
)}
Expand Down Expand Up @@ -122,9 +114,9 @@ export function ErrorAlert({
aria-label="Copy stacktrace"
icon={
copied ? (
<CheckIcon fontSize="xs" color="black" />
<CheckIcon size="xs" className="text-[black]" />
) : (
<CopyIcon fontSize="xs" color="black" />
<CopyIcon size="xs" className="text-[black]" />
)
}
onClick={() => {
Expand Down
2 changes: 1 addition & 1 deletion packages/keychain/src/components/ErrorBoundary.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ export function ErrorPage({ error }: { error: Error }) {
<Link href={CARTRIDGE_DISCORD_LINK} isExternal>
<HStack>
<Text fontSize="sm">Cartridge Discord</Text>
<ExternalIcon fontSize="xl" />
<ExternalIcon size="lg" />
</HStack>
</Link>
</HStack>
Expand Down
4 changes: 3 additions & 1 deletion packages/keychain/src/components/Fees.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,9 @@ function LineItem({
) : (
<HStack gap={0}>
{variant && <ErrorAlertIcon variant={variant} />}
{value !== "FREE" && <EthereumIcon color="text.primary" />}
{value !== "FREE" && (
<EthereumIcon className="text-secondary-foreground" />
)}
<Text fontSize={13}>{value}</Text>
</HStack>
)}
Expand Down
10 changes: 3 additions & 7 deletions packages/keychain/src/components/Funding/DepositEth.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -194,12 +194,8 @@ function DepositEthInner({ onComplete, onBack }: DepositEthProps) {
colorScheme="colorful"
onClick={() => onConnect(c)}
>
{c.name === "argentX" && (
<ArgentIcon fontSize={20} />
)}
{c.name === "braavos" && (
<BraavosIcon fontSize={20} />
)}
{c.name === "argentX" && <ArgentIcon size="sm" />}
{c.name === "braavos" && <BraavosIcon size="sm" />}
{c.name}
</Button>
))}
Expand All @@ -214,7 +210,7 @@ function DepositEthInner({ onComplete, onBack }: DepositEthProps) {
</Text>
)}
<Button w="full" gap="5px" onClick={onCopy}>
<CopyIcon fontSize={20} /> copy address
<CopyIcon size="sm" /> copy address
</Button>
<HStack>
<Text color="text.secondary" fontSize="14px">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export function SessionConsent({
)}
<Text color="text.secondary" fontSize="xs" fontWeight="bold">
Authorize{" "}
{/* <LockIcon fontSize="md" color="text.secondaryAccent" mr={0.5} /> */}
{/* <LockIcon className="text-accent-foreground mr-0.5" /> */}
<Text as="span" color="text.secondaryAccent" fontWeight="bold">
{origin}
</Text>{" "}
Expand Down
2 changes: 1 addition & 1 deletion packages/keychain/src/components/session/ContractCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ export function ContractCard({
);
}

export function humanizeString(str: string): string {
function humanizeString(str: string): string {
return (
str
// Convert from camelCase or snake_case
Expand Down
12 changes: 7 additions & 5 deletions packages/ui-next/src/components/icons/error-alert-icon.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
import { cn } from "@/utils";
import { InfoIcon, WarningIcon, AlertIcon as AlertIconRaw } from "./utility";

export type ErrorAlertIconProps = {
variant: "info" | "warning" | "error";
size?: "xs" | "default";
className?: string;
};

export function ErrorAlertIcon({
variant,
size = "default",
className,
}: {
variant: "info" | "warning" | "error";
size?: "xs" | "default";
className?: string;
}) {
}: ErrorAlertIconProps) {
switch (variant) {
case "info":
return (
Expand Down
8 changes: 4 additions & 4 deletions packages/ui-next/src/components/network.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,14 @@ export function Network({ chainId }: { chainId: string }) {
{(() => {
switch (chainId) {
case constants.StarknetChainId.SN_MAIN:
return <StarknetColorIcon fontSize="xl" />;
return <StarknetColorIcon />;
case constants.StarknetChainId.SN_SEPOLIA:
return <StarknetIcon fontSize="xl" />;
return <StarknetIcon />;
default:
return isSlotChain(chainId) ? (
<SlotIcon fontSize="xl" />
<SlotIcon />
) : (
<QuestionIcon fontSize="xl" />
<QuestionIcon />
);
}
})()}
Expand Down

0 comments on commit 5ca0356

Please sign in to comment.