Support elements in icon attribute in IconButton
This makes IconButton more flexible. It also makes icon elements work when used with leftIcon/rightIcon attributes in AppBar.old
parent
ccb396f4d7
commit
62f55cae1e
|
@ -65,7 +65,7 @@ const factory = (ripple, FontIcon) => {
|
|||
};
|
||||
|
||||
return React.createElement(element, props,
|
||||
icon ? <FontIcon className={theme.icon} value={icon}/> : null,
|
||||
icon ? typeof icon === 'string' ? <FontIcon className={theme.icon} value={icon} /> : icon : null,
|
||||
children
|
||||
);
|
||||
}
|
||||
|
|
|
@ -23,6 +23,7 @@ const TestButtons = () => (
|
|||
<Button icon='add' floating />
|
||||
<Button icon='add' floating accent mini />
|
||||
<IconButton icon='favorite' accent />
|
||||
<IconButton icon={<GithubIcon />} accent />
|
||||
<IconButton primary><GithubIcon /></IconButton>
|
||||
<Button icon='add' label='Add this' flat primary />
|
||||
<Button icon='add' label='Add this' flat disabled />
|
||||
|
|
|
@ -15,6 +15,7 @@ const ButtonsTest = () => (
|
|||
<Button icon='add' floating />
|
||||
<Button icon='add' floating accent mini />
|
||||
<IconButton icon='favorite' accent />
|
||||
<IconButton icon={<GithubIcon />} accent />
|
||||
<IconButton primary><GithubIcon /></IconButton>
|
||||
<Button icon='add' label='Add this' flat primary />
|
||||
<Button icon='add' label='Add this' flat disabled />
|
||||
|
|
Loading…
Reference in New Issue