Skip to content

Commit

Permalink
feat: Added mdi-material-icons for plus minus icons, cleaned up Quant…
Browse files Browse the repository at this point in the history
…ityInput styles, added QuantityInput to CartItem example
  • Loading branch information
nnnnat committed Jun 26, 2018
1 parent 7d2d52e commit 393a27f
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 12 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@
"lodash.get": "^4.4.2",
"lodash.isempty": "^4.4.0",
"lodash.isequal": "^4.5.0",
"mdi-material-ui": "^5.1.1",
"polished": "^1.9.2",
"react": "16.4.0",
"react-dom": "16.4.0",
Expand Down
2 changes: 1 addition & 1 deletion package/src/components/CartItem/v1/CartItem.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const item = {
CartItemDetailComponent: CartItemDetail,
CartItemStockWarningComponent: StockWarning,
CartItemPriceComponent: Price,
CartItemQuantityInputComponent: () => "Quantity Input"
CartItemQuantityInputComponent: QuantityInput
}}
item={item}
/>
Expand Down
23 changes: 12 additions & 11 deletions package/src/components/QuantityInput/v1/QuantityInput.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,31 +4,32 @@ import { withStyles } from "@material-ui/core/styles";
import ButtonBase from "@material-ui/core/ButtonBase";
import InputAdornment from "@material-ui/core/InputAdornment";
import TextField from "@material-ui/core/TextField";
import Minus from "mdi-material-ui/Minus";
import Plus from "mdi-material-ui/Plus";
import { applyTheme } from "../../../utils";

const styles = (theme) => ({
incrementButton: {
backgroundColor: "#fafafa",
boxSizing: "border-box",
color: "#3c3c3c",
fontSize: "1rem",
lineHieght: 1,
boxSizing: "inherit",
color: "#666666",
fontSize: "12px",
padding: 6
},
quantityContainer: {
padding: 0,
border: `1px solid #d9d9d9`,
borderRadius: "2px",
boxSizing: "border-box",
backgroundColor: theme.palette.common.white,
borderRadius: "2px"
overflow: "hidden",
padding: 0
},
quantityInput: {
borderLeft: `1px solid #d9d9d9`,
borderRight: `1px solid #d9d9d9`,
boxSizing: "border-box",
boxSizing: "inherit",
color: "#3c3c3c",
fontSize: "12px",
width: "40px",
maxWidth: "40px",
textAlign: "center",
"&:focus": {
borderColor: "#80bdff",
Expand Down Expand Up @@ -96,7 +97,7 @@ class QuantityInput extends Component {
onClick={this.handleDecrementButton}
className={incrementButton}
>
<i className="fa fa-minus" />
<Minus />
</ButtonBase>
</InputAdornment>
),
Expand All @@ -108,7 +109,7 @@ class QuantityInput extends Component {
onClick={this.handleIncrementButton}
className={incrementButton}
>
<i className="fa fa-plus" />
<Plus />
</ButtonBase>
</InputAdornment>
),
Expand Down
4 changes: 4 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5999,6 +5999,10 @@ mdast-util-compact@^1.0.0:
unist-util-modify-children "^1.0.0"
unist-util-visit "^1.1.0"

mdi-material-ui@^5.1.1:
version "5.1.1"
resolved "https://registry.yarnpkg.com/mdi-material-ui/-/mdi-material-ui-5.1.1.tgz#5cbe5afb44705fd14cb4517019d9778ccf48454f"

media-typer@0.3.0:
version "0.3.0"
resolved "https://registry.yarnpkg.com/media-typer/-/media-typer-0.3.0.tgz#8710d7af0aa626f8fffa1ce00168545263255748"
Expand Down

0 comments on commit 393a27f

Please sign in to comment.