From ee3ac34e4b7959a6102a9a64d608871d995d7bae Mon Sep 17 00:00:00 2001 From: Anika Raemer Date: Sun, 21 Sep 2025 11:01:52 +0200 Subject: [PATCH] add button link for customized Link looking like a Button --- frontend/src/components/basics/Button.tsx | 39 +++++++++++-------- frontend/src/components/basics/ButtonLink.tsx | 0 .../components/recipes/RecipeDetailPage.tsx | 21 +++++----- .../components/recipes/RecipeListToolbar.tsx | 2 +- 4 files changed, 34 insertions(+), 28 deletions(-) create mode 100644 frontend/src/components/basics/ButtonLink.tsx diff --git a/frontend/src/components/basics/Button.tsx b/frontend/src/components/basics/Button.tsx index 16922dc..c186039 100644 --- a/frontend/src/components/basics/Button.tsx +++ b/frontend/src/components/basics/Button.tsx @@ -4,31 +4,38 @@ type ButtonProps = { onClick: () => void, icon?: Icon, text?: string, - buttonType? : ButtonType + buttonType?: ButtonType + className?: string } export const ButtonType = { - DarkButton: { - textColor: "dark-button-text", - backgroundColor: "dark-button-bg" - }, - PrimaryButton: { - textColor: "primary-button-text", - backgroundColor: "primary-button-bg" - }, - DefaultButton: { - textColor: "default-button-text", - backgroundColor: "default-button-bg" - } + DarkButton: { + textColor: "dark-button-text", + backgroundColor: "dark-button-bg" + }, + PrimaryButton: { + textColor: "primary-button-text", + backgroundColor: "primary-button-bg" + }, + DefaultButton: { + textColor: "default-button-text", + backgroundColor: "default-button-bg" + } } as const; export type ButtonType = typeof ButtonType[keyof typeof ButtonType]; -export default function Button ({onClick: onClick, icon, text, buttonType = ButtonType.DefaultButton} : ButtonProps){ - return( +export default function Button( + { + onClick: onClick, + icon, text, + buttonType = ButtonType.DefaultButton, + className = "" + }: ButtonProps) { + return (