diff --git a/src/pages/recipe/Recipe.tsx b/src/pages/recipe/Recipe.tsx index 53b0d1c..7267af9 100644 --- a/src/pages/recipe/Recipe.tsx +++ b/src/pages/recipe/Recipe.tsx @@ -10,6 +10,25 @@ import { useAuth } from '../../auth' import RecipeVisibilityIcon from '../../components/recipe-visibility-icon/RecipeVisibilityIcon' import UserIconAndName from '../../components/user-icon-and-name/UserIconAndName' import classes from './recipe.module.css' +import { useNavigate } from '@tanstack/react-router' + +interface EditButtonProps { + username: string + slug: string +} + +const EditButton = ({ username, slug }: EditButtonProps) => { + const navigate = useNavigate() + return ( + + ) +} interface RecipeStarInfoProps { starCount: number @@ -19,7 +38,7 @@ const RecipeStarInfo = ({ starCount }: RecipeStarInfoProps) => { return (
- {starCount} + {starCount}
) } @@ -80,7 +99,7 @@ const RecipeStarButton = ({ username, slug, isStarred, starCount }: RecipeStarBu return ( ) @@ -155,11 +174,14 @@ const Recipe = ({ username, slug }: RecipeProps) => {

{recipe.title}

- {isStarred !== null ? ( - - ) : ( - - )} +
+ {isStarred !== null ? ( + + ) : ( + + )} + {isOwner ? : null} +
diff --git a/src/pages/recipe/recipe.module.css b/src/pages/recipe/recipe.module.css index 69a80e6..f1c6402 100644 --- a/src/pages/recipe/recipe.module.css +++ b/src/pages/recipe/recipe.module.css @@ -30,21 +30,24 @@ width: 100%; } -.star-container { +.star-container, +.edit-button { display: flex; column-gap: 5px; align-items: center; height: 30px; } -button.star-container { +button.star-container, +button.edit-button { cursor: pointer; background-color: var(--off-white-1); border: 1px solid var(--off-white-3); border-radius: 5px; } -button.star-container:hover { +button.star-container:hover, +button.edit-button:hover { background-color: var(--off-white-2); } @@ -52,17 +55,25 @@ button.star-container:hover { color: var(--primary-yellow); } -.starred { - font-family: 'Inter', sans-serif; - font-size: 16px; -} - button .star-count { - font-family: 'Inter', sans-serif; - font-size: 16px; background-color: var(--off-white-3); min-width: 20px; min-height: 16px; border-radius: 50%; text-align: center; } + +.info-buttons { + display: flex; + align-items: center; + gap: 10px; +} + +.edit-icon { + color: var(--primary-red); +} + +.button-text { + font-family: 'Inter', sans-serif; + font-size: 16px; +}