Compare commits
4
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
35649eaaa5 | ||
|
|
e31dffb42d | ||
|
|
1c089dd906 | ||
|
|
ad0d6e0498 |
No files matched your search
@@ -361,6 +361,7 @@ const LoadedBoardItemContent = ({
|
|||||||
widgetStateRef={widgetStateRef}
|
widgetStateRef={widgetStateRef}
|
||||||
widgetRuntimeRef={widgetRuntimeRef}
|
widgetRuntimeRef={widgetRuntimeRef}
|
||||||
sourceRef={sourceRef}
|
sourceRef={sourceRef}
|
||||||
|
disabled={isAdvanced}
|
||||||
>
|
>
|
||||||
<Box
|
<Box
|
||||||
ref={sourceRef}
|
ref={sourceRef}
|
||||||
|
|||||||
@@ -44,6 +44,7 @@ interface WidgetContextMenuProps {
|
|||||||
widgetStateRef: MutableRefObject<Record<string, unknown> | null>;
|
widgetStateRef: MutableRefObject<Record<string, unknown> | null>;
|
||||||
widgetRuntimeRef: WidgetRuntimeRef;
|
widgetRuntimeRef: WidgetRuntimeRef;
|
||||||
sourceRef: RefObject<HTMLElement | null>;
|
sourceRef: RefObject<HTMLElement | null>;
|
||||||
|
disabled?: boolean;
|
||||||
children: ReactNode;
|
children: ReactNode;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -53,6 +54,7 @@ export const WidgetContextMenu = ({
|
|||||||
previewDimensions,
|
previewDimensions,
|
||||||
widgetRuntimeRef,
|
widgetRuntimeRef,
|
||||||
sourceRef,
|
sourceRef,
|
||||||
|
disabled = false,
|
||||||
children,
|
children,
|
||||||
}: WidgetContextMenuProps) => {
|
}: WidgetContextMenuProps) => {
|
||||||
const { data: session } = useSession();
|
const { data: session } = useSession();
|
||||||
@@ -162,6 +164,7 @@ export const WidgetContextMenu = ({
|
|||||||
}) ?? [];
|
}) ?? [];
|
||||||
|
|
||||||
const openEditModal = useCallback(() => {
|
const openEditModal = useCallback(() => {
|
||||||
|
setMenuOpened(false);
|
||||||
openModal(
|
openModal(
|
||||||
{
|
{
|
||||||
kind: item.kind,
|
kind: item.kind,
|
||||||
@@ -230,6 +233,7 @@ export const WidgetContextMenu = ({
|
|||||||
|
|
||||||
const handleOpenAdvancedFocus = useCallback(() => {
|
const handleOpenAdvancedFocus = useCallback(() => {
|
||||||
if (!sourceRef.current) return;
|
if (!sourceRef.current) return;
|
||||||
|
setMenuOpened(false);
|
||||||
openAdvancedFocus(item.id, sourceRef.current, {
|
openAdvancedFocus(item.id, sourceRef.current, {
|
||||||
restoreFocusTarget:
|
restoreFocusTarget:
|
||||||
sourceRef.current.querySelector<HTMLElement>("[data-advanced-focus-trigger]") ?? sourceRef.current,
|
sourceRef.current.querySelector<HTMLElement>("[data-advanced-focus-trigger]") ?? sourceRef.current,
|
||||||
@@ -256,7 +260,7 @@ export const WidgetContextMenu = ({
|
|||||||
opened={menuOpened}
|
opened={menuOpened}
|
||||||
onChange={setMenuOpened}
|
onChange={setMenuOpened}
|
||||||
>
|
>
|
||||||
<Menu.ContextMenu>{children}</Menu.ContextMenu>
|
<Menu.ContextMenu disabled={disabled}>{children}</Menu.ContextMenu>
|
||||||
<WidgetContextMenuDropdown opened={menuOpened} onClose={handleCloseMenu} title={getWidgetName(item.kind, t)}>
|
<WidgetContextMenuDropdown opened={menuOpened} onClose={handleCloseMenu} title={getWidgetName(item.kind, t)}>
|
||||||
{canOpenAdvancedFocus && (
|
{canOpenAdvancedFocus && (
|
||||||
<>
|
<>
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
.header[data-desktop-visible="false"] {
|
.header[data-visible="false"] {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -73,39 +73,38 @@
|
|||||||
flex: 0 0 auto;
|
flex: 0 0 auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.userMenu {
|
||||||
|
display: flex;
|
||||||
|
padding-inline: rem(6px);
|
||||||
|
}
|
||||||
|
|
||||||
.mobileContent {
|
.mobileContent {
|
||||||
display: none;
|
display: none;
|
||||||
|
grid-template-columns: minmax(0, 1fr) auto;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: space-between;
|
|
||||||
gap: var(--mantine-spacing-xs);
|
gap: var(--mantine-spacing-xs);
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
padding-inline: var(--mantine-spacing-xs);
|
padding-inline: var(--mantine-spacing-xs);
|
||||||
}
|
}
|
||||||
|
|
||||||
.mobileIdentity,
|
.mobileZone {
|
||||||
.mobileActions {
|
|
||||||
min-width: 0;
|
min-width: 0;
|
||||||
|
overflow-x: auto;
|
||||||
|
scrollbar-width: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.mobileIdentity {
|
.mobileZone::-webkit-scrollbar {
|
||||||
flex: 1 1 auto;
|
display: none;
|
||||||
overflow: hidden;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.mobileIdentity > :last-child {
|
.mobileZone[data-zone="left"] {
|
||||||
flex: 1 1 auto;
|
justify-content: flex-start;
|
||||||
min-width: 0;
|
|
||||||
overflow: hidden;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.mobileIdentity h2 {
|
.mobileZone[data-zone="right"] {
|
||||||
overflow: hidden;
|
justify-content: flex-end;
|
||||||
text-overflow: ellipsis;
|
max-width: 72vw;
|
||||||
}
|
|
||||||
|
|
||||||
.mobileActions {
|
|
||||||
flex: 0 0 auto;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.floatingControls {
|
.floatingControls {
|
||||||
@@ -155,21 +154,12 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
@media (max-width: $mantine-breakpoint-sm) {
|
@media (max-width: $mantine-breakpoint-sm) {
|
||||||
.header[data-desktop-visible="false"] {
|
|
||||||
display: block;
|
|
||||||
}
|
|
||||||
|
|
||||||
.desktopContent {
|
.desktopContent {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.mobileContent {
|
.mobileContent {
|
||||||
display: flex;
|
display: grid;
|
||||||
}
|
|
||||||
|
|
||||||
.floatingControls,
|
|
||||||
.floatingControlsCorner {
|
|
||||||
display: none;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -3,15 +3,7 @@
|
|||||||
import type { ReactNode } from "react";
|
import type { ReactNode } from "react";
|
||||||
import { useEffect, useMemo, useRef, useState } from "react";
|
import { useEffect, useMemo, useRef, useState } from "react";
|
||||||
import { AppShellHeader, Avatar, Group, Indicator, Loader, Tooltip, useMantineColorScheme } from "@mantine/core";
|
import { AppShellHeader, Avatar, Group, Indicator, Loader, Tooltip, useMantineColorScheme } from "@mantine/core";
|
||||||
import {
|
import { IconBrandDocker, IconHome, IconReplace, IconRobot, IconSettings, IconSunMoon } from "@tabler/icons-react";
|
||||||
IconBrandDocker,
|
|
||||||
IconHome,
|
|
||||||
IconLayoutDashboard,
|
|
||||||
IconReplace,
|
|
||||||
IconRobot,
|
|
||||||
IconSettings,
|
|
||||||
IconSunMoon,
|
|
||||||
} from "@tabler/icons-react";
|
|
||||||
|
|
||||||
import type { RouterOutputs } from "@homarr/api";
|
import type { RouterOutputs } from "@homarr/api";
|
||||||
import { clientApi } from "@homarr/api/client";
|
import { clientApi } from "@homarr/api/client";
|
||||||
@@ -81,7 +73,10 @@ export const ConfigurableHeader = ({
|
|||||||
return (
|
return (
|
||||||
<BoardSwitcher>
|
<BoardSwitcher>
|
||||||
{(boardSwitcher) => {
|
{(boardSwitcher) => {
|
||||||
const renderItems = (items: HeaderItem[]) =>
|
const renderItems = (
|
||||||
|
items: HeaderItem[],
|
||||||
|
display: { search: "input" | "icon"; logo: "logo" | "logoAndText" },
|
||||||
|
) =>
|
||||||
items.map((item) => (
|
items.map((item) => (
|
||||||
<HeaderItem
|
<HeaderItem
|
||||||
key={getHeaderItemKey(item)}
|
key={getHeaderItemKey(item)}
|
||||||
@@ -95,8 +90,8 @@ export const ConfigurableHeader = ({
|
|||||||
isAdmin={isAdmin}
|
isAdmin={isAdmin}
|
||||||
isDockerEnabled={isDockerEnabled}
|
isDockerEnabled={isDockerEnabled}
|
||||||
board={item.type === "board" ? boardsById.get(item.boardId) : undefined}
|
board={item.type === "board" ? boardsById.get(item.boardId) : undefined}
|
||||||
searchDisplay={headerPreferences.searchDisplay}
|
searchDisplay={display.search}
|
||||||
logoDisplay={headerPreferences.logoDisplay}
|
logoDisplay={display.logo}
|
||||||
boardSwitcher={boardSwitcher}
|
boardSwitcher={boardSwitcher}
|
||||||
assistant={assistant}
|
assistant={assistant}
|
||||||
openDockerModal={openDockerModal}
|
openDockerModal={openDockerModal}
|
||||||
@@ -106,13 +101,19 @@ export const ConfigurableHeader = ({
|
|||||||
/>
|
/>
|
||||||
));
|
));
|
||||||
|
|
||||||
|
const desktopDisplay = {
|
||||||
|
search: headerPreferences.searchDisplay,
|
||||||
|
logo: headerPreferences.logoDisplay,
|
||||||
|
};
|
||||||
|
const mobileDisplay = { search: "icon", logo: "logo" } as const;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<AppShellHeader
|
<AppShellHeader
|
||||||
maw="100vw"
|
maw="100vw"
|
||||||
zIndex="var(--homarr-z-index-board-header)"
|
zIndex="var(--homarr-z-index-board-header)"
|
||||||
className={classes.header}
|
className={classes.header}
|
||||||
data-desktop-visible={headerPreferences.visible}
|
data-visible={headerPreferences.visible}
|
||||||
data-advanced-focus-background
|
data-advanced-focus-background
|
||||||
data-app-shell-header
|
data-app-shell-header
|
||||||
>
|
>
|
||||||
@@ -120,37 +121,26 @@ export const ConfigurableHeader = ({
|
|||||||
<div className={classes.content}>
|
<div className={classes.content}>
|
||||||
<div className={classes.zone} data-zone="left">
|
<div className={classes.zone} data-zone="left">
|
||||||
{hasNavigation ? <ClientBurger /> : null}
|
{hasNavigation ? <ClientBurger /> : null}
|
||||||
{renderItems(headerPreferences.zones.left)}
|
{renderItems(headerPreferences.zones.left, desktopDisplay)}
|
||||||
</div>
|
</div>
|
||||||
<div className={classes.zone} data-zone="center">
|
<div className={classes.zone} data-zone="center">
|
||||||
{renderItems(headerPreferences.zones.center)}
|
{renderItems(headerPreferences.zones.center, desktopDisplay)}
|
||||||
</div>
|
</div>
|
||||||
<div className={classes.zone} data-zone="right">
|
<div className={classes.zone} data-zone="right">
|
||||||
{renderItems(headerPreferences.zones.right)}
|
{renderItems(headerPreferences.zones.right, desktopDisplay)}
|
||||||
{actions ? <Group className={classes.contextActions}>{actions}</Group> : null}
|
{actions ? <Group className={classes.contextActions}>{actions}</Group> : null}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className={classes.mobileContent}>
|
<div className={classes.mobileContent}>
|
||||||
<Group className={classes.mobileIdentity} gap="xs" wrap="nowrap">
|
<Group className={classes.mobileZone} data-zone="left" gap="xs" wrap="nowrap">
|
||||||
{hasNavigation ? <ClientBurger /> : null}
|
{hasNavigation ? <ClientBurger /> : null}
|
||||||
<HeaderLogo display="logo" logo={logo} logoWithTitle={logoWithTitle} label={t("items.logo")} />
|
{renderItems(headerPreferences.zones.left, mobileDisplay)}
|
||||||
</Group>
|
</Group>
|
||||||
<Group className={classes.mobileActions} gap="xs" wrap="nowrap">
|
<Group className={classes.mobileZone} data-zone="right" gap="xs" wrap="nowrap">
|
||||||
{actions}
|
{renderItems(headerPreferences.zones.center, mobileDisplay)}
|
||||||
{boardEditAction}
|
{renderItems(headerPreferences.zones.right, mobileDisplay)}
|
||||||
{boardSettingsAction}
|
{actions ? <Group className={classes.contextActions}>{actions}</Group> : null}
|
||||||
<TourTarget id="board-search">
|
|
||||||
<MobileSearchButton alwaysVisible />
|
|
||||||
</TourTarget>
|
|
||||||
<TourTarget id="board-user-menu">
|
|
||||||
<UserButtonClient
|
|
||||||
avatar={avatar}
|
|
||||||
isAdmin={isAdmin}
|
|
||||||
isDockerEnabled={isDockerEnabled}
|
|
||||||
boardSwitcher={boardSwitcher}
|
|
||||||
/>
|
|
||||||
</TourTarget>
|
|
||||||
</Group>
|
</Group>
|
||||||
</div>
|
</div>
|
||||||
</AppShellHeader>
|
</AppShellHeader>
|
||||||
@@ -298,7 +288,9 @@ const HeaderItem = ({
|
|||||||
return (
|
return (
|
||||||
<Tooltip label={boardUnavailableLabel}>
|
<Tooltip label={boardUnavailableLabel}>
|
||||||
<HeaderButton aria-label={boardUnavailableLabel} disabled>
|
<HeaderButton aria-label={boardUnavailableLabel} disabled>
|
||||||
<IconLayoutDashboard size={20} stroke={1.5} />
|
<Avatar size={22} radius="sm">
|
||||||
|
?
|
||||||
|
</Avatar>
|
||||||
</HeaderButton>
|
</HeaderButton>
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
);
|
);
|
||||||
@@ -416,14 +408,19 @@ const HeaderItem = ({
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<TourTarget id="board-user-menu">
|
<TourTarget id="board-user-menu">
|
||||||
<UserButtonClient
|
<div className={classes.userMenu}>
|
||||||
avatar={avatar}
|
<UserButtonClient
|
||||||
isAdmin={isAdmin}
|
avatar={avatar}
|
||||||
isDockerEnabled={isDockerEnabled}
|
isAdmin={isAdmin}
|
||||||
boardSwitcher={boardSwitcher}
|
isDockerEnabled={isDockerEnabled}
|
||||||
/>
|
boardSwitcher={boardSwitcher}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
</TourTarget>
|
</TourTarget>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
const getBoardInitial = (name: string) => Array.from(name.trim())[0]?.toLocaleUpperCase() ?? "?";
|
const getBoardInitial = (name: string) => {
|
||||||
|
const firstCharacter = Array.from(name.trim())[0] ?? "?";
|
||||||
|
return Array.from(firstCharacter.toUpperCase())[0] ?? "?";
|
||||||
|
};
|
||||||
@@ -22,7 +22,7 @@ export const ClientShell = ({
|
|||||||
const collapsed = useAtomValue(navigationCollapsedAtom);
|
const collapsed = useAtomValue(navigationCollapsedAtom);
|
||||||
const backgroundProps = useOptionalBackgroundProps();
|
const backgroundProps = useOptionalBackgroundProps();
|
||||||
const { headerPreferences } = useSettings();
|
const { headerPreferences } = useSettings();
|
||||||
const headerHeight = headerPreferences.visible ? appShellHeaderHeight : { base: appShellHeaderHeight, sm: 0 };
|
const headerHeight = headerPreferences.visible ? appShellHeaderHeight : 0;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<AppShell
|
<AppShell
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import { Badge, Indicator, Kbd, Loader, Menu, Text } from "@mantine/core";
|
|||||||
import {
|
import {
|
||||||
IconBrandDocker,
|
IconBrandDocker,
|
||||||
IconHome,
|
IconHome,
|
||||||
|
IconLayoutDashboard,
|
||||||
IconLogin,
|
IconLogin,
|
||||||
IconLogout,
|
IconLogout,
|
||||||
IconReplace,
|
IconReplace,
|
||||||
@@ -16,6 +17,8 @@ import {
|
|||||||
|
|
||||||
import type { RouterOutputs } from "@homarr/api";
|
import type { RouterOutputs } from "@homarr/api";
|
||||||
import { signOut, useSession } from "@homarr/auth/client";
|
import { signOut, useSession } from "@homarr/auth/client";
|
||||||
|
import { constructBoardPermissions } from "@homarr/auth/shared";
|
||||||
|
import { useOptionalBoard } from "@homarr/boards/context";
|
||||||
import { hotkeys, invariantTechnicalLabels } from "@homarr/definitions";
|
import { hotkeys, invariantTechnicalLabels } from "@homarr/definitions";
|
||||||
import { useModalAction } from "@homarr/modals";
|
import { useModalAction } from "@homarr/modals";
|
||||||
import { useI18n } from "@homarr/translation/client";
|
import { useI18n } from "@homarr/translation/client";
|
||||||
@@ -46,6 +49,8 @@ export const UserAvatarMenu = ({ children, availableUpdates, isDockerEnabled, bo
|
|||||||
const t = useI18n("common.userAvatar.menu");
|
const t = useI18n("common.userAvatar.menu");
|
||||||
const tBoard = useI18n("board");
|
const tBoard = useI18n("board");
|
||||||
const session = useSession();
|
const session = useSession();
|
||||||
|
const board = useOptionalBoard();
|
||||||
|
const boardPermissions = board && constructBoardPermissions(board, session.data ?? null);
|
||||||
|
|
||||||
const { logoutUrl } = useAuthContext();
|
const { logoutUrl } = useAuthContext();
|
||||||
const { openModal: openDockerModal } = useModalAction(DockerQuickAccessModal);
|
const { openModal: openDockerModal } = useModalAction(DockerQuickAccessModal);
|
||||||
@@ -67,6 +72,15 @@ export const UserAvatarMenu = ({ children, availableUpdates, isDockerEnabled, bo
|
|||||||
<Menu.Item component={Link} href="/boards" leftSection={<IconHome size="1rem" />}>
|
<Menu.Item component={Link} href="/boards" leftSection={<IconHome size="1rem" />}>
|
||||||
{t("homeBoard")}
|
{t("homeBoard")}
|
||||||
</Menu.Item>
|
</Menu.Item>
|
||||||
|
{board && boardPermissions?.hasChangeAccess && (
|
||||||
|
<Menu.Item
|
||||||
|
component={Link}
|
||||||
|
href={`/boards/${encodeURIComponent(board.name)}/settings`}
|
||||||
|
leftSection={<IconLayoutDashboard size="1rem" />}
|
||||||
|
>
|
||||||
|
{tBoard("action.settings")}
|
||||||
|
</Menu.Item>
|
||||||
|
)}
|
||||||
<Menu.Item
|
<Menu.Item
|
||||||
leftSection={<IconReplace size="1rem" />}
|
leftSection={<IconReplace size="1rem" />}
|
||||||
rightSection={<Kbd size="xs">{formatHotkeyLabel(boardSwitcher.hotkey, t("modifier"))}</Kbd>}
|
rightSection={<Kbd size="xs">{formatHotkeyLabel(boardSwitcher.hotkey, t("modifier"))}</Kbd>}
|
||||||
|
|||||||
@@ -49,8 +49,7 @@ export const BoardCreateForm = ({ onCancel }: BoardCreateFormProps) => {
|
|||||||
message: tBoard("action.create.notification.success.message", { name: values.name }),
|
message: tBoard("action.create.notification.success.message", { name: values.name }),
|
||||||
});
|
});
|
||||||
const name = encodeURIComponent(result.name);
|
const name = encodeURIComponent(result.name);
|
||||||
const layoutId = encodeURIComponent(result.layoutId);
|
router.push(`/boards/${name}`);
|
||||||
router.push(`/boards/${name}?layout=${layoutId}&edit=true&add=true`);
|
|
||||||
},
|
},
|
||||||
onError() {
|
onError() {
|
||||||
showErrorNotification({
|
showErrorNotification({
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import { useI18n } from "@homarr/translation/client";
|
|||||||
|
|
||||||
interface ModalFormFooterProps {
|
interface ModalFormFooterProps {
|
||||||
onCancel: () => void;
|
onCancel: () => void;
|
||||||
|
form?: string;
|
||||||
submitLabel?: string;
|
submitLabel?: string;
|
||||||
cancelLabel?: string;
|
cancelLabel?: string;
|
||||||
loading?: boolean;
|
loading?: boolean;
|
||||||
@@ -18,24 +19,38 @@ const ActionButtons = ({
|
|||||||
submitLabel,
|
submitLabel,
|
||||||
cancelLabel,
|
cancelLabel,
|
||||||
loading,
|
loading,
|
||||||
}: Pick<ModalFormFooterProps, "onCancel" | "submitLabel" | "cancelLabel" | "loading">) => {
|
form,
|
||||||
const t = useI18n();
|
}: Pick<ModalFormFooterProps, "onCancel" | "submitLabel" | "cancelLabel" | "loading" | "form">) => {
|
||||||
|
const t = useI18n("common.action");
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Button onClick={onCancel} variant="subtle" color="gray">
|
<Button onClick={onCancel} variant="subtle" color="gray">
|
||||||
{cancelLabel ?? t("common.action.cancel")}
|
{cancelLabel ?? t("cancel")}
|
||||||
</Button>
|
</Button>
|
||||||
<Button type="submit" loading={loading}>
|
<Button type="submit" form={form} loading={loading}>
|
||||||
{submitLabel ?? t("common.action.saveChanges")}
|
{submitLabel ?? t("saveChanges")}
|
||||||
</Button>
|
</Button>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
export const ModalFormFooter = ({ onCancel, submitLabel, cancelLabel, loading, leftSection }: ModalFormFooterProps) => {
|
export const ModalFormFooter = ({
|
||||||
|
onCancel,
|
||||||
|
form,
|
||||||
|
submitLabel,
|
||||||
|
cancelLabel,
|
||||||
|
loading,
|
||||||
|
leftSection,
|
||||||
|
}: ModalFormFooterProps) => {
|
||||||
const actionButtons = (
|
const actionButtons = (
|
||||||
<ActionButtons onCancel={onCancel} submitLabel={submitLabel} cancelLabel={cancelLabel} loading={loading} />
|
<ActionButtons
|
||||||
|
onCancel={onCancel}
|
||||||
|
form={form}
|
||||||
|
submitLabel={submitLabel}
|
||||||
|
cancelLabel={cancelLabel}
|
||||||
|
loading={loading}
|
||||||
|
/>
|
||||||
);
|
);
|
||||||
|
|
||||||
if (leftSection) {
|
if (leftSection) {
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ export const headerBuiltinItemIds = [
|
|||||||
"user",
|
"user",
|
||||||
] as const;
|
] as const;
|
||||||
|
|
||||||
export const requiredHeaderBuiltinItemIds = ["boardEdit", "boardSettings", "user"] as const;
|
export const requiredHeaderBuiltinItemIds = ["user"] as const;
|
||||||
|
|
||||||
export const headerPreferenceItemIds = headerBuiltinItemIds;
|
export const headerPreferenceItemIds = headerBuiltinItemIds;
|
||||||
export const headerItemIds = headerBuiltinItemIds;
|
export const headerItemIds = headerBuiltinItemIds;
|
||||||
|
|||||||
@@ -143,6 +143,7 @@
|
|||||||
margin-inline: calc(var(--mantine-spacing-md) * -1);
|
margin-inline: calc(var(--mantine-spacing-md) * -1);
|
||||||
margin-bottom: calc(var(--mantine-spacing-md) * -1);
|
margin-bottom: calc(var(--mantine-spacing-md) * -1);
|
||||||
padding: var(--mantine-spacing-sm) var(--mantine-spacing-md);
|
padding: var(--mantine-spacing-sm) var(--mantine-spacing-md);
|
||||||
|
padding-bottom: max(var(--mantine-spacing-sm), env(safe-area-inset-bottom));
|
||||||
border-top: 1px solid var(--mantine-color-default-border);
|
border-top: 1px solid var(--mantine-color-default-border);
|
||||||
background: color-mix(in srgb, var(--mantine-color-body) 94%, transparent);
|
background: color-mix(in srgb, var(--mantine-color-body) 94%, transparent);
|
||||||
backdrop-filter: blur(10px);
|
backdrop-filter: blur(10px);
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ import { objectEntries } from "@homarr/common";
|
|||||||
import { IntegrationProvider, useSession } from "@homarr/auth/client";
|
import { IntegrationProvider, useSession } from "@homarr/auth/client";
|
||||||
import { useOptionalBoard } from "@homarr/boards/context";
|
import { useOptionalBoard } from "@homarr/boards/context";
|
||||||
import type { WidgetKind } from "@homarr/definitions";
|
import type { WidgetKind } from "@homarr/definitions";
|
||||||
import { createModal, modalSizeForm } from "@homarr/modals";
|
import { createModal, ModalFormFooter, modalSizeForm } from "@homarr/modals";
|
||||||
import type { SettingsContextProps } from "@homarr/settings/creator";
|
import type { SettingsContextProps } from "@homarr/settings/creator";
|
||||||
import { SpotlightProvider } from "@homarr/spotlight";
|
import { SpotlightProvider } from "@homarr/spotlight";
|
||||||
import { useI18n } from "@homarr/translation/client";
|
import { useI18n } from "@homarr/translation/client";
|
||||||
@@ -674,16 +674,7 @@ export const WidgetEditModal = createModal<WidgetEditModalProps<WidgetKind>>(({
|
|||||||
|
|
||||||
const footer = (
|
const footer = (
|
||||||
<Box className={classes.footer}>
|
<Box className={classes.footer}>
|
||||||
<Group justify="end" wrap="nowrap">
|
<ModalFormFooter onCancel={actions.closeModal} form={widgetFormId} loading={isSubmitting} />
|
||||||
<Group gap="xs" wrap="nowrap">
|
|
||||||
<Button onClick={actions.closeModal} variant="subtle" color="gray">
|
|
||||||
{tCommon("action.cancel")}
|
|
||||||
</Button>
|
|
||||||
<Button type="submit" form={widgetFormId} loading={isSubmitting}>
|
|
||||||
{tCommon("action.saveChanges")}
|
|
||||||
</Button>
|
|
||||||
</Group>
|
|
||||||
</Group>
|
|
||||||
</Box>
|
</Box>
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user