Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Toolbar] Svg icons component #1046

Closed
olivierGM opened this issue Jul 6, 2015 · 5 comments
Closed

[Toolbar] Svg icons component #1046

olivierGM opened this issue Jul 6, 2015 · 5 comments
Labels
component: SvgIcon The React component. component: Toolbar The React component.

Comments

@olivierGM
Copy link

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 ?

@Zadielerick
Copy link
Contributor

@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.

@olivierGM
Copy link
Author

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
Copy link
Author

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

@Zadielerick
Copy link
Contributor

@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.

@hai-cea hai-cea changed the title Svg icons component [Toolbar] Svg icons component Jul 16, 2015
@olivierGM
Copy link
Author

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

mnajdova pushed a commit to mnajdova/material-ui that referenced this issue Nov 10, 2020
* [mui#1031] Fix className of ClockNumber selected state

* [mui#1039] Fix not passing down InputProps

* Make InputProps not required
mnajdova pushed a commit to mnajdova/material-ui that referenced this issue Nov 10, 2020
* Created base <Picker /> component for rendering all possible views

* Recreate TimePicker with new <Picker /> component

* Add TimePicker toolbar and fully replace old TimePickerRoot

* Fix not generating docs when exported several components

* Redo DatePicker on <Picker />

* Grand Views Refactoring

* Fix Root-Pickers tests

* Fix ts errors

* Fix Object(...) is not a function error

* Fix loosing selected meridiem

* Use wildcard import rather than default import (mui#1038)

* [mui#1031] Fix className of ClockNumber selected state (mui#1045)

* Bugfix/spread input props (mui#1046)

* [mui#1031] Fix className of ClockNumber selected state

* [mui#1039] Fix not passing down InputProps

* Make InputProps not required

* Redo DateTimePickerToolbar to use grid

* Get rid of 'selected' and 'disabled' classes

* Fix console warnings
@oliviertassinari oliviertassinari added the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Dec 25, 2022
@zannager zannager added component: SvgIcon The React component. component: Toolbar The React component. and removed status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Jan 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: SvgIcon The React component. component: Toolbar The React component.
Projects
None yet
Development

No branches or pull requests

4 participants