material-ui icon indicating copy to clipboard operation
material-ui copied to clipboard

[Toolbar] Svg icons component

Open olivierGM opened this issue 11 years ago • 5 comments

I am using the icon builder to make a component per icon. Now i am not so sure how to use it now. per example if i have a toolbar: Im trying something like that but its not working:

<ToolbarGroup key={1} float="left">
     <RaisedButton label="Settings" onClick={this.props.settings} />
     <DropDownIcon menuItems={iconMenuItems}>
        <NavigationExpandMore/>
     </DropDownIcon>
</ToolbarGroup>

How do i include icon component in the current implementation ?

olivierGM avatar Jul 06 '15 16:07 olivierGM

@olivierGM I tried to recreate this code, and I excluded the onClick prop and the NavigationExpandMore element and it works fine. I'm not exactly sure what that element is, but the rest of the code generates correctly on my test file.

Zadielerick avatar Jul 06 '15 18:07 Zadielerick

Basically that element is a react component that creates an svg :

var React = require('react');
var mui = require('material-ui');
var SvgIcon = mui.SvgIcon;

var NavigationExpandMore = React.createClass({
  displayName: 'NavigationExpandMore',

  render: function render() {
    return React.createElement(
      SvgIcon,
      this.props,
      React.createElement('path', { d: 'M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6z' })
    );
  }

});

I would like to be able to use that component/svg to use instead of a font.

olivierGM avatar Jul 06 '15 18:07 olivierGM

The svg icons currently is being shown but the problem is all the properties doesnt apply like the alignement and color. image

olivierGM avatar Jul 06 '15 18:07 olivierGM

@olivierGM So I have tried to recreate this issue but it seems to be working fine. A short term fix could be to pass the styles as a prop. If you really want to see how it should work, I think you were following the docs site's example and if you look at the icons component examples, the ActionHome is being used the same way you are using it.

Zadielerick avatar Jul 06 '15 19:07 Zadielerick

Well since version 0.10 . I am using material svg icons and everything seems to work fine.

olivierGM avatar Jul 21 '15 13:07 olivierGM