File tree Expand file tree Collapse file tree 6 files changed +199
-0
lines changed
Expand file tree Collapse file tree 6 files changed +199
-0
lines changed Original file line number Diff line number Diff line change 1+ /* tslint:disable */
2+ /* eslint-disable */
3+
4+ import React , { FunctionComponent } from 'react' ;
5+ import { ViewProps } from 'react-native' ;
6+ import { GProps , SvgCss } from 'react-native-svg' ;
7+
8+ interface Props extends GProps , ViewProps {
9+ size ?: number ;
10+ color ?: string | string [ ] ;
11+ }
12+
13+ const xml = `
14+ <svg xmlns="http://www.w3.org/2000/svg">
15+ <style type="text/css">
16+ <![CDATA[
17+
18+ circle.myGreen {
19+ stroke: #006600;
20+ fill: #00cc00;
21+ }
22+ circle.myRed {
23+ stroke: #660000;
24+ fill: #cc0000;
25+ }
26+
27+ ]]>
28+ </style>
29+
30+ <circle class="myGreen" cx="40" cy="40" r="24"/>
31+ <circle class="myRed" cx="40" cy="100" r="24"/>
32+ </svg>
33+ `
34+
35+ let IconClassSvg : FunctionComponent < Props > = ( { size, color, ...rest } ) => {
36+ return (
37+ < SvgCss xml = { xml } width = { size } height = { size } { ...rest } />
38+ ) ;
39+ } ;
40+
41+ IconClassSvg . defaultProps = {
42+ size : 20 ,
43+ } ;
44+
45+ IconClassSvg = React . memo ? React . memo ( IconClassSvg ) : IconClassSvg ;
46+
47+ export default IconClassSvg ;
Original file line number Diff line number Diff line change 1+ /* tslint:disable */
2+ /* eslint-disable */
3+
4+ import React , { FunctionComponent } from 'react' ;
5+ import { ViewProps } from 'react-native' ;
6+ import { GProps , SvgCss } from 'react-native-svg' ;
7+
8+ interface Props extends GProps , ViewProps {
9+ size ?: number ;
10+ color ?: string | string [ ] ;
11+ }
12+
13+ const xml = `
14+ <svg xmlns="http://www.w3.org/2000/svg">
15+ <style type="text/css">
16+ <![CDATA[
17+
18+ circle {
19+ stroke: #006600;
20+ fill: #00cc00;
21+ }
22+
23+ ]]>
24+ </style>
25+ <circle cx="40" cy="40" r="24"/>
26+ </svg>
27+ `
28+
29+ let IconInlineStyle : FunctionComponent < Props > = ( { size, color, ...rest } ) => {
30+ return (
31+ < SvgCss xml = { xml } width = { size } height = { size } { ...rest } />
32+ ) ;
33+ } ;
34+
35+ IconInlineStyle . defaultProps = {
36+ size : 20 ,
37+ } ;
38+
39+ IconInlineStyle = React . memo ? React . memo ( IconInlineStyle ) : IconInlineStyle ;
40+
41+ export default IconInlineStyle ;
Original file line number Diff line number Diff line change 1+ /* tslint:disable */
2+ /* eslint-disable */
3+
4+ import React , { FunctionComponent } from 'react' ;
5+ import { ViewProps } from 'react-native' ;
6+ import { GProps , SvgXml } from 'react-native-svg' ;
7+
8+ interface Props extends GProps , ViewProps {
9+ size ?: number ;
10+ color ?: string | string [ ] ;
11+ }
12+
13+ const xml = `
14+ <svg xmlns="http://www.w3.org/2000/svg">
15+ <circle cx="40" cy="40" r="24" stroke="#000000" fill="#00ff00"/>
16+ </svg>
17+ `
18+
19+ let IconNormal : FunctionComponent < Props > = ( { size, color, ...rest } ) => {
20+ return (
21+ < SvgXml xml = { xml } width = { size } height = { size } { ...rest } />
22+ ) ;
23+ } ;
24+
25+ IconNormal . defaultProps = {
26+ size : 20 ,
27+ } ;
28+
29+ IconNormal = React . memo ? React . memo ( IconNormal ) : IconNormal ;
30+
31+ export default IconNormal ;
Original file line number Diff line number Diff line change 1+ /* tslint:disable */
2+ /* eslint-disable */
3+
4+ import React , { FunctionComponent } from 'react' ;
5+ import { ViewProps } from 'react-native' ;
6+ import { GProps , SvgXml } from 'react-native-svg' ;
7+
8+ interface Props extends GProps , ViewProps {
9+ size ?: number ;
10+ color ?: string | string [ ] ;
11+ }
12+
13+ const xml = `
14+ <svg xmlns="http://www.w3.org/2000/svg">
15+ <circle cx="40" cy="40" r="24" style="stroke: #000000; fill:#00ff00;"/>
16+ </svg>
17+ `
18+
19+ let IconStyle : FunctionComponent < Props > = ( { size, color, ...rest } ) => {
20+ return (
21+ < SvgXml xml = { xml } width = { size } height = { size } { ...rest } />
22+ ) ;
23+ } ;
24+
25+ IconStyle . defaultProps = {
26+ size : 20 ,
27+ } ;
28+
29+ IconStyle = React . memo ? React . memo ( IconStyle ) : IconStyle ;
30+
31+ export default IconStyle ;
Original file line number Diff line number Diff line change 1+ /* tslint:disable */
2+ /* eslint-disable */
3+
4+ export const getIconColor = ( color : string | string [ ] | undefined , index : number , defaultColor : string ) => {
5+ return color
6+ ? (
7+ typeof color === 'string'
8+ ? color
9+ : color [ index ] || defaultColor
10+ )
11+ : defaultColor ;
12+ } ;
Original file line number Diff line number Diff line change 1+ /* tslint:disable */
2+ /* eslint-disable */
3+
4+ import React , { FunctionComponent } from 'react' ;
5+ import { ViewProps } from 'react-native' ;
6+ import { GProps } from 'react-native-svg' ;
7+ import IconClassSvg from './IconClassSvg' ;
8+ import IconInlineStyle from './IconInlineStyle' ;
9+ import IconNormal from './IconNormal' ;
10+ import IconStyle from './IconStyle' ;
11+
12+ export type IconNames = 'classSvg' | 'inlineStyle' | 'normal' | 'style' ;
13+
14+ interface Props extends GProps , ViewProps {
15+ name : IconNames ;
16+ size ?: number ;
17+ color ?: string | string [ ] ;
18+ }
19+
20+ let IconFont : FunctionComponent < Props > = ( { name, ...rest } ) => {
21+ switch ( name ) {
22+ case 'classSvg' :
23+ return < IconClassSvg key = "L1" { ...rest } /> ;
24+ case 'inlineStyle' :
25+ return < IconInlineStyle key = "L2" { ...rest } /> ;
26+ case 'normal' :
27+ return < IconNormal key = "L3" { ...rest } /> ;
28+ case 'style' :
29+ return < IconStyle key = "L4" { ...rest } /> ;
30+ }
31+
32+ return null ;
33+ } ;
34+
35+ IconFont = React . memo ? React . memo ( IconFont ) : IconFont ;
36+
37+ export default IconFont ;
You can’t perform that action at this time.
0 commit comments