Smaller refactorings, e.g., margins for title
This commit is contained in:
parent
ef8388be6d
commit
e6ea18bef8
1 changed files with 138 additions and 141 deletions
|
|
@ -22,7 +22,6 @@ export default function RecipeDetailPage() {
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const loadRecipe = async () => {
|
const loadRecipe = async () => {
|
||||||
if (id) {
|
if (id) {
|
||||||
try {
|
|
||||||
// Fetch recipe data when editing an existing one
|
// Fetch recipe data when editing an existing one
|
||||||
console.log("loading recipe with id", id)
|
console.log("loading recipe with id", id)
|
||||||
const data = await fetchRecipe(id)
|
const data = await fetchRecipe(id)
|
||||||
|
|
@ -30,9 +29,6 @@ export default function RecipeDetailPage() {
|
||||||
throw new Error("Id mismatch when loading recipes: " + id + " requested and " + data.id + " received!");
|
throw new Error("Id mismatch when loading recipes: " + id + " requested and " + data.id + " received!");
|
||||||
}
|
}
|
||||||
setRecipe(mapRecipeDtoToModel(data))
|
setRecipe(mapRecipeDtoToModel(data))
|
||||||
} catch (err) {
|
|
||||||
console.error(err)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -81,10 +77,11 @@ export default function RecipeDetailPage() {
|
||||||
{/* Container defining the maximum width of the content */}
|
{/* Container defining the maximum width of the content */}
|
||||||
<div className="content-container">
|
<div className="content-container">
|
||||||
{/* Header - remains in position when scrolling */}
|
{/* Header - remains in position when scrolling */}
|
||||||
<div className="sticky bg-gray-100 top-0 left-0 right-0 pb-4 border-b-2 border-gray-300">
|
<div className="sticky bg-gray-100 top-0 left-0 right-0 pb-6 border-b-2 border-gray-300">
|
||||||
<h1 className="content-title">{recipeWorkingCopy.title}</h1>
|
<h1 className="content-title mb-0">{recipeWorkingCopy.title}</h1>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
{/* Content */}
|
||||||
<div className="p-6 max-w-2xl mx-auto">
|
<div className="p-6 max-w-2xl mx-auto">
|
||||||
{/* Recipe image */}
|
{/* Recipe image */}
|
||||||
{recipe.imageUrl && (
|
{recipe.imageUrl && (
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue