diff options
-rw-r--r-- | src/components/settings/recipes/RecipeItem.js (renamed from src/components/settings/recipes/RecipeItem.tsx) | 13 | ||||
-rw-r--r-- | src/models/RecipePreview.ts | 3 |
2 files changed, 7 insertions, 9 deletions
diff --git a/src/components/settings/recipes/RecipeItem.tsx b/src/components/settings/recipes/RecipeItem.js index 1dfe88683..df5b42222 100644 --- a/src/components/settings/recipes/RecipeItem.tsx +++ b/src/components/settings/recipes/RecipeItem.js | |||
@@ -1,14 +1,15 @@ | |||
1 | import { Component } from 'react'; | 1 | import { Component } from 'react'; |
2 | import PropTypes from 'prop-types'; | ||
2 | import { observer } from 'mobx-react'; | 3 | import { observer } from 'mobx-react'; |
3 | 4 | ||
4 | import RecipePreviewModel from '../../../models/RecipePreview'; | 5 | import RecipePreviewModel from '../../../models/RecipePreview'; |
5 | 6 | ||
6 | type Props = { | 7 | class RecipeItem extends Component { |
7 | recipe: RecipePreviewModel; | 8 | static propTypes = { |
8 | onClick: () => {}; | 9 | recipe: PropTypes.instanceOf(RecipePreviewModel).isRequired, |
9 | }; | 10 | onClick: PropTypes.func.isRequired, |
11 | }; | ||
10 | 12 | ||
11 | class RecipeItem extends Component<Props> { | ||
12 | render() { | 13 | render() { |
13 | const { recipe, onClick } = this.props; | 14 | const { recipe, onClick } = this.props; |
14 | 15 | ||
@@ -17,7 +18,7 @@ class RecipeItem extends Component<Props> { | |||
17 | {recipe.isDevRecipe && ( | 18 | {recipe.isDevRecipe && ( |
18 | <span className="recipe-teaser__dev-badge">dev</span> | 19 | <span className="recipe-teaser__dev-badge">dev</span> |
19 | )} | 20 | )} |
20 | <img src={recipe.icon} className="recipe-teaser__icon" alt="" /> | 21 | <img src={recipe.icons.svg} className="recipe-teaser__icon" alt="" /> |
21 | <span className="recipe-teaser__label">{recipe.name}</span> | 22 | <span className="recipe-teaser__label">{recipe.name}</span> |
22 | {recipe.aliases && recipe.aliases.length > 0 && ( | 23 | {recipe.aliases && recipe.aliases.length > 0 && ( |
23 | <span className="recipe-teaser__alias_label"> | 24 | <span className="recipe-teaser__alias_label"> |
diff --git a/src/models/RecipePreview.ts b/src/models/RecipePreview.ts index 53dd18f2c..fb8cb3e3e 100644 --- a/src/models/RecipePreview.ts +++ b/src/models/RecipePreview.ts | |||
@@ -4,7 +4,6 @@ interface IRecipePreview { | |||
4 | icon: string; | 4 | icon: string; |
5 | featured: boolean; | 5 | featured: boolean; |
6 | aliases: string[]; | 6 | aliases: string[]; |
7 | isDevRecipe: boolean; | ||
8 | } | 7 | } |
9 | 8 | ||
10 | export default class RecipePreview { | 9 | export default class RecipePreview { |
@@ -18,8 +17,6 @@ export default class RecipePreview { | |||
18 | 17 | ||
19 | aliases: string[] = []; | 18 | aliases: string[] = []; |
20 | 19 | ||
21 | isDevRecipe: boolean = false; | ||
22 | |||
23 | constructor(data: IRecipePreview) { | 20 | constructor(data: IRecipePreview) { |
24 | if (!data) { | 21 | if (!data) { |
25 | throw new Error('RecipePreview config not valid'); | 22 | throw new Error('RecipePreview config not valid'); |