Style and position settings button

This commit is contained in:
araemer 2025-12-07 08:10:27 +01:00
parent 5b83a783aa
commit df39a1a217
5 changed files with 31 additions and 21 deletions

View file

@ -22,6 +22,10 @@ export const ButtonType = {
textColor: "text-white",
backgroundColor: "bg-gray-600 hover:bg-gray-800",
},
LightButton: {
textColor: "text-gray-600",
backgroundColor: "bg-white hover:bg-gray-300",
},
PrimaryButton: {
textColor: "text-gray-600",
backgroundColor: "bg-blue-300 hover:bg-blue-400",

View file

@ -6,6 +6,7 @@ import clsx from "clsx";
type CircularIconButtonProps = {
icon: LucideIcon;
onClick: () => void;
buttonType?: ButtonType
disabled?: boolean;
className?: string;
};
@ -17,14 +18,16 @@ export default function CircularIconButton({
onClick,
icon: Icon,
className = "",
buttonType = ButtonType.PrimaryButton,
disabled = false,
...props
}: CircularIconButtonProps) {
return (
<button
className={clsx(
"flex-shrink-0 w-7 h-7 rounded-full text-white flex items-center justify-center shadow-sm",
ButtonType.PrimaryButton.backgroundColor,
"flex-shrink-0 w-7 h-7 rounded-full flex items-center justify-center shadow-sm",
buttonType.backgroundColor,
buttonType?.textColor,
className)}
onClick={onClick}
disabled={disabled}

View file

@ -50,6 +50,7 @@ export function NumberStepControl({
className)}>
<CircularIconButton
onClick={handleDecrease}
className={"text-white"}
icon={Minus}
/>
@ -64,6 +65,7 @@ export function NumberStepControl({
<CircularIconButton
onClick={handleIncrease}
className={"text-white"}
icon={Plus}
/>

View file

@ -3,6 +3,8 @@ import React, {type ReactNode, useState} from "react";
import clsx from "clsx";
import {Settings} from "lucide-react";
import {SettingsMenu} from "../SettingsMenu";
import CircularIconButton from "./CircularIconButton.tsx";
import {ButtonType} from "./BasicButtonDefinitions.ts";
/**
* Layout wrapper for the main content area of a page.
@ -28,14 +30,13 @@ export default function PageContentLayout({
className
)}
>
{/* Settings Button (top-right) */}
<button
{/* Settings Button (top-right) - Sticky with higher z-index than header */}
<CircularIconButton
onClick={() => setIsMenuOpen(true)}
className="absolute top-4 right-4 p-2 rounded-full bg-white hover:bg-gray-200 shadow transition"
title="Einstellungen"
>
<Settings size={20}/>
</button>
buttonType={ButtonType.LightButton}
className="sticky top-4 float-right w-10 h-10 z-20 mb-[-40px]"
icon={Settings}
/>
{/* Page content */}
{children}