Improve visility of hevering URL

- Add top and bottom padding
- Add border lines
- Truncate long URL using ellipsis
This commit is contained in:
Yuya Ochiai
2016-11-29 22:01:18 +09:00
parent 93c76861ed
commit 14969a8c04

View File

@@ -1,25 +1,28 @@
const React = require('react'); const React = require('react');
const divStyle = { const style = {
color: 'gray',
backgroundColor: 'whitesmoke', backgroundColor: 'whitesmoke',
maxWidth: '95%',
whiteSpace: 'nowrap',
overflow: 'hidden',
textOverflow: 'ellipsis',
position: 'absolute', position: 'absolute',
bottom: 0, bottom: 0,
paddingLeft: 4, paddingLeft: 4,
paddingRight: 16, paddingRight: 16,
borderTopRightRadius: 4 paddingTop: 2,
}; paddingBottom: 2,
borderTopRightRadius: 4,
const spanStyle = { borderTop: 'solid thin lightgray',
color: 'gray' borderRight: 'solid thin lightgray'
}; };
class HoveringURL extends React.Component { class HoveringURL extends React.Component {
render() { render() {
return ( return (
<div style={divStyle}> <div style={style}>
<span style={spanStyle}> {this.props.targetURL}
{this.props.targetURL}
</span>
</div> </div>
); );
} }