mirror of
https://github.com/Kong/insomnia
synced 2024-11-08 14:49:53 +00:00
25 lines
479 B
JavaScript
25 lines
479 B
JavaScript
import React, {Component, PropTypes} from 'react';
|
|
import {shell} from 'electron';
|
|
|
|
class Link extends Component {
|
|
_handleClick (e) {
|
|
e.preventDefault();
|
|
shell.openExternal(this.props.href);
|
|
}
|
|
|
|
render () {
|
|
const {href, children, ...other} = this.props;
|
|
return (
|
|
<a href={href} onClick={this._handleClick.bind(this)} {...other}>
|
|
{children}
|
|
</a>
|
|
)
|
|
}
|
|
}
|
|
|
|
Link.propTypes = {
|
|
href: PropTypes.string.isRequired
|
|
};
|
|
|
|
export default Link;
|