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