mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-25 08:59:13 +00:00
refactor: small code cleanups
- remove compiler directives
This commit is contained in:
committed by
Carlos Valente
parent
8a7f8c8ebc
commit
9ab54edbf5
@@ -31,7 +31,6 @@ export default function TriggerForm({
|
|||||||
onCancel,
|
onCancel,
|
||||||
postSubmit,
|
postSubmit,
|
||||||
}: TriggerFormProps) {
|
}: TriggerFormProps) {
|
||||||
'use no memo'; // RHF and react-compiler don't seem to get along
|
|
||||||
const {
|
const {
|
||||||
handleSubmit,
|
handleSubmit,
|
||||||
register,
|
register,
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
'use no memo'; // RHF and react-compiler don't seem to get along
|
|
||||||
|
|
||||||
import { useState } from 'react';
|
import { useState } from 'react';
|
||||||
import { useForm } from 'react-hook-form';
|
import { useForm } from 'react-hook-form';
|
||||||
import QRCode from 'react-qr-code';
|
import QRCode from 'react-qr-code';
|
||||||
@@ -34,7 +32,6 @@ interface GenerateLinkFormOptions {
|
|||||||
type GenerateLinkState = 'pending' | 'loading' | 'success' | 'error';
|
type GenerateLinkState = 'pending' | 'loading' | 'success' | 'error';
|
||||||
|
|
||||||
export default function GenerateLinkForm({ hostOptions, pathOptions, isLockedToView }: GenerateLinkFormProps) {
|
export default function GenerateLinkForm({ hostOptions, pathOptions, isLockedToView }: GenerateLinkFormProps) {
|
||||||
'use no memo'; // RHF and react-compiler don't seem to get along
|
|
||||||
const [formState, setFormState] = useState<GenerateLinkState>('pending');
|
const [formState, setFormState] = useState<GenerateLinkState>('pending');
|
||||||
const [url, setUrl] = useState(serverURL);
|
const [url, setUrl] = useState(serverURL);
|
||||||
|
|
||||||
|
|||||||
@@ -32,7 +32,6 @@ export default function CustomFieldForm({
|
|||||||
initialLabel,
|
initialLabel,
|
||||||
initialKey,
|
initialKey,
|
||||||
}: CustomFieldsFormProps) {
|
}: CustomFieldsFormProps) {
|
||||||
'use no memo'; // RHF and react-compiler don't seem to get along
|
|
||||||
const { data } = useCustomFields();
|
const { data } = useCustomFields();
|
||||||
|
|
||||||
// we use this to force an update
|
// we use this to force an update
|
||||||
|
|||||||
-1
@@ -31,7 +31,6 @@ export default function ImportMapForm({
|
|||||||
onSubmitExport,
|
onSubmitExport,
|
||||||
onSubmitImport,
|
onSubmitImport,
|
||||||
}: ImportMapFormProps) {
|
}: ImportMapFormProps) {
|
||||||
'use no memo'; // RHF and react-compiler don't seem to get along
|
|
||||||
const namedImportMap = getPersistedOptions();
|
const namedImportMap = getPersistedOptions();
|
||||||
const { revoke } = useGoogleSheet();
|
const { revoke } = useGoogleSheet();
|
||||||
const {
|
const {
|
||||||
|
|||||||
@@ -23,7 +23,6 @@ type ProjectCreateFormValues = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export default function ProjectCreateForm({ onClose }: ProjectCreateFromProps) {
|
export default function ProjectCreateForm({ onClose }: ProjectCreateFromProps) {
|
||||||
'use no memo'; // RHF and react-compiler don't seem to get along
|
|
||||||
const [error, setError] = useState<string | null>(null);
|
const [error, setError] = useState<string | null>(null);
|
||||||
|
|
||||||
const {
|
const {
|
||||||
|
|||||||
@@ -20,7 +20,6 @@ interface ProjectFormProps {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export default function ProjectForm({ action, filename, onSubmit, onCancel }: ProjectFormProps) {
|
export default function ProjectForm({ action, filename, onSubmit, onCancel }: ProjectFormProps) {
|
||||||
'use no memo'; // RHF and react-compiler don't seem to get along
|
|
||||||
const {
|
const {
|
||||||
handleSubmit,
|
handleSubmit,
|
||||||
register,
|
register,
|
||||||
|
|||||||
@@ -28,7 +28,6 @@ type ProjectMergeFormValues = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export default function ProjectMergeForm({ onClose, fileName }: ProjectMergeFromProps) {
|
export default function ProjectMergeForm({ onClose, fileName }: ProjectMergeFromProps) {
|
||||||
'use no memo'; // RHF and react-compiler don't seem to get along
|
|
||||||
const [error, setError] = useState<string | null>(null);
|
const [error, setError] = useState<string | null>(null);
|
||||||
const queryClient = useQueryClient();
|
const queryClient = useQueryClient();
|
||||||
|
|
||||||
|
|||||||
@@ -16,7 +16,6 @@ import * as Panel from '../../panel-utils/PanelUtils';
|
|||||||
import GeneralPinInput from './composite/GeneralPinInput';
|
import GeneralPinInput from './composite/GeneralPinInput';
|
||||||
|
|
||||||
export default function GeneralSettings() {
|
export default function GeneralSettings() {
|
||||||
'use no memo'; // RHF and react-compiler don't seem to get along
|
|
||||||
const { data, status, refetch } = useSettings();
|
const { data, status, refetch } = useSettings();
|
||||||
const {
|
const {
|
||||||
handleSubmit,
|
handleSubmit,
|
||||||
|
|||||||
@@ -18,7 +18,6 @@ import * as Panel from '../../panel-utils/PanelUtils';
|
|||||||
import style from './SettingsPanel.module.scss';
|
import style from './SettingsPanel.module.scss';
|
||||||
|
|
||||||
export default function ProjectData() {
|
export default function ProjectData() {
|
||||||
'use no memo'; // RHF and react-compiler don't seem to get along
|
|
||||||
const { data, status } = useProjectData();
|
const { data, status } = useProjectData();
|
||||||
const { updateProjectData } = useUpdateProjectData();
|
const { updateProjectData } = useUpdateProjectData();
|
||||||
|
|
||||||
|
|||||||
@@ -18,7 +18,6 @@ import CodeEditorModal from './composite/StyleEditorModal';
|
|||||||
const cssOverrideDocsUrl = 'https://docs.getontime.no/features/custom-styling/';
|
const cssOverrideDocsUrl = 'https://docs.getontime.no/features/custom-styling/';
|
||||||
|
|
||||||
export default function ViewSettings() {
|
export default function ViewSettings() {
|
||||||
'use no memo'; // RHF and react-compiler don't seem to get along
|
|
||||||
const { data, isPending, mutateAsync } = useViewSettings();
|
const { data, isPending, mutateAsync } = useViewSettings();
|
||||||
const [isCodeEditorOpen, codeEditorHandler] = useDisclosure();
|
const [isCodeEditorOpen, codeEditorHandler] = useDisclosure();
|
||||||
|
|
||||||
|
|||||||
@@ -20,7 +20,6 @@ interface QuickStartProps {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export default function QuickStart({ isOpen, onClose }: QuickStartProps) {
|
export default function QuickStart({ isOpen, onClose }: QuickStartProps) {
|
||||||
'use no memo'; // RHF and react-compiler don't seem to get along
|
|
||||||
const { defaultWarnTime, defaultDangerTime, setDangerTime, setWarnTime } = useEditorSettings();
|
const { defaultWarnTime, defaultDangerTime, setDangerTime, setWarnTime } = useEditorSettings();
|
||||||
|
|
||||||
const {
|
const {
|
||||||
|
|||||||
Reference in New Issue
Block a user