Skip to content

Commit

Permalink
fix(icons-componen t): add missing icons
Browse files Browse the repository at this point in the history
  • Loading branch information
clovisdasilvaneto committed Sep 27, 2024
1 parent c1524bc commit 74ebd9e
Show file tree
Hide file tree
Showing 5 changed files with 64 additions and 1 deletion.
2 changes: 1 addition & 1 deletion apps/tx-builder/src/components/Button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
30 changes: 30 additions & 0 deletions apps/tx-builder/src/components/Icon/images/bookmarkFilled.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
const BookMarkFilled = {
sm: (
<svg height="16" width="12" viewBox="0 0 12 12" fill="none" xmlns="http://www.w3.org/2000/svg">
<g fill="none" fillRule="evenodd">
<path
className="icon-color icon-stroke"
d="M9 11L5 8.22222L1 11V2.11111C1 1.81643 1.12041 1.53381 1.33474 1.32544C1.54906 1.11706 1.83975 1 2.14286 1H7.85714C8.16025 1 8.45094 1.11706 8.66527 1.32544C8.87959 1.53381 9 1.81643 9 2.11111V11Z"
strokeWidth="2"
strokeLinecap="round"
strokeLinejoin="round"
/>
</g>
</svg>
),
md: (
<svg height="24" width="20" viewBox="0 0 12 12" fill="none" xmlns="http://www.w3.org/2000/svg">
<g fill="none" fillRule="evenodd">
<path
className="icon-color icon-stroke"
d="M9 11L5 8.22222L1 11V2.11111C1 1.81643 1.12041 1.53381 1.33474 1.32544C1.54906 1.11706 1.83975 1 2.14286 1H7.85714C8.16025 1 8.45094 1.11706 8.66527 1.32544C8.87959 1.53381 9 1.81643 9 2.11111V11Z"
strokeWidth="1.5"
strokeLinecap="round"
strokeLinejoin="round"
/>
</g>
</svg>
),
}

export default BookMarkFilled
28 changes: 28 additions & 0 deletions apps/tx-builder/src/components/Icon/images/copy.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
const Copy = {
sm: (
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16">
<g fill="none" fillRule="evenodd">
<path d="M0 0H16V16H0z" />
<path
className="icon-color"
fillRule="nonzero"
d="M10 10h3V3H8v1c1.105 0 2 .895 2 2v4zM6 4V3c0-1.105.895-2 2-2h5c1.105 0 2 .895 2 2v7c0 1.105-.895 2-2 2h-3v1c0 1.105-.895 2-2 2H3c-1.105 0-2-.895-2-2V6c0-1.105.895-2 2-2h3zM3 6v7h5V6H3z"
/>
</g>
</svg>
),
md: (
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
<g fill="none" fillRule="evenodd">
<path d="M0 0H24V24H0z" />
<path
className="icon-color"
fillRule="nonzero"
d="M15 15h4V4h-8v3h2c1.105 0 2 .895 2 2v6zM9 7V4c0-1.105.895-2 2-2h8c1.105 0 2 .895 2 2v11c0 1.105-.895 2-2 2h-4v3c0 1.105-.895 2-2 2H5c-1.105 0-2-.895-2-2V9c0-1.105.895-2 2-2h4zM5 9v11h8V9H5z"
/>
</g>
</svg>
),
}

export default Copy
4 changes: 4 additions & 0 deletions apps/tx-builder/src/components/Icon/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand All @@ -31,7 +33,9 @@ const StyledIcon = styled.span<{ color?: keyof Theme['palette'] }>`
const icons = {
alert,
bookmark,
bookmarkFilled,
check,
copy,
code,
cross,
delete: deleteIcon,
Expand Down
1 change: 1 addition & 0 deletions apps/tx-builder/src/utils/address.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit 74ebd9e

Please sign in to comment.