Component refactoring

This commit is contained in:
Scott E. Graves
2018-10-03 14:54:05 -05:00
parent b4aa381023
commit b430465b7b
15 changed files with 390 additions and 128 deletions

View File

@@ -1,26 +1,21 @@
.Owner {
display: block;
margin-right: 2px;
padding: 0;
width: 20px;
height: 20px;
margin: 0;
width: 100%;
height: 100%;
border: 0;
box-sizing: border-box;
cursor: pointer;
}
.Owner p {
margin: 0;
padding: 0;
}
.UpgradeIcon {
display: block;
margin: 0;
padding: 0;
object-fit: contain;
border: 0;
width: 20px;
height: 20px;
max-width: 100%;
max-height: 100%;
box-sizing: border-box;
opacity: 0.65;
}

View File

@@ -5,27 +5,21 @@ import availableImage from '../../assets/images/release_available.png';
import ReactTooltip from 'react-tooltip';
export default CSSModules((props) => {
let style;
let style2;
let placement = 'left';
let toolTipText = 'UI Upgrade Available';
if (props.release) {
placement='bottom';
toolTipText = 'New Release Available';
style = {float: 'right', marginRight: '5%', width: '15px', height: '15px', cursor: 'default'};
style2 = {width: '15px', height: '15px'};
}
return props
.available ?
(
<div style={style}
styleName='Owner'>
<div styleName='Owner'>
<p data-tip='' data-for={placement}>
<img alt=''
onClick={props.clicked}
src={availableImage}
style={style2}
styleName='UpgradeIcon'/>
</p>
<ReactTooltip id={placement} place={placement}>{toolTipText}</ReactTooltip>