File tree Expand file tree Collapse file tree 2 files changed +4
-20
lines changed Expand file tree Collapse file tree 2 files changed +4
-20
lines changed Original file line number Diff line number Diff line change @@ -4,7 +4,6 @@ import SpinnerLoading from '../../assets/icons/loaders/Spinner';
4
4
import CircularLoading from '../../assets/icons/loaders/Circular' ;
5
5
6
6
import { LoadingIconProps } from './types' ;
7
- import Iconslist from '../../assets/icons/vant-icons/config' ;
8
7
9
8
export const renderLoadingIcon = ( {
10
9
className,
@@ -52,13 +51,3 @@ export const colorType = (colorHex: string): string => {
52
51
const result = '#' + colorHex ;
53
52
return result ;
54
53
} ;
55
-
56
- export const iconType = ( icon : string ) : boolean => {
57
- if (
58
- Iconslist . basic . includes ( icon ) ||
59
- Iconslist . outline . includes ( icon ) ||
60
- Iconslist . filled . includes ( icon )
61
- )
62
- return true ;
63
- return false ;
64
- } ;
Original file line number Diff line number Diff line change 1
1
import React from 'react' ;
2
2
3
- import {
4
- renderLoadingIcon ,
5
- getContrastTextColor ,
6
- colorType ,
7
- iconType
8
- } from './helper' ;
3
+ import { renderLoadingIcon , getContrastTextColor , colorType } from './helper' ;
9
4
import classnames from '../../utils/classNames' ;
10
5
11
6
import { Props } from './types' ;
@@ -131,9 +126,9 @@ export default function Button({
131
126
132
127
return (
133
128
< CustomTag { ...props } >
134
- { iconType ( ` ${ icon } ` )
135
- ? icon && < Icon name = { icon } size = { NAV_ICON_SIZE } />
136
- : icon && < img src = { icon } alt = 'button icon' /> }
129
+ { icon ?. includes ( '.' ) || icon ?. includes ( 'http' )
130
+ ? icon && < img src = { icon } alt = 'button icon' />
131
+ : icon && < Icon name = { icon } size = { NAV_ICON_SIZE } /> }
137
132
{ loading
138
133
? renderLoadingIcon ( {
139
134
className : loadingType
You can’t perform that action at this time.
0 commit comments