mirror of
https://github.com/opensupports/opensupports.git
synced 2025-07-31 01:35:15 +02:00
[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 Button from 'core-components/button';
|
||||||
import DropDown from 'core-components/drop-down';
|
import DropDown from 'core-components/drop-down';
|
||||||
|
import Icon from 'core-components/icon';
|
||||||
|
|
||||||
var languageList = ['English', 'Spanish', 'Portuguese', 'German', 'Turkish', 'Indian'];
|
var languageList = ['English', 'Spanish', 'Portuguese', 'German', 'Turkish', 'Indian'];
|
||||||
var codeLanguages = {
|
var codeLanguages = {
|
||||||
@ -35,7 +36,7 @@ var MainLayoutHeader = React.createClass({
|
|||||||
return {
|
return {
|
||||||
content: (
|
content: (
|
||||||
<span>
|
<span>
|
||||||
<img className="language-icon" src={`../images/icons/${codeLanguages[item]}.png`} />{item}
|
<Icon name={codeLanguages[item]} />{item}
|
||||||
</span>
|
</span>
|
||||||
)
|
)
|
||||||
};
|
};
|
||||||
|
@ -4,7 +4,6 @@ import _ from 'lodash';
|
|||||||
import {Motion, spring} from 'react-motion';
|
import {Motion, spring} from 'react-motion';
|
||||||
|
|
||||||
import callback from 'lib/callback';
|
import callback from 'lib/callback';
|
||||||
import getIcion from 'lib/callback';
|
|
||||||
|
|
||||||
var DropDown = React.createClass({
|
var DropDown = React.createClass({
|
||||||
|
|
||||||
@ -44,7 +43,7 @@ var DropDown = React.createClass({
|
|||||||
return {
|
return {
|
||||||
defaultStyle: closedStyle,
|
defaultStyle: closedStyle,
|
||||||
style: (this.state.opened) ? openedStyle : closedStyle
|
style: (this.state.opened) ? openedStyle : closedStyle
|
||||||
}
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
|
19
src/core-components/icon.js
Normal file
19
src/core-components/icon.js
Normal file
@ -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…
x
Reference in New Issue
Block a user