diff --git a/src/app/recipe/recipe.component.html b/src/app/recipe/recipe.component.html
index ee19345..25d91fb 100644
--- a/src/app/recipe/recipe.component.html
+++ b/src/app/recipe/recipe.component.html
@@ -2,26 +2,30 @@
- {{ recipe.name }}
- {{ recipe.description }}
-
-
-
-
+ Name : {{ recipe.name }}
+ Description :
+
+
+
+ Image :
+
+
+
+
Ingredients
-
diff --git a/src/app/recipe/recipe.component.scss b/src/app/recipe/recipe.component.scss
index 011730b..deb6e59 100644
--- a/src/app/recipe/recipe.component.scss
+++ b/src/app/recipe/recipe.component.scss
@@ -2,3 +2,15 @@
max-width: 600px;
margin-bottom: 8px;
}
+
+.description {
+ max-width: 100%;
+ overflow: hidden;
+}
+
+.recipe-image {
+ max-width: 500px;
+ max-height: 500px;
+ display: block;
+ margin: 8px 0;
+}
diff --git a/src/app/recipe/recipe.component.ts b/src/app/recipe/recipe.component.ts
index a495fd2..175c506 100644
--- a/src/app/recipe/recipe.component.ts
+++ b/src/app/recipe/recipe.component.ts
@@ -17,6 +17,7 @@ import { MatCardModule } from '@angular/material/card';
export class RecipeComponent implements OnInit {
recipe: Recipe | undefined;
ingredientRecipes: IngredientRecipe[] = [];
+ formattedDescription: string = '';
constructor(
private route: ActivatedRoute,
@@ -31,6 +32,9 @@ export class RecipeComponent implements OnInit {
if (this.recipe) {
this.ingredientRecipes = this.recipeService.getIngredientRecipes(this.recipe.id);
+ this.formattedDescription = this.formatDescription(
+ this.recipe.description
+ );
}
}
@@ -41,4 +45,8 @@ export class RecipeComponent implements OnInit {
navBack(): void {
window.history.back();
}
+
+ formatDescription(description: string): string {
+ return description.replace(/(.{50})/g, '$1
');
+ }
}