mirror of
https://github.com/ajnart/homarr.git
synced 2026-01-21 15:02:29 +01:00
♻️ Improve imports and typing
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { Grid, Stack, TextInput } from '@mantine/core';
|
||||
import { Grid, TextInput } from '@mantine/core';
|
||||
import { useTranslation } from 'next-i18next';
|
||||
|
||||
import { useBoardCustomizationFormContext } from '../form';
|
||||
|
||||
@@ -5,7 +5,7 @@ import { useEffect, useRef } from 'react';
|
||||
import { IconSelector } from '~/components/IconSelector/IconSelector';
|
||||
import { appNamePositions, appNameStyles } from '~/server/db/items';
|
||||
|
||||
import { AppForm } from '../EditAppModal';
|
||||
import { type AppForm } from '../EditAppModal';
|
||||
|
||||
interface AppearanceTabProps {
|
||||
form: AppForm;
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { Group, Stack, Switch, Tabs, Text, TextInput, useMantineTheme } from '@mantine/core';
|
||||
import { Group, Stack, Switch, Tabs, Text, TextInput } from '@mantine/core';
|
||||
import { useTranslation } from 'next-i18next';
|
||||
import { InfoCard } from '~/components/InfoCard/InfoCard';
|
||||
|
||||
import { AppForm } from '../EditAppModal';
|
||||
import { type AppForm } from '../EditAppModal';
|
||||
|
||||
interface BehaviourTabProps {
|
||||
form: AppForm;
|
||||
|
||||
@@ -3,7 +3,7 @@ import { useDisclosure } from '@mantine/hooks';
|
||||
import { IconClick, IconCursorText, IconLink } from '@tabler/icons-react';
|
||||
import { useTranslation } from 'next-i18next';
|
||||
|
||||
import { AppForm } from '../EditAppModal';
|
||||
import { type AppForm } from '../EditAppModal';
|
||||
|
||||
interface GeneralTabProps {
|
||||
form: AppForm;
|
||||
|
||||
@@ -2,7 +2,7 @@ import { MultiSelect, Stack, Switch, Tabs } from '@mantine/core';
|
||||
import { useTranslation } from 'next-i18next';
|
||||
import { statusCodeData } from '~/tools/acceptableStatusCodes';
|
||||
|
||||
import { AppForm } from '../EditAppModal';
|
||||
import { type AppForm } from '../EditAppModal';
|
||||
|
||||
interface NetworkTabProps {
|
||||
form: AppForm;
|
||||
|
||||
@@ -3,7 +3,7 @@ import { z } from 'zod';
|
||||
import { api } from '~/utils/api';
|
||||
import { appFormSchema } from '~/validations/app';
|
||||
|
||||
import { AppItem, EmptySection } from '../../context';
|
||||
import { type AppItem, type EmptySection } from '../../context';
|
||||
|
||||
type CreateOrUpdateApp = {
|
||||
app: z.infer<typeof appFormSchema>;
|
||||
|
||||
@@ -23,14 +23,13 @@ import { useState } from 'react';
|
||||
import { InfoCard } from '~/components/InfoCard/InfoCard';
|
||||
import { City } from '~/server/api/routers/weather';
|
||||
import { api } from '~/utils/api';
|
||||
|
||||
import { IntegrationOptionsValueType } from '../WidgetsEditModal';
|
||||
import { ILocationOptionValue } from '~/widgets/widgets';
|
||||
|
||||
type LocationSelectionProps = {
|
||||
widgetId: string;
|
||||
propName: string;
|
||||
value: any;
|
||||
handleChange: (key: string, value: IntegrationOptionsValueType) => void;
|
||||
handleChange: (key: string, value: ILocationOptionValue['defaultValue']) => void;
|
||||
info?: boolean;
|
||||
infoLink?: string;
|
||||
};
|
||||
@@ -82,8 +81,8 @@ export const LocationSelection = ({
|
||||
setQuery(ev.currentTarget.value);
|
||||
handleChange(key, {
|
||||
name: ev.currentTarget.value,
|
||||
longitude: '',
|
||||
latitude: '',
|
||||
longitude: 0,
|
||||
latitude: 0,
|
||||
});
|
||||
}}
|
||||
/>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { GridItemHTMLElement, GridStack, GridStackNode } from 'fily-publish-gridstack';
|
||||
import { GridItemHTMLElement, GridStack } from 'fily-publish-gridstack';
|
||||
import { MutableRefObject, RefObject } from 'react';
|
||||
import { Item, Section } from '~/components/Board/context';
|
||||
import type { Section } from '~/components/Board/context';
|
||||
|
||||
type InitializeGridstackProps = {
|
||||
section: Section;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// TODO: This file can be deleted once the new gridstack is fully implemented
|
||||
import { createWithEqualityFn } from 'zustand/traditional';
|
||||
import { useConfigContext } from '~/config/provider';
|
||||
import { GridstackBreakpoints } from '~/constants/gridstack-breakpoints';
|
||||
|
||||
export const useGridstackStore = createWithEqualityFn<GridstackStoreType>(
|
||||
|
||||
@@ -115,9 +115,9 @@ export type ISliderInputOptionValue = {
|
||||
};
|
||||
|
||||
// will show a custom location selector
|
||||
type ILocationOptionValue = {
|
||||
export type ILocationOptionValue = {
|
||||
type: 'location';
|
||||
defaultValue: { latitude: number; longitude: number };
|
||||
defaultValue: { latitude: number; longitude: number; name: string };
|
||||
};
|
||||
|
||||
// will show a sortable list that can have sub settings
|
||||
|
||||
Reference in New Issue
Block a user