♻️ Improve imports and typing

This commit is contained in:
Meier Lukas
2023-11-17 18:58:44 +01:00
parent 9791a465df
commit 8cbec6aefe
10 changed files with 16 additions and 17 deletions

View File

@@ -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';

View File

@@ -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;

View File

@@ -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;

View File

@@ -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;

View File

@@ -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;

View File

@@ -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>;

View File

@@ -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,
});
}}
/>

View File

@@ -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;

View File

@@ -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>(

View File

@@ -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