[Max-Red] - Create icon component
This commit is contained in:
parent
b39fd2f948
commit
0a94a001d4
|
@ -5,6 +5,7 @@ import CommonActions from 'actions/common-actions';
|
|||
|
||||
import Button from 'core-components/button';
|
||||
import DropDown from 'core-components/drop-down';
|
||||
import Icon from 'core-components/icon';
|
||||
|
||||
var languageList = ['English', 'Spanish', 'Portuguese', 'German', 'Turkish', 'Indian'];
|
||||
var codeLanguages = {
|
||||
|
@ -35,7 +36,7 @@ var MainLayoutHeader = React.createClass({
|
|||
return {
|
||||
content: (
|
||||
<span>
|
||||
<img className="language-icon" src={`../images/icons/${codeLanguages[item]}.png`} />{item}
|
||||
<Icon name={codeLanguages[item]} />{item}
|
||||
</span>
|
||||
)
|
||||
};
|
||||
|
|
|
@ -4,7 +4,6 @@ import _ from 'lodash';
|
|||
import {Motion, spring} from 'react-motion';
|
||||
|
||||
import callback from 'lib/callback';
|
||||
import getIcion from 'lib/callback';
|
||||
|
||||
var DropDown = React.createClass({
|
||||
|
||||
|
@ -44,7 +43,7 @@ var DropDown = React.createClass({
|
|||
return {
|
||||
defaultStyle: closedStyle,
|
||||
style: (this.state.opened) ? openedStyle : closedStyle
|
||||
}
|
||||
};
|
||||
},
|
||||
|
||||
render() {
|
||||
|
|
|
@ -0,0 +1,19 @@
|
|||
import React from 'react';
|
||||
|
||||
|
||||
|
||||
var Icon = React.createClass({
|
||||
|
||||
propTypes: {
|
||||
name: React.PropTypes.string.isRequired
|
||||
},
|
||||
|
||||
render() {
|
||||
return (
|
||||
<img className="language-icon" src={`../images/icons/${this.props.name}.png`} />
|
||||
);
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
export default Icon;
|
Loading…
Reference in New Issue