Make hovering URL unclickable
This commit is contained in:
@@ -1,27 +1,9 @@
|
|||||||
const React = require('react');
|
const React = require('react');
|
||||||
|
|
||||||
const style = {
|
|
||||||
color: 'gray',
|
|
||||||
backgroundColor: 'whitesmoke',
|
|
||||||
maxWidth: '95%',
|
|
||||||
whiteSpace: 'nowrap',
|
|
||||||
overflow: 'hidden',
|
|
||||||
textOverflow: 'ellipsis',
|
|
||||||
position: 'absolute',
|
|
||||||
bottom: 0,
|
|
||||||
paddingLeft: 4,
|
|
||||||
paddingRight: 16,
|
|
||||||
paddingTop: 2,
|
|
||||||
paddingBottom: 2,
|
|
||||||
borderTopRightRadius: 4,
|
|
||||||
borderTop: 'solid thin lightgray',
|
|
||||||
borderRight: 'solid thin lightgray'
|
|
||||||
};
|
|
||||||
|
|
||||||
class HoveringURL extends React.Component {
|
class HoveringURL extends React.Component {
|
||||||
render() {
|
render() {
|
||||||
return (
|
return (
|
||||||
<div style={style}>
|
<div style={this.props.style}>
|
||||||
{this.props.targetURL}
|
{this.props.targetURL}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
@@ -29,6 +11,7 @@ class HoveringURL extends React.Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
HoveringURL.propTypes = {
|
HoveringURL.propTypes = {
|
||||||
|
style: React.PropTypes.object,
|
||||||
targetURL: React.PropTypes.string
|
targetURL: React.PropTypes.string
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@@ -10,6 +10,28 @@ const MattermostView = require('./MattermostView.jsx');
|
|||||||
const TabBar = require('./TabBar.jsx');
|
const TabBar = require('./TabBar.jsx');
|
||||||
const HoveringURL = require('./HoveringURL.jsx');
|
const HoveringURL = require('./HoveringURL.jsx');
|
||||||
|
|
||||||
|
// Todo: Need to consider better way to apply styles
|
||||||
|
const styles = {
|
||||||
|
hoveringURL: {
|
||||||
|
color: 'gray',
|
||||||
|
backgroundColor: 'whitesmoke',
|
||||||
|
maxWidth: '95%',
|
||||||
|
whiteSpace: 'nowrap',
|
||||||
|
overflow: 'hidden',
|
||||||
|
textOverflow: 'ellipsis',
|
||||||
|
position: 'absolute',
|
||||||
|
bottom: 0,
|
||||||
|
paddingLeft: 4,
|
||||||
|
paddingRight: 16,
|
||||||
|
paddingTop: 2,
|
||||||
|
paddingBottom: 2,
|
||||||
|
borderTopRightRadius: 4,
|
||||||
|
borderTop: 'solid thin lightgray',
|
||||||
|
borderRight: 'solid thin lightgray',
|
||||||
|
pointerEvents: 'none'
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
const MainPage = React.createClass({
|
const MainPage = React.createClass({
|
||||||
propTypes: {
|
propTypes: {
|
||||||
disablewebsecurity: React.PropTypes.bool.isRequired,
|
disablewebsecurity: React.PropTypes.bool.isRequired,
|
||||||
@@ -292,6 +314,7 @@ const MainPage = React.createClass({
|
|||||||
null :
|
null :
|
||||||
<HoveringURL
|
<HoveringURL
|
||||||
key='hoveringURL'
|
key='hoveringURL'
|
||||||
|
style={styles.hoveringURL}
|
||||||
targetURL={this.state.targetURL}
|
targetURL={this.state.targetURL}
|
||||||
/> }
|
/> }
|
||||||
</ReactCSSTransitionGroup>
|
</ReactCSSTransitionGroup>
|
||||||
|
Reference in New Issue
Block a user