mirror of
https://github.com/ant-design/ant-design.git
synced 2024-11-29 21:59:41 +08:00
Merge pull request #1302 from waywardmonkeys/site-components
Update IconSet and Header for coding standard.
This commit is contained in:
commit
04ddd8a417
@ -8,6 +8,10 @@ import './index.less';
|
||||
|
||||
import componentsList from '../../../_data/react-components';
|
||||
export default class Header extends React.Component {
|
||||
static contextTypes = {
|
||||
router: React.PropTypes.object.isRequired,
|
||||
}
|
||||
|
||||
constructor(props) {
|
||||
super(props);
|
||||
|
||||
@ -137,7 +141,3 @@ export default class Header extends React.Component {
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Header.contextTypes = {
|
||||
router: React.PropTypes.object.isRequired,
|
||||
};
|
||||
|
@ -3,19 +3,22 @@ import CopyToClipboard from 'react-copy-to-clipboard';
|
||||
import classNames from 'classnames';
|
||||
import { Icon } from '../../../';
|
||||
|
||||
const CopyableIcon = React.createClass({
|
||||
getInitialState() {
|
||||
return {
|
||||
class CopyableIcon extends React.Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
justCopied: false
|
||||
};
|
||||
},
|
||||
onCopied() {
|
||||
}
|
||||
|
||||
onCopied = () => {
|
||||
this.setState({ justCopied: true }, () => {
|
||||
setTimeout(() => {
|
||||
this.setState({ justCopied: false });
|
||||
}, 1000);
|
||||
});
|
||||
},
|
||||
}
|
||||
|
||||
render() {
|
||||
const text = `<Icon type="${this.props.type}" />`;
|
||||
return (
|
||||
@ -27,14 +30,13 @@ const CopyableIcon = React.createClass({
|
||||
</CopyToClipboard>
|
||||
);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
export default class IconSet extends React.Component {
|
||||
static defaultProps = {
|
||||
icons: []
|
||||
}
|
||||
|
||||
const IconSet = React.createClass({
|
||||
getDefaultProps() {
|
||||
return {
|
||||
icons: []
|
||||
};
|
||||
},
|
||||
render() {
|
||||
const className = this.props.className;
|
||||
const listClassName = classNames({
|
||||
@ -48,6 +50,4 @@ const IconSet = React.createClass({
|
||||
</ul>
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
export default IconSet;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user