css fix ; url fix

This commit is contained in:
GotPPay
2017-11-13 19:26:43 +01:00
parent ec9a29e04d
commit 2974480b83
10 changed files with 27665 additions and 53 deletions

View File

@@ -8,36 +8,22 @@ export default class Welcome extends React.Component {
this.state = {
type: AD_TYPE_SALE,
buyButtonImg: 'static/images/sale_1_mobile.png',
rentButtonImg: 'static/images/rent_0_mobile.png'
}
}
onSaleClick () {
this.setState({
type: AD_TYPE_SALE,
buyButtonImg: 'static/images/sale_1_mobile.png',
rentButtonImg: 'static/images/rent_0_mobile.png'
})
}
onRentClick () {
this.setState({
type: AD_TYPE_RENT,
buyButtonImg: 'static/images/sale_0_mobile.png',
rentButtonImg: 'static/images/rent_1_mobile.png'
})
}
onSearchClick () {
}
render () {
let style1 = {
background:'url(' + this.state.buyButtonImg + ')',
backgrounSize: 'cover'
}
return (
<div>
<div className='welcome-container-bg'>
@@ -48,8 +34,8 @@ export default class Welcome extends React.Component {
<h1>KIVI</h1>
<h2>Pronađi svoj novi dom!</h2>
<div>
<button className='buy-button' style={{background:"url("+this.state.buyButtonImg+") no-repeat"}} onClick={this.onSaleClick.bind(this)}></button>
<button className='rent-button' style={{background:"url("+this.state.rentButtonImg+") no-repeat"}} onClick={this.onRentClick.bind(this)}></button>
<button className={this.state.type===AD_TYPE_SALE?'buy-button-active':'buy-button-inactive'} onClick={this.onSaleClick.bind(this)}></button>
<button className={this.state.type===AD_TYPE_RENT?'rent-button-active':'rent-button-inactive'} onClick={this.onRentClick.bind(this)}></button>
</div>
<button className='search-button' onClick={()=>this.props.onSearch({adType: this.state.type})} >TRAŽI</button>
</div>