Skip to content

Commit

Permalink
mf - Cow buttons are smaller and different colors
Browse files Browse the repository at this point in the history
  • Loading branch information
mfletcher2 committed Jun 6, 2023
1 parent 3cdf326 commit f485acc
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions frontend/src/main/components/Commons/ManageCows.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from "react";
import { Card, Button, Row } from "react-bootstrap";
import { Card, Button, Row, Col } from "react-bootstrap";

// add parameters
const ManageCows = ({userCommons,commons, onBuy, onSell}) => {
Expand All @@ -13,13 +13,14 @@ const ManageCows = ({userCommons,commons, onBuy, onSell}) => {
<Card.Title className="text-center">🐮 Number of Cows: {userCommons.numOfCows}</Card.Title>
<Card.Title className="text-center">🥛 Current Milk Price: ${commons?.milkPrice}</Card.Title>
<Row>
<p />
<Button variant="outline-danger" onClick={()=>{onBuy(userCommons)}} data-testid={"buy-cow-button"}>Buy cow</Button>
<p />
<Button variant="outline-danger" onClick={()=>{onSell(userCommons)}} data-testid={"sell-cow-button"}>Sell cow</Button>
<p />
<Col className="text-center">
<Button variant="outline-success" onClick={()=>{onBuy(userCommons)}} data-testid={"buy-cow-button"}>Buy cow</Button>
</Col>
<Col className="text-center">
<Button variant="outline-danger" onClick={()=>{onSell(userCommons)}} data-testid={"sell-cow-button"}>Sell cow</Button>
</Col>
</Row>

Note: Buying cows buys at current cow price, but selling cows sells at current cow price
times the average health of cows as a percentage!
</Card.Body>
Expand Down

0 comments on commit f485acc

Please sign in to comment.