diff --git a/src/renderer/features/servers/components/edit-server-form.tsx b/src/renderer/features/servers/components/edit-server-form.tsx index c10b08d3..ef6d9354 100644 --- a/src/renderer/features/servers/components/edit-server-form.tsx +++ b/src/renderer/features/servers/components/edit-server-form.tsx @@ -1,7 +1,8 @@ import { useState } from 'react'; import { Checkbox, Stack, Group } from '@mantine/core'; -import { Button, PasswordInput, TextInput, toast } from '/@/renderer/components'; +import { Button, PasswordInput, TextInput, toast, Tooltip } from '/@/renderer/components'; import { useForm } from '@mantine/form'; +import { useFocusTrap } from '@mantine/hooks'; import { closeAllModals } from '@mantine/modals'; import { RiInformationLine } from 'react-icons/ri'; import { jellyfinApi } from '/@/renderer/api/jellyfin.api'; @@ -23,8 +24,19 @@ const AUTH_FUNCTIONS = { [ServerType.SUBSONIC]: subsonicApi.authenticate, }; +const ModifiedFieldIndicator = () => { + return ( + + + + + + ); +}; + export const EditServerForm = ({ isUpdate, server, onCancel }: EditServerFormProps) => { const { updateServer } = useAuthStoreActions(); + const focusTrapRef = useFocusTrap(); const [isLoading, setIsLoading] = useState(false); const form = useForm({ @@ -40,9 +52,6 @@ export const EditServerForm = ({ isUpdate, server, onCancel }: EditServerFormPro const isSubsonic = form.values.type === ServerType.SUBSONIC; - const isSubmitDisabled = - !form.values.name || !form.values.url || !form.values.username || !form.values.password; - const handleSubmit = form.onSubmit(async (values) => { const authFunction = AUTH_FUNCTIONS[values.type]; @@ -81,25 +90,28 @@ export const EditServerForm = ({ isUpdate, server, onCancel }: EditServerFormPro return (
- + } + rightSection={form.isDirty('name') && } {...form.getInputProps('name')} /> } + rightSection={form.isDirty('url') && } {...form.getInputProps('url')} /> } + rightSection={form.isDirty('username') && } {...form.getInputProps('username')} /> @@ -119,7 +131,6 @@ export const EditServerForm = ({ isUpdate, server, onCancel }: EditServerFormPro Cancel