Skip to content

Commit

Permalink
Use icons for alert from @tabler/icons-react
Browse files Browse the repository at this point in the history
  • Loading branch information
kkosiorowska committed Apr 2, 2024
1 parent 976a466 commit 39850ce
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 43 deletions.
17 changes: 0 additions & 17 deletions dapp/src/assets/icons/AlertError.tsx

This file was deleted.

17 changes: 0 additions & 17 deletions dapp/src/assets/icons/AlertInfo.tsx

This file was deleted.

2 changes: 0 additions & 2 deletions dapp/src/assets/icons/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ export * from "./ArrowRight"
export * from "./AcreLogo"
export * from "./ConnectBTCAccount"
export * from "./ConnectETHAccount"
export * from "./AlertInfo"
export * from "./AlertError"
export * from "./stBTC"
export * from "./BTC"
export * from "./ShieldPlus"
Expand Down
4 changes: 2 additions & 2 deletions dapp/src/components/shared/TokenBalanceInput/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ import {
getCurrencyByType,
userAmountToBigInt,
} from "#/utils"
import { AlertInfo } from "#/assets/icons"
import { CurrencyType } from "#/types"
import { IconInfoCircle } from "@tabler/icons-react"
import NumberFormatInput, {
NumberFormatInputValues,
} from "../NumberFormatInput"
Expand Down Expand Up @@ -48,7 +48,7 @@ function HelperErrorText({
if (helperText) {
return (
<FormHelperText>
<Icon as={AlertInfo} />
<Icon as={IconInfoCircle} />
{helperText}
</FormHelperText>
)
Expand Down
9 changes: 4 additions & 5 deletions dapp/src/components/shared/alerts/Alert.tsx
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
import React from "react"
import {
Alert as ChakraAlert,
AlertIcon,
AlertProps as ChakraAlertProps,
Icon,
CloseButton,
HStack,
} from "@chakra-ui/react"
import { AlertError, AlertInfo } from "#/assets/icons"
import { IconInfoCircle, IconExclamationCircle } from "@tabler/icons-react"

const ICONS = {
info: AlertInfo,
error: AlertError,
info: IconInfoCircle,
error: IconExclamationCircle,
}

type AlertStatus = keyof typeof ICONS
Expand All @@ -37,7 +36,7 @@ export function Alert({
return (
<ChakraAlert status={status} {...props}>
{withIcon && status && (
<AlertIcon boxSize={6} as={ICONS[status]} color={colorIcon} />
<Icon mr={2} boxSize={6} as={ICONS[status]} color={colorIcon} />
)}
<HStack w="100%" justifyContent="space-between">
{children}
Expand Down

0 comments on commit 39850ce

Please sign in to comment.