🚨 Fix build warnings

This commit is contained in:
Manuel Ruwe
2023-01-07 20:24:15 +01:00
parent 42f55da4da
commit dc13efa27d
4 changed files with 17 additions and 14 deletions

View File

@@ -16,6 +16,10 @@ export const ChangeWidgetPositionModal = ({
const updateConfig = useConfigStore((x) => x.updateConfig);
const shapeSize = useGridstackStore((x) => x.currentShapeSize);
if (shapeSize === null) {
return null;
}
const handleSubmit = (x: number, y: number, width: number, height: number) => {
if (!configName) {
return;
@@ -59,10 +63,10 @@ export const ChangeWidgetPositionModal = ({
onCancel={handleCancel}
heightData={heightData}
widthData={widthData}
initialX={innerProps.widget.shape[shapeSize].location.x}
initialY={innerProps.widget.shape[shapeSize].location.y}
initialWidth={innerProps.widget.shape[shapeSize].size.width}
initialHeight={innerProps.widget.shape[shapeSize].size.height}
initialX={innerProps.widget.shape[shapeSize]?.location.x}
initialY={innerProps.widget.shape[shapeSize]?.location.y}
initialWidth={innerProps.widget.shape[shapeSize]?.size.width}
initialHeight={innerProps.widget.shape[shapeSize]?.size.height}
/>
);
};

View File

@@ -104,12 +104,12 @@ export const useGridstack = (
currentItem.shape[shapeSize] = {
location: {
x: changedNode.x ?? currentItem.shape[shapeSize].location.x,
y: changedNode.y ?? currentItem.shape[shapeSize].location.y,
x: changedNode.x!,
y: changedNode.y!,
},
size: {
width: changedNode.w ?? currentItem.shape[shapeSize].size.width,
height: changedNode.h ?? currentItem.shape[shapeSize].size.height,
width: changedNode.w!,
height: changedNode.h!,
},
};
@@ -170,12 +170,12 @@ export const useGridstack = (
currentItem.shape[shapeSize] = {
location: {
x: addedNode.x ?? currentItem.shape[shapeSize].location.x,
y: addedNode.y ?? currentItem.shape[shapeSize].location.y,
x: addedNode.x!,
y: addedNode.y!,
},
size: {
width: addedNode.w ?? currentItem.shape[shapeSize].size.width,
height: addedNode.h ?? currentItem.shape[shapeSize].size.height,
width: addedNode.w!,
height: addedNode.h!,
},
};

View File

@@ -1,4 +1,4 @@
import { Button, ScrollArea, Stack } from '@mantine/core';
import { ScrollArea, Stack } from '@mantine/core';
import { useViewportSize } from '@mantine/hooks';
import { useTranslation } from 'next-i18next';
import { useConfigContext } from '../../../config/provider';

View File

@@ -4,7 +4,6 @@ import { AppIntegrationType, AppType, IntegrationType } from '../../types/app';
import { AreaType } from '../../types/area';
import { CategoryType } from '../../types/category';
import { ConfigType } from '../../types/config';
import widgets from '../../widgets';
import { IBitTorrent } from '../../widgets/bitTorrent/BitTorrentTile';
import { IDashDotTile } from '../../widgets/dashDot/DashDotTile';
import { IDateWidget } from '../../widgets/date/DateTile';