diff --git a/frontend/src/App.css b/frontend/src/App.css index db6d28d..7a475dd 100644 --- a/frontend/src/App.css +++ b/frontend/src/App.css @@ -39,9 +39,4 @@ @apply text-sm text-red-600; } - /* containers */ - .highlight-container-bg { - @apply bg-gray-200 rounded p-2; - } - } \ No newline at end of file diff --git a/frontend/src/components/basics/BoxContainer.tsx b/frontend/src/components/basics/BoxContainer.tsx new file mode 100644 index 0000000..f528535 --- /dev/null +++ b/frontend/src/components/basics/BoxContainer.tsx @@ -0,0 +1,26 @@ +import clsx from "clsx"; +import React, {type ReactNode} from "react"; + +type BoxContainerProps = React.HTMLAttributes & { + /** Content to render inside the container */ + children: ReactNode; +}; + +/** + * Box Container for highlighting content + * + * Accepts any div attributes (e.g. `className`, `title`, `onClick`, or DnD listeners). + */ +export function BoxContainer({children, className, ...rest}: BoxContainerProps) { + return ( +
+ {children} +
+ ); +} diff --git a/frontend/src/components/basics/ButtonGroupLayout.tsx b/frontend/src/components/basics/ButtonGroupLayout.tsx index b61e9b1..30bb688 100644 --- a/frontend/src/components/basics/ButtonGroupLayout.tsx +++ b/frontend/src/components/basics/ButtonGroupLayout.tsx @@ -1,23 +1,22 @@ -import type {ReactNode} from "react"; +import React, {type ReactNode} from "react"; import clsx from "clsx"; -type ButtonGroupLayoutProps = { +type ButtonGroupLayoutProps = React.HTMLAttributes & { /** Content to render inside the header */ children: ReactNode; - - /** Optional additional Tailwind classes */ - className?: string; }; /** * A layout for horizontally aligning buttons as usually a save button is accompanied by a cancel button * @param children Children of the layout, i.e., buttons * @param className Optional additional styles + * @param props all other props by html div that might be needed * @constructor */ -export default function ButtonGroupLayout({children, className = ""}: ButtonGroupLayoutProps) { +export default function ButtonGroupLayout({children, className, ...rest}: ButtonGroupLayoutProps) { return (
& { /** Content to render inside the container */ children: ReactNode; - - /** Optional additional Tailwind classes */ - className?: string; }; /** * Background for the content area of a page * @param children Children the page, i.e., header and body * @param className Optional additional styles + * @param props all other props by html div that might be needed * @see ContentBody.tsx * @constructor */ -export default function ContentBackground({children, className = ""}: ContentBackgroundProps) { +export default function ContentBackground({children, className, ...props}: ContentBackgroundProps) { return (
& { /** Content to render inside the container */ children: ReactNode; - - /** Optional additional Tailwind classes */ - className?: string; }; /** * Body for the content area of a page * @param children Children the page, i.e., header and body * @param className Optional additional styles + * @param props all other props by html div that might be needed * @constructor */ -export default function ContentBody({children, className = ""}: ContentBodyProps) { +export default function ContentBody({children, className, ...props}: ContentBodyProps) { return (
& { /** Content to render inside the group */ children: ReactNode; - - /** Optional additional Tailwind classes */ - className?: string; }; /** * A layout for horizontally aligning inputs and buttons - designed for pages with several input items in a row * @param children Children of the layout, i.e., inputs * @param className Optional additional styles + * @param props all other props by html div that might be needed * @constructor */ -export default function HorizontalInputGroupLayout({children, className = ""}: HorizontalInputGroupLayoutProps) { +export default function HorizontalInputGroupLayout({children, className, ...props}: HorizontalInputGroupLayoutProps) { return (
& { /** Content to render inside the container */ children: ReactNode; - - /** Optional additional Tailwind classes */ - className?: string; }; /** * Container for a page providing the correct dimensions to its children * @param children Children the page, i.e., header and body * @param className Optional additional styles + * @param props all other props by html div that might be needed * @constructor */ -export default function PageContainer({children, className = ""}: PageContainerProps): ReactNode { +export default function PageContainer({children, className, ...rest}: PageContainerProps): ReactNode { return (
+

Für {recipeWorkingCopy.servings.amount} {recipeWorkingCopy.servings.unit}

@@ -114,7 +115,7 @@ export default function RecipeDetailPage() { min={1} className="justify-end sm:justify-center" /> -
+ {/* Ingredients */}

Zutaten