number of items in cart is now properly aligned

This commit is contained in:
Senad Uka
2015-04-16 06:45:38 +02:00
parent 19cdca76b1
commit fc9f7496d2
3 changed files with 19 additions and 8 deletions

View File

@@ -3,24 +3,32 @@ var CartStore = require('../../stores/cartStore.js');
var CartActions = require('../../actions/cartActions.js');
var NavigationActions = require('../../actions/navigationActions.js');
var LoginStatus = require('../shared/loginStatus');
var cartStyle = {
fontSize: '50px'
};
var normalizeCount = function(count) {
if (count >= 0 && count < 10) {
return "\u00a0" + count;
} else {
return count;
}
}
var CartIcon = React.createClass({
render: function() {
var textNotificationStyle = (this.state.count > 0) ? { display: 'inline-block'} : { display: 'none'} ;
return (
return (
<ul className="nav navbar-nav navbar-right">
<li><LoginStatus /></li>
<li onClick={this._onClick} style={{borderTop: 'solid lightgray 1px', borderBottom: 'solid lightgray 1px', borderLeft: 'solid lightgray 1px', paddingBottom: 22}}><a ><div className="mycart"><span>{this.state.count}</span></div></a></li>
<li onClick={this._onClick} style={{borderTop: 'solid lightgray 1px', borderBottom: 'solid lightgray 1px', borderLeft: 'solid lightgray 1px', paddingBottom: 22}}><a ><div className="mycart"><span>{normalizeCount(this.state.count)}</span></div></a></li>
<li onClick={this._onClick} style={{borderTop: 'solid lightgray 1px', borderBottom: 'solid lightgray 1px', paddingBottom: 2}}><a href="#">0,00 KM</a></li>
<li onClick={this._onClick} style={{borderTop: 'solid lightgray 1px', borderBottom: 'solid lightgray 1px', borderRight: 'solid lightgray 1px'}}><a style={{marginLeft: 20, marginBottom: 10, marginRight: 15}} className="mybutton" href="#">Završi narudžbu</a></li>
</ul>

View File

@@ -34,10 +34,8 @@ var SingleItem = React.createClass({
<img className="img-responsive" src={firstImage.resized_url} alt="product image" />
<div>
<div>
<p>{ this.props.item.get('brand') ? this.props.item.get('brand').name : '' }{ this.props.item.get('name') }</p>
<h4> { this.props.item.get('list_price') } KM </h4>
<p>{ this.props.item.get('brand') ? this.props.item.get('brand').name : '' }{ this.props.item.get('name') }</p>
<h4>{ this.props.item.get('list_price') } KM </h4>
</div>
</div>
</div>

View File

@@ -339,13 +339,18 @@ background-size: cover;
padding-bottom: 0px;
right:-14px;
bottom: -15px;
text-align: right;
}
.mycart div {
text-align: right;
}
.mycart span{
position: absolute;
left: 13.4px;
top: 4px;
color: black;
}
.mycart span:hover{