(FIX): Fixed profile display issue. #85
@ -115,8 +115,8 @@ export default function Profile() {
|
||||
<p className="text-xs md:text-sm">{user?.Email}</p>
|
||||
</div>
|
||||
<div className="flex gap-x-4">
|
||||
<p className="text-xs md:text-sm"><span className="font-bold">{recipes.length}</span> recipes</p>
|
||||
<p className="text-xs md:text-sm"><span className="font-bold">{favorites.length}</span> favorites</p>
|
||||
<p className="text-xs md:text-sm"><span className="font-bold">{recipes?.length ?? 0}</span> recipes</p>
|
||||
<p className="text-xs md:text-sm"><span className="font-bold">{favorites?.length ?? 0}</span> favorites</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -126,10 +126,10 @@ export default function Profile() {
|
||||
<section className="p-8">
|
||||
<h2 className="text-2xl font-semibold text-gray-800">My Recipes</h2>
|
||||
<ul className="w-full my-2">
|
||||
{recipes.length <= 4 ? (
|
||||
recipes.map(recipe => <RecipeListItem key={recipe.Id} recipe={recipe} />)
|
||||
{recipes?.length <= 4 ? (
|
||||
recipes?.map(recipe => <RecipeListItem key={recipe.Id} recipe={recipe} />)
|
||||
) : (
|
||||
recipes.slice(0, 4).map(recipe => <RecipeListItem key={recipe.Id} recipe={recipe} />)
|
||||
recipes?.slice(0, 4).map(recipe => <RecipeListItem key={recipe.Id} recipe={recipe} />)
|
||||
)}
|
||||
<button onClick={seeAllRecipesHandler} className="w-full">
|
||||
<li className="w-full border-b border-gray-300 px-2 py-4 even:bg-gray-50 hover:bg-gray-100 hover:text-blue-600 duration-150 text-center">
|
||||
@ -143,10 +143,10 @@ export default function Profile() {
|
||||
<section className="p-8">
|
||||
<h2 className="text-2xl font-semibold text-gray-800">My Favorites</h2>
|
||||
<ul className="w-full my-2">
|
||||
{favorites.length <= 4 ? (
|
||||
favorites.map(recipe => <RecipeListItem key={recipe.Id} recipe={recipe} />)
|
||||
{favorites?.length <= 4 ? (
|
||||
favorites?.map(recipe => <RecipeListItem key={recipe.Id} recipe={recipe} />)
|
||||
) : (
|
||||
favorites.slice(0, 4).map(recipe => <RecipeListItem key={recipe.Id} recipe={recipe} />)
|
||||
favorites?.slice(0, 4).map(recipe => <RecipeListItem key={recipe.Id} recipe={recipe} />)
|
||||
)}
|
||||
<button onClick={seeAllFavoritesHandler} className="w-full">
|
||||
<li className="w-full border-b border-gray-300 px-2 py-4 even:bg-gray-50 hover:bg-gray-100 hover:text-blue-600 duration-150 text-center">
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user