Skip to content
This repository has been archived by the owner on Jan 30, 2024. It is now read-only.

Commit

Permalink
feat: isDisabled support for IngredientBox
Browse files Browse the repository at this point in the history
  • Loading branch information
Eray C committed Nov 1, 2021
1 parent 615554b commit 5ef8bb9
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/components/IngredientBox.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,12 @@ import { buttonClassNames } from "./Button";

export class IngredientBox extends React.Component {
render() {
const { name, image, onSelected } = this.props;
const className = [...buttonClassNames, onSelected ? "border-green-500" : "border-red-1000"];
const { name, image, onSelected, isDisabled } = this.props;
const className = [
...buttonClassNames,
onSelected ? "border-green-500" : "border-red-1000",
isDisabled ? "cursor-not-allowed" : "cursor-pointer"
];

return (
<div className={className.join(" ")}>
Expand Down

0 comments on commit 5ef8bb9

Please sign in to comment.