mirror of
https://github.com/ajnart/homarr.git
synced 2025-11-11 07:55:52 +01:00
✨ Removed widgets from tile definitions
This commit is contained in:
@@ -1,7 +1,9 @@
|
||||
import { Card, Group, Title } from '@mantine/core';
|
||||
import { CategoryType } from '../../../../types/category';
|
||||
import { IWidgetDefinition } from '../../../../widgets/widgets';
|
||||
import { HomarrCardWrapper } from '../../Tiles/HomarrCardWrapper';
|
||||
import { Tiles } from '../../Tiles/tilesDefinitions';
|
||||
import Widgets from '../../../../widgets';
|
||||
import { GridstackTileWrapper } from '../../Tiles/TileWrapper';
|
||||
import { useEditModeStore } from '../../Views/useEditModeStore';
|
||||
import { useGridstack } from '../gridstack/use-gridstack';
|
||||
@@ -44,19 +46,20 @@ export const DashboardCategory = ({ category }: DashboardCategoryProps) => {
|
||||
);
|
||||
})}
|
||||
{Object.entries(integrations).map(([k, v]) => {
|
||||
const { component: TileComponent, ...tile } = Tiles[k as keyof typeof Tiles];
|
||||
const widget = Widgets[k as keyof typeof Widgets] as IWidgetDefinition | undefined;
|
||||
if (!widget) return null;
|
||||
|
||||
return (
|
||||
<GridstackTileWrapper
|
||||
id={k}
|
||||
type="module"
|
||||
key={k}
|
||||
itemRef={refs.items.current[k]}
|
||||
{...tile}
|
||||
id={widget.id}
|
||||
{...widget.gridstack}
|
||||
{...v.shape.location}
|
||||
{...v.shape.size}
|
||||
>
|
||||
<TileComponent className="grid-stack-item-content" module={v} />
|
||||
<widget.component className="grid-stack-item-content" module={v} />
|
||||
</GridstackTileWrapper>
|
||||
);
|
||||
})}
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
import { Card } from '@mantine/core';
|
||||
import { RefObject } from 'react';
|
||||
import { IWidgetDefinition } from '../../../../widgets/widgets';
|
||||
import { Tiles } from '../../Tiles/tilesDefinitions';
|
||||
import Widgets from '../../../../widgets';
|
||||
import { GridstackTileWrapper } from '../../Tiles/TileWrapper';
|
||||
import { useGridstack } from '../gridstack/use-gridstack';
|
||||
|
||||
@@ -46,19 +48,20 @@ export const DashboardSidebar = ({ location }: DashboardSidebarProps) => {
|
||||
);
|
||||
})}
|
||||
{Object.entries(integrations).map(([k, v]) => {
|
||||
const { component: TileComponent, ...tile } = Tiles[k as keyof typeof Tiles];
|
||||
const widget = Widgets[k as keyof typeof Widgets] as IWidgetDefinition | undefined;
|
||||
if (!widget) return null;
|
||||
|
||||
return (
|
||||
<GridstackTileWrapper
|
||||
id={k}
|
||||
type="module"
|
||||
key={k}
|
||||
itemRef={refs.items.current[k]}
|
||||
{...tile}
|
||||
id={widget.id}
|
||||
{...widget.gridstack}
|
||||
{...v.shape.location}
|
||||
{...v.shape.size}
|
||||
>
|
||||
<TileComponent className="grid-stack-item-content" module={v} />
|
||||
<widget.component className="grid-stack-item-content" module={v} />
|
||||
</GridstackTileWrapper>
|
||||
);
|
||||
})}
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
import { WrapperType } from '../../../../types/wrapper';
|
||||
import Widgets from '../../../../widgets';
|
||||
import { IWidget, IWidgetDefinition } from '../../../../widgets/widgets';
|
||||
import { Tiles } from '../../Tiles/tilesDefinitions';
|
||||
import { GridstackTileWrapper } from '../../Tiles/TileWrapper';
|
||||
import { useGridstack } from '../gridstack/use-gridstack';
|
||||
@@ -34,19 +36,20 @@ export const DashboardWrapper = ({ wrapper }: DashboardWrapperProps) => {
|
||||
);
|
||||
})}
|
||||
{Object.entries(integrations).map(([k, v]) => {
|
||||
const { component: TileComponent, ...tile } = Tiles[k as keyof typeof Tiles];
|
||||
const widget = Widgets[k as keyof typeof Widgets] as IWidgetDefinition | undefined;
|
||||
if (!widget) return null;
|
||||
|
||||
return (
|
||||
<GridstackTileWrapper
|
||||
id={k}
|
||||
type="module"
|
||||
key={k}
|
||||
itemRef={refs.items.current[k]}
|
||||
{...tile}
|
||||
id={widget.id}
|
||||
{...widget.gridstack}
|
||||
{...v.shape.location}
|
||||
{...v.shape.size}
|
||||
>
|
||||
<TileComponent className="grid-stack-item-content" module={v} />
|
||||
<widget.component className="grid-stack-item-content" module={v} />
|
||||
</GridstackTileWrapper>
|
||||
);
|
||||
})}
|
||||
|
||||
Reference in New Issue
Block a user