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