refactor(base): simplify draft banner to inline Reset/Save controls

This commit is contained in:
Philipinho
2026-04-20 23:12:51 +01:00
parent ae595c51ed
commit cfb02766e2
@@ -1,5 +1,4 @@
import { Paper, Group, Text, Button } from "@mantine/core"; import { Group, Button, Tooltip } from "@mantine/core";
import { IconInfoCircle } from "@tabler/icons-react";
import { useTranslation } from "react-i18next"; import { useTranslation } from "react-i18next";
type BaseViewDraftBannerProps = { type BaseViewDraftBannerProps = {
@@ -20,25 +19,27 @@ export function BaseViewDraftBanner({
const { t } = useTranslation(); const { t } = useTranslation();
if (!isDirty) return null; if (!isDirty) return null;
return ( return (
<Paper withBorder radius="sm" px="md" py="xs" bg="yellow.0"> <Group justify="flex-end" gap="xs" px="md" py={6} wrap="nowrap">
<Group justify="space-between" wrap="nowrap"> <Button variant="subtle" color="gray" size="xs" onClick={onReset}>
<Group gap="xs" wrap="nowrap"> {t("Reset")}
<IconInfoCircle size={16} /> </Button>
<Text size="sm"> {canSave && (
{t("Filter and sort changes are visible only to you.")} <Tooltip
</Text> label={t("Filter and sort changes are visible only to you")}
</Group> position="bottom"
<Group gap="sm" wrap="nowrap"> withArrow
<Button variant="subtle" color="gray" size="xs" onClick={onReset}> >
{t("Reset")} <Button
variant="light"
color="orange"
size="xs"
onClick={onSave}
loading={saving}
>
{t("Save for everyone")}
</Button> </Button>
{canSave && ( </Tooltip>
<Button size="xs" onClick={onSave} loading={saving}> )}
{t("Save for everyone")} </Group>
</Button>
)}
</Group>
</Group>
</Paper>
); );
} }