From 74ebd9ea4540a0f8ade1453a70fb4fdb4eaca81c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=B3vis=20Neto?= Date: Fri, 27 Sep 2024 12:47:27 +0200 Subject: [PATCH] fix(icons-componen t): add missing icons --- apps/tx-builder/src/components/Button.tsx | 2 +- .../components/Icon/images/bookmarkFilled.tsx | 30 +++++++++++++++++++ .../src/components/Icon/images/copy.tsx | 28 +++++++++++++++++ apps/tx-builder/src/components/Icon/index.tsx | 4 +++ apps/tx-builder/src/utils/address.ts | 1 + 5 files changed, 64 insertions(+), 1 deletion(-) create mode 100644 apps/tx-builder/src/components/Icon/images/bookmarkFilled.tsx create mode 100644 apps/tx-builder/src/components/Icon/images/copy.tsx diff --git a/apps/tx-builder/src/components/Button.tsx b/apps/tx-builder/src/components/Button.tsx index 739dd810..fc87edb9 100644 --- a/apps/tx-builder/src/components/Button.tsx +++ b/apps/tx-builder/src/components/Button.tsx @@ -3,7 +3,7 @@ import ButtonMUI, { ButtonProps as ButtonMUIProps } from '@material-ui/core/Butt import { alpha } from '@material-ui/core/styles' import styled, { css, DefaultTheme, FlattenInterpolation, ThemeProps } from 'styled-components' -import { Icon, IconProps, IconTypes } from './Icon' +import { Icon, IconProps } from './Icon' type Colors = 'primary' | 'secondary' | 'error' type Variations = 'bordered' | 'contained' | 'outlined' diff --git a/apps/tx-builder/src/components/Icon/images/bookmarkFilled.tsx b/apps/tx-builder/src/components/Icon/images/bookmarkFilled.tsx new file mode 100644 index 00000000..c0128163 --- /dev/null +++ b/apps/tx-builder/src/components/Icon/images/bookmarkFilled.tsx @@ -0,0 +1,30 @@ +const BookMarkFilled = { + sm: ( + + + + + + ), + md: ( + + + + + + ), +} + +export default BookMarkFilled diff --git a/apps/tx-builder/src/components/Icon/images/copy.tsx b/apps/tx-builder/src/components/Icon/images/copy.tsx new file mode 100644 index 00000000..652ff813 --- /dev/null +++ b/apps/tx-builder/src/components/Icon/images/copy.tsx @@ -0,0 +1,28 @@ +const Copy = { + sm: ( + + + + + + + ), + md: ( + + + + + + + ), +} + +export default Copy diff --git a/apps/tx-builder/src/components/Icon/index.tsx b/apps/tx-builder/src/components/Icon/index.tsx index 4cefcd06..0830ccf3 100644 --- a/apps/tx-builder/src/components/Icon/index.tsx +++ b/apps/tx-builder/src/components/Icon/index.tsx @@ -6,8 +6,10 @@ import { Tooltip } from '../Tooltip' import alert from './images/alert' import bookmark from './images/bookmark' +import bookmarkFilled from './images/bookmarkFilled' import check from './images/check' import code from './images/code' +import copy from './images/copy' import cross from './images/cross' import deleteIcon from './images/delete' import edit from './images/edit' @@ -31,7 +33,9 @@ const StyledIcon = styled.span<{ color?: keyof Theme['palette'] }>` const icons = { alert, bookmark, + bookmarkFilled, check, + copy, code, cross, delete: deleteIcon, diff --git a/apps/tx-builder/src/utils/address.ts b/apps/tx-builder/src/utils/address.ts index 73072d8e..19bfd27e 100644 --- a/apps/tx-builder/src/utils/address.ts +++ b/apps/tx-builder/src/utils/address.ts @@ -45,6 +45,7 @@ const isValidAddress = (address?: string): boolean => { // Based on https://docs.ens.domains/dapp-developer-guide/resolving-names // [...] a correct integration of ENS treats any dot-separated name as a potential ENS name [...] +/* tslint:disable-next-line */ const validENSRegex = new RegExp(/[^\[\]]+\.[^\[\]]/) const isValidEnsName = (name: string): boolean => validENSRegex.test(name)