Skip to content

Commit

Permalink
[#25] Updated component
Browse files Browse the repository at this point in the history
  • Loading branch information
corrado4eyes committed Dec 30, 2019
1 parent 78f8603 commit 27e99e1
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions hearthstone/src/uiComponents/cardComponent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,23 @@ import { Image, Card, Button, Row, Col } from 'react-bootstrap';
import CardModel from '../model/card';
import noImg from '../assets/noImg.jpg';
import changeImg from '../assets/change-img-32x32.png';
import favoriteImg from '../assets/favorite.png';
import notFavorite from '../assets/not-favorite.png';
import { urlIsFound } from '../utils/utils';
import { dispatchSaveCard } from '../redux/actions/cardActions';
import { bindActionCreators } from 'redux';
import { connect } from 'react-redux';
import '../styles/cardComponent.css';

interface OwnProps {
card: CardModel;
}

export interface OwnState {
goldImg: boolean
isImgAvailable: boolean
}

export interface OwnProps {
card: CardModel;
}

interface ActionProps {
dispatchSaveCard: typeof dispatchSaveCard;
}
Expand Down Expand Up @@ -96,7 +98,8 @@ export class CardComponent extends React.PureComponent<Props, OwnState> {
disabled={this.props.card.img ? false : true}><Image src={changeImg}/></Button>
</Col>
<Col>
<Button id="favBtn" onClick={this.addToFavourites}>Add to Favourites</Button>
<Button id="favBtn"
onClick={this.addToFavourites}><Image src={this.props.card.favourite ? favoriteImg : notFavorite}/></Button>
</Col>
</Row>
</Card>
Expand Down

0 comments on commit 27e99e1

Please sign in to comment.