Skip to content

Commit

Permalink
Add custom icon into button
Browse files Browse the repository at this point in the history
  • Loading branch information
tamdao committed May 11, 2017
1 parent 38b0f9d commit 7cf6791
Show file tree
Hide file tree
Showing 2 changed files with 4,676 additions and 3 deletions.
4,672 changes: 4,671 additions & 1 deletion build/bundle.js

Large diffs are not rendered by default.

7 changes: 5 additions & 2 deletions src/buttons/Button.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ const Button = props => {
title,
onPress,
icon,
iconComponent,
secondary,
secondary2,
secondary3,
Expand All @@ -53,7 +54,9 @@ const Button = props => {
let iconElement;
if (icon) {
let Icon;
if (!icon.type) {
if (iconComponent) {
Icon = iconComponent;
} else if (!icon.type) {
Icon = MaterialIcon;
} else {
Icon = getIconType(icon.type);
Expand All @@ -66,7 +69,7 @@ const Button = props => {
iconRight ? styles.iconRight : styles.icon,
icon.style && icon.style,
]}
name={icon.name}
{...icon}
/>
);
}
Expand Down

0 comments on commit 7cf6791

Please sign in to comment.