Skip to content

Commit

Permalink
feat: Export both Icon and default Icon
Browse files Browse the repository at this point in the history
  • Loading branch information
fwh1990 committed Dec 1, 2019
1 parent c3c6abd commit 64a229a
Show file tree
Hide file tree
Showing 21 changed files with 28 additions and 28 deletions.
4 changes: 2 additions & 2 deletions snapshots/all-in-one-js/Icon.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ interface Props extends GProps, ViewProps {
color?: string | string[];
}

declare const Icon: FunctionComponent<Props>;
export declare const Icon: FunctionComponent<Props>;

export = Icon;
export default Icon;
2 changes: 1 addition & 1 deletion snapshots/all-in-one-js/Icon.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { Svg, Path } from 'react-native-svg';
// If you don't want to make all icons in one file,
// try to set generate_mode to "depends-on" in root file "iconfont.json".
// And then regenerate icons by using cli command.
const Icon = ({ color, name, size, ...rest }) => {
export const Icon = ({ color, name, size, ...rest }) => {
switch (name) {
case 'alipay':
return (
Expand Down
2 changes: 1 addition & 1 deletion snapshots/all-in-one-ts/Icon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ interface Props extends GProps, ViewProps {
// If you don't want to make all icons in one file,
// try to set generate_mode to "depends-on" in root file "iconfont.json".
// And then regenerate icons by using cli command.
const Icon: FunctionComponent<Props> = ({ color, name, size, ...rest }) => {
export const Icon: FunctionComponent<Props> = ({ color, name, size, ...rest }) => {
switch (name) {
case 'alipay':
return (
Expand Down
4 changes: 2 additions & 2 deletions snapshots/depends-on-js/IconAlipay.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ interface Props extends GProps, ViewProps {
color?: string | string[];
}

declare const IconAlipay: FunctionComponent<Props>;
export declare const IconAlipay: FunctionComponent<Props>;

export = IconAlipay;
export default IconAlipay;
2 changes: 1 addition & 1 deletion snapshots/depends-on-js/IconAlipay.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { getIconColor } from './helper';
// If you don't like lots of icon files in your project,
// try to set generate_mode to "all-in-one" in root file "iconfont.json".
// And then regenerate icons by using cli command.
const IconAlipay = ({ size, color, ...rest }) => {
export const IconAlipay = ({ size, color, ...rest }) => {
return (
<Svg viewBox="0 0 1024 1024" width={size} height={size} {...rest}>
<Path
Expand Down
4 changes: 2 additions & 2 deletions snapshots/depends-on-js/IconFont.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ interface Props extends GProps, ViewProps {
color?: string | string[];
}

declare const IconFont: FunctionComponent<Props>;
export declare const IconFont: FunctionComponent<Props>;

export = IconFont;
export default IconFont;
2 changes: 1 addition & 1 deletion snapshots/depends-on-js/IconFont.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import IconSetup from './IconSetup';
// If you don't like lots of icon files in your project,
// try to set generate_mode to "all-in-one" in root file "iconfont.json".
// And then regenerate icons by using cli command.
const IconFont = ({ color, name, size, ...rest }) => {
export const IconFont = ({ color, name, size, ...rest }) => {
switch (name) {
case 'alipay':
return <IconAlipay size={size} color={color} {...rest} />;
Expand Down
4 changes: 2 additions & 2 deletions snapshots/depends-on-js/IconSetup.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ interface Props extends GProps, ViewProps {
color?: string | string[];
}

declare const IconSetup: FunctionComponent<Props>;
export declare const IconSetup: FunctionComponent<Props>;

export = IconSetup;
export default IconSetup;
2 changes: 1 addition & 1 deletion snapshots/depends-on-js/IconSetup.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { getIconColor } from './helper';
// If you don't like lots of icon files in your project,
// try to set generate_mode to "all-in-one" in root file "iconfont.json".
// And then regenerate icons by using cli command.
const IconSetup = ({ size, color, ...rest }) => {
export const IconSetup = ({ size, color, ...rest }) => {
return (
<Svg viewBox="0 0 1024 1024" width={size} height={size} {...rest}>
<Path
Expand Down
4 changes: 2 additions & 2 deletions snapshots/depends-on-js/IconUser.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ interface Props extends GProps, ViewProps {
color?: string | string[];
}

declare const IconUser: FunctionComponent<Props>;
export declare const IconUser: FunctionComponent<Props>;

export = IconUser;
export default IconUser;
2 changes: 1 addition & 1 deletion snapshots/depends-on-js/IconUser.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { getIconColor } from './helper';
// If you don't like lots of icon files in your project,
// try to set generate_mode to "all-in-one" in root file "iconfont.json".
// And then regenerate icons by using cli command.
const IconUser = ({ size, color, ...rest }) => {
export const IconUser = ({ size, color, ...rest }) => {
return (
<Svg viewBox="0 0 1024 1024" width={size} height={size} {...rest}>
<Path
Expand Down
2 changes: 1 addition & 1 deletion snapshots/depends-on-ts/CustomIcon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ interface Props extends GProps, ViewProps {
// If you don't like lots of icon files in your project,
// try to set generate_mode to "all-in-one" in root file "iconfont.json".
// And then regenerate icons by using cli command.
const CustomIcon: FunctionComponent<Props> = ({ color, name, size, ...rest }) => {
export const CustomIcon: FunctionComponent<Props> = ({ color, name, size, ...rest }) => {
switch (name) {
case 'alipay':
return <IconAlipay size={size} color={color} {...rest} />;
Expand Down
2 changes: 1 addition & 1 deletion snapshots/depends-on-ts/IconAlipay.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ interface Props extends GProps, ViewProps {
// If you don't like lots of icon files in your project,
// try to set generate_mode to "all-in-one" in root file "iconfont.json".
// And then regenerate icons by using cli command.
const IconAlipay: FunctionComponent<Props> = ({ size, color, ...rest }) => {
export const IconAlipay: FunctionComponent<Props> = ({ size, color, ...rest }) => {
return (
<Svg viewBox="0 0 1024 1024" width={size} height={size} {...rest}>
<Path
Expand Down
2 changes: 1 addition & 1 deletion snapshots/depends-on-ts/IconSetup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ interface Props extends GProps, ViewProps {
// If you don't like lots of icon files in your project,
// try to set generate_mode to "all-in-one" in root file "iconfont.json".
// And then regenerate icons by using cli command.
const IconSetup: FunctionComponent<Props> = ({ size, color, ...rest }) => {
export const IconSetup: FunctionComponent<Props> = ({ size, color, ...rest }) => {
return (
<Svg viewBox="0 0 1024 1024" width={size} height={size} {...rest}>
<Path
Expand Down
2 changes: 1 addition & 1 deletion snapshots/depends-on-ts/IconUser.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ interface Props extends GProps, ViewProps {
// If you don't like lots of icon files in your project,
// try to set generate_mode to "all-in-one" in root file "iconfont.json".
// And then regenerate icons by using cli command.
const IconUser: FunctionComponent<Props> = ({ size, color, ...rest }) => {
export const IconUser: FunctionComponent<Props> = ({ size, color, ...rest }) => {
return (
<Svg viewBox="0 0 1024 1024" width={size} height={size} {...rest}>
<Path
Expand Down
4 changes: 2 additions & 2 deletions src/templates/Icon.d.ts.template
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ interface Props extends GProps, ViewProps {
color?: string | string[];
}

declare const #SummaryIcon#: FunctionComponent<Props>;
export declare const #SummaryIcon#: FunctionComponent<Props>;

export = #SummaryIcon#;
export default #SummaryIcon#;
2 changes: 1 addition & 1 deletion src/templates/Icon.js.template
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import React from 'react';
#imports#

#comments#
const #SummaryIcon# = ({ color, name, size, ...rest }) => {
export const #SummaryIcon# = ({ color, name, size, ...rest }) => {
switch (name) {
#cases#
}
Expand Down
2 changes: 1 addition & 1 deletion src/templates/Icon.tsx.template
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ interface Props extends GProps, ViewProps {
}

#comments#
const #SummaryIcon#: FunctionComponent<Props> = ({ color, name, size, ...rest }) => {
export const #SummaryIcon#: FunctionComponent<Props> = ({ color, name, size, ...rest }) => {
switch (name) {
#cases#
}
Expand Down
4 changes: 2 additions & 2 deletions src/templates/SingleIcon.d.ts.template
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ interface Props extends GProps, ViewProps {
color?: string | string[];
}

declare const #componentName#: FunctionComponent<Props>;
export declare const #componentName#: FunctionComponent<Props>;

export = #componentName#;
export default #componentName#;
2 changes: 1 addition & 1 deletion src/templates/SingleIcon.js.template
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import React from 'react';
import { getIconColor } from './helper';

#comments#
const #componentName# = ({ size, color, ...rest }) => {
export const #componentName# = ({ size, color, ...rest }) => {
return (#iconContent# );
};

Expand Down
2 changes: 1 addition & 1 deletion src/templates/SingleIcon.tsx.template
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ interface Props extends GProps, ViewProps {
}

#comments#
const #componentName#: FunctionComponent<Props> = ({ size, color, ...rest }) => {
export const #componentName#: FunctionComponent<Props> = ({ size, color, ...rest }) => {
return (#iconContent# );
};

Expand Down

0 comments on commit 64a229a

Please sign in to comment.