Trying to fix linting errors

This commit is contained in:
ajnart
2022-12-22 11:45:48 +09:00
parent e982515bb5
commit 93fc011879
10 changed files with 7 additions and 327 deletions

View File

@@ -33,8 +33,9 @@ export const WidgetElementType = ({ id, image, disabled, widget }: WidgetElement
{
id: widget.id,
properties: Object.entries(widget.options).reduce((prev, [k, v]) => {
prev[k] = v.defaultValue;
return prev;
const newPrev = prev;
newPrev[k] = v.defaultValue;
return newPrev;
}, {} as IWidget<string, any>['properties']),
area: {
type: 'wrapper',

View File

@@ -1,6 +1,5 @@
interface ServiceIconProps {
size: '100%' | number;
service: string;
}
export const AppIcon = ({ size }: ServiceIconProps) => null;

View File

@@ -22,7 +22,8 @@ export const initializeGridstack = (
const columnCount = areaType === 'sidebar' ? 4 : Math.floor(wrapperRef.current.offsetWidth / 64);
const minRow = areaType !== 'sidebar' ? 1 : Math.floor(wrapperRef.current.offsetHeight / 64);
// initialize gridstack
gridRef.current = GridStack.init(
const newGrid = gridRef;
newGrid.current = GridStack.init(
{
column: columnCount,
margin: 10,
@@ -37,7 +38,7 @@ export const initializeGridstack = (
// selector of the gridstack item (it's eather category or wrapper)
`.grid-stack-${areaType}[data-${areaType}='${areaId}']`
);
const grid = gridRef.current;
const grid = newGrid.current;
// Add listener for moving items around in a wrapper
grid.on('change', (_, el) => {