mirror of
https://github.com/lordmathis/lemma.git
synced 2025-11-05 23:44:22 +00:00
Fix various eslint issues
This commit is contained in:
@@ -17,14 +17,16 @@ const LoginPage: React.FC = () => {
|
|||||||
const [loading, setLoading] = useState<boolean>(false);
|
const [loading, setLoading] = useState<boolean>(false);
|
||||||
const { login } = useAuth();
|
const { login } = useAuth();
|
||||||
|
|
||||||
const handleSubmit = async (e: FormEvent<HTMLElement>): Promise<void> => {
|
const handleSubmit = (e: FormEvent<HTMLElement>): void => {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
setLoading(true);
|
setLoading(true);
|
||||||
try {
|
login(email, password)
|
||||||
await login(email, password);
|
.catch((error) => {
|
||||||
} finally {
|
console.error('Login failed:', error);
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
setLoading(false);
|
setLoading(false);
|
||||||
}
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import FileActions from '../files/FileActions';
|
|||||||
import FileTree from '../files/FileTree';
|
import FileTree from '../files/FileTree';
|
||||||
import { useGitOperations } from '../../hooks/useGitOperations';
|
import { useGitOperations } from '../../hooks/useGitOperations';
|
||||||
import { useWorkspace } from '../../contexts/WorkspaceContext';
|
import { useWorkspace } from '../../contexts/WorkspaceContext';
|
||||||
import type { FileNode } from '@/types/fileApi';
|
import type { FileNode } from '@/types/models';
|
||||||
|
|
||||||
interface SidebarProps {
|
interface SidebarProps {
|
||||||
selectedFile: string | null;
|
selectedFile: string | null;
|
||||||
@@ -23,7 +23,7 @@ const Sidebar: React.FC<SidebarProps> = ({
|
|||||||
const { handlePull } = useGitOperations();
|
const { handlePull } = useGitOperations();
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
loadFileList();
|
void loadFileList();
|
||||||
}, [loadFileList]);
|
}, [loadFileList]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ const DeleteAccountModal: React.FC<DeleteAccountModalProps> = ({
|
|||||||
<Button
|
<Button
|
||||||
color="red"
|
color="red"
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
onConfirm(password);
|
void onConfirm(password);
|
||||||
setPassword('');
|
setPassword('');
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ const EmailPasswordModal: React.FC<EmailPasswordModalProps> = ({
|
|||||||
</Button>
|
</Button>
|
||||||
<Button
|
<Button
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
onConfirm(password);
|
void onConfirm(password);
|
||||||
setPassword('');
|
setPassword('');
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ const CreateFileModal: React.FC<CreateFileModalProps> = ({ onCreateFile }) => {
|
|||||||
>
|
>
|
||||||
Cancel
|
Cancel
|
||||||
</Button>
|
</Button>
|
||||||
<Button onClick={handleSubmit}>Create</Button>
|
<Button onClick={() => void handleSubmit()}>Create</Button>
|
||||||
</Group>
|
</Group>
|
||||||
</Box>
|
</Box>
|
||||||
</Modal>
|
</Modal>
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ const DeleteFileModal: React.FC<DeleteFileModalProps> = ({
|
|||||||
title="Delete File"
|
title="Delete File"
|
||||||
centered
|
centered
|
||||||
>
|
>
|
||||||
<Text>Are you sure you want to delete "{selectedFile}"?</Text>
|
<Text>Are you sure you want to delete "{selectedFile}"?</Text>
|
||||||
<Group justify="flex-end" mt="xl">
|
<Group justify="flex-end" mt="xl">
|
||||||
<Button
|
<Button
|
||||||
variant="default"
|
variant="default"
|
||||||
@@ -36,7 +36,7 @@ const DeleteFileModal: React.FC<DeleteFileModalProps> = ({
|
|||||||
>
|
>
|
||||||
Cancel
|
Cancel
|
||||||
</Button>
|
</Button>
|
||||||
<Button color="red" onClick={handleConfirm}>
|
<Button color="red" onClick={() => void handleConfirm()}>
|
||||||
Delete
|
Delete
|
||||||
</Button>
|
</Button>
|
||||||
</Group>
|
</Group>
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ const CommitMessageModal: React.FC<CommitMessageModalProps> = ({
|
|||||||
>
|
>
|
||||||
Cancel
|
Cancel
|
||||||
</Button>
|
</Button>
|
||||||
<Button onClick={handleSubmit}>Commit</Button>
|
<Button onClick={() => void handleSubmit()}>Commit</Button>
|
||||||
</Group>
|
</Group>
|
||||||
</Box>
|
</Box>
|
||||||
</Modal>
|
</Modal>
|
||||||
|
|||||||
@@ -8,8 +8,8 @@ import {
|
|||||||
Button,
|
Button,
|
||||||
Group,
|
Group,
|
||||||
} from '@mantine/core';
|
} from '@mantine/core';
|
||||||
import type { CreateUserRequest } from '@/types/adminApi';
|
import type { CreateUserRequest } from '@/types/api';
|
||||||
import { UserRole } from '@/types/authApi';
|
import { UserRole } from '@/types/models';
|
||||||
|
|
||||||
interface CreateUserModalProps {
|
interface CreateUserModalProps {
|
||||||
opened: boolean;
|
opened: boolean;
|
||||||
@@ -85,7 +85,7 @@ const CreateUserModal: React.FC<CreateUserModalProps> = ({
|
|||||||
<Button variant="default" onClick={onClose}>
|
<Button variant="default" onClick={onClose}>
|
||||||
Cancel
|
Cancel
|
||||||
</Button>
|
</Button>
|
||||||
<Button onClick={handleSubmit} loading={loading}>
|
<Button onClick={() => void handleSubmit} loading={loading}>
|
||||||
Create User
|
Create User
|
||||||
</Button>
|
</Button>
|
||||||
</Group>
|
</Group>
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { Modal, Text, Button, Group, Stack } from '@mantine/core';
|
import { Modal, Text, Button, Group, Stack } from '@mantine/core';
|
||||||
import type { User } from '@/types/authApi';
|
import type { User } from '@/types/models';
|
||||||
|
|
||||||
interface DeleteUserModalProps {
|
interface DeleteUserModalProps {
|
||||||
opened: boolean;
|
opened: boolean;
|
||||||
@@ -26,14 +26,15 @@ const DeleteUserModal: React.FC<DeleteUserModalProps> = ({
|
|||||||
>
|
>
|
||||||
<Stack>
|
<Stack>
|
||||||
<Text>
|
<Text>
|
||||||
Are you sure you want to delete user "{user?.email}"? This action cannot
|
Are you sure you want to delete user "{user?.email}"? This
|
||||||
be undone and all associated data will be permanently deleted.
|
action cannot be undone and all associated data will be permanently
|
||||||
|
deleted.
|
||||||
</Text>
|
</Text>
|
||||||
<Group justify="flex-end" mt="xl">
|
<Group justify="flex-end" mt="xl">
|
||||||
<Button variant="default" onClick={onClose}>
|
<Button variant="default" onClick={onClose}>
|
||||||
Cancel
|
Cancel
|
||||||
</Button>
|
</Button>
|
||||||
<Button color="red" onClick={onConfirm} loading={loading}>
|
<Button color="red" onClick={() => void onConfirm()} loading={loading}>
|
||||||
Delete User
|
Delete User
|
||||||
</Button>
|
</Button>
|
||||||
</Group>
|
</Group>
|
||||||
|
|||||||
@@ -9,9 +9,8 @@ import {
|
|||||||
PasswordInput,
|
PasswordInput,
|
||||||
Text,
|
Text,
|
||||||
} from '@mantine/core';
|
} from '@mantine/core';
|
||||||
import type { UpdateUserRequest } from '@/types/adminApi';
|
import type { UpdateUserRequest } from '@/types/api';
|
||||||
import type { User} from '@/types/authApi';
|
import { type User, UserRole } from '@/types/models';
|
||||||
import { UserRole } from '@/types/authApi';
|
|
||||||
|
|
||||||
interface EditUserModalProps {
|
interface EditUserModalProps {
|
||||||
opened: boolean;
|
opened: boolean;
|
||||||
@@ -114,7 +113,7 @@ const EditUserModal: React.FC<EditUserModalProps> = ({
|
|||||||
<Button variant="default" onClick={onClose}>
|
<Button variant="default" onClick={onClose}>
|
||||||
Cancel
|
Cancel
|
||||||
</Button>
|
</Button>
|
||||||
<Button onClick={handleSubmit} loading={loading}>
|
<Button onClick={() => void handleSubmit} loading={loading}>
|
||||||
Save Changes
|
Save Changes
|
||||||
</Button>
|
</Button>
|
||||||
</Group>
|
</Group>
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import React, { useState } from 'react';
|
|||||||
import { Modal, TextInput, Button, Group, Box } from '@mantine/core';
|
import { Modal, TextInput, Button, Group, Box } from '@mantine/core';
|
||||||
import { useModalContext } from '../../../contexts/ModalContext';
|
import { useModalContext } from '../../../contexts/ModalContext';
|
||||||
import { notifications } from '@mantine/notifications';
|
import { notifications } from '@mantine/notifications';
|
||||||
import type { Workspace } from '@/types/workspace';
|
import type { Workspace } from '@/types/models';
|
||||||
import { createWorkspace } from '@/api/workspace';
|
import { createWorkspace } from '@/api/workspace';
|
||||||
|
|
||||||
interface CreateWorkspaceModalProps {
|
interface CreateWorkspaceModalProps {
|
||||||
@@ -38,9 +38,9 @@ const CreateWorkspaceModal: React.FC<CreateWorkspaceModalProps> = ({
|
|||||||
setName('');
|
setName('');
|
||||||
setCreateWorkspaceModalVisible(false);
|
setCreateWorkspaceModalVisible(false);
|
||||||
if (onWorkspaceCreated) {
|
if (onWorkspaceCreated) {
|
||||||
onWorkspaceCreated(workspace);
|
await onWorkspaceCreated(workspace);
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (_error) {
|
||||||
notifications.show({
|
notifications.show({
|
||||||
title: 'Error',
|
title: 'Error',
|
||||||
message: 'Failed to create workspace',
|
message: 'Failed to create workspace',
|
||||||
@@ -77,7 +77,7 @@ const CreateWorkspaceModal: React.FC<CreateWorkspaceModalProps> = ({
|
|||||||
>
|
>
|
||||||
Cancel
|
Cancel
|
||||||
</Button>
|
</Button>
|
||||||
<Button onClick={handleSubmit} loading={loading}>
|
<Button onClick={() => void handleSubmit} loading={loading}>
|
||||||
Create
|
Create
|
||||||
</Button>
|
</Button>
|
||||||
</Group>
|
</Group>
|
||||||
|
|||||||
@@ -23,15 +23,15 @@ const DeleteWorkspaceModal: React.FC<DeleteUserModalProps> = ({
|
|||||||
>
|
>
|
||||||
<Stack>
|
<Stack>
|
||||||
<Text>
|
<Text>
|
||||||
Are you sure you want to delete workspace "{workspaceName}"? This action
|
Are you sure you want to delete workspace "{workspaceName}"?
|
||||||
cannot be undone and all files in this workspace will be permanently
|
This action cannot be undone and all files in this workspace will be
|
||||||
deleted.
|
permanently deleted.
|
||||||
</Text>
|
</Text>
|
||||||
<Group justify="flex-end" mt="xl">
|
<Group justify="flex-end" mt="xl">
|
||||||
<Button variant="default" onClick={onClose}>
|
<Button variant="default" onClick={onClose}>
|
||||||
Cancel
|
Cancel
|
||||||
</Button>
|
</Button>
|
||||||
<Button color="red" onClick={onConfirm}>
|
<Button color="red" onClick={() => void onConfirm}>
|
||||||
Delete Workspace
|
Delete Workspace
|
||||||
</Button>
|
</Button>
|
||||||
</Group>
|
</Group>
|
||||||
|
|||||||
@@ -26,8 +26,8 @@ const UserMenu: React.FC = () => {
|
|||||||
const [opened, setOpened] = useState<boolean>(false);
|
const [opened, setOpened] = useState<boolean>(false);
|
||||||
const { user, logout } = useAuth();
|
const { user, logout } = useAuth();
|
||||||
|
|
||||||
const handleLogout = (): void => {
|
const handleLogout = async (): Promise<void> => {
|
||||||
logout();
|
await logout();
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ import { useWorkspace } from '../../contexts/WorkspaceContext';
|
|||||||
import { useModalContext } from '../../contexts/ModalContext';
|
import { useModalContext } from '../../contexts/ModalContext';
|
||||||
import { listWorkspaces } from '../../api/workspace';
|
import { listWorkspaces } from '../../api/workspace';
|
||||||
import CreateWorkspaceModal from '../modals/workspace/CreateWorkspaceModal';
|
import CreateWorkspaceModal from '../modals/workspace/CreateWorkspaceModal';
|
||||||
import type { Workspace } from '../../types/workspace';
|
import type { Workspace } from '@/types/models';
|
||||||
|
|
||||||
const WorkspaceSwitcher: React.FC = () => {
|
const WorkspaceSwitcher: React.FC = () => {
|
||||||
const { currentWorkspace, switchWorkspace } = useWorkspace();
|
const { currentWorkspace, switchWorkspace } = useWorkspace();
|
||||||
|
|||||||
@@ -16,13 +16,12 @@ import SecuritySettings from './SecuritySettings';
|
|||||||
import ProfileSettings from './ProfileSettings';
|
import ProfileSettings from './ProfileSettings';
|
||||||
import DangerZoneSettings from './DangerZoneSettings';
|
import DangerZoneSettings from './DangerZoneSettings';
|
||||||
import AccordionControl from '../AccordionControl';
|
import AccordionControl from '../AccordionControl';
|
||||||
import type {
|
|
||||||
UserProfileSettings,
|
|
||||||
ProfileSettingsState,
|
|
||||||
SettingsAction} from '../../../types/settings';
|
|
||||||
import {
|
import {
|
||||||
SettingsActionType
|
type UserProfileSettings,
|
||||||
} from '../../../types/settings';
|
type ProfileSettingsState,
|
||||||
|
type SettingsAction,
|
||||||
|
SettingsActionType,
|
||||||
|
} from '@/types/models';
|
||||||
|
|
||||||
interface AccountSettingsProps {
|
interface AccountSettingsProps {
|
||||||
opened: boolean;
|
opened: boolean;
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ const DangerZoneSettings: React.FC = () => {
|
|||||||
const success = await deleteAccount(password);
|
const success = await deleteAccount(password);
|
||||||
if (success) {
|
if (success) {
|
||||||
setDeleteModalOpened(false);
|
setDeleteModalOpened(false);
|
||||||
logout();
|
await logout();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { Box, Stack, TextInput } from '@mantine/core';
|
import { Box, Stack, TextInput } from '@mantine/core';
|
||||||
import type { UserProfileSettings } from '../../../types/settings';
|
import type { UserProfileSettings } from '@/types/models';
|
||||||
|
|
||||||
interface ProfileSettingsProps {
|
interface ProfileSettingsProps {
|
||||||
settings: UserProfileSettings;
|
settings: UserProfileSettings;
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import React, { useState } from 'react';
|
import React, { useState } from 'react';
|
||||||
import { Box, PasswordInput, Stack, Text } from '@mantine/core';
|
import { Box, PasswordInput, Stack, Text } from '@mantine/core';
|
||||||
import type { UserProfileSettings } from '@/types/settings';
|
import type { UserProfileSettings } from '@/types/models';
|
||||||
|
|
||||||
interface SecuritySettingsProps {
|
interface SecuritySettingsProps {
|
||||||
settings: UserProfileSettings;
|
settings: UserProfileSettings;
|
||||||
@@ -66,7 +66,7 @@ const SecuritySettings: React.FC<SecuritySettingsProps> = ({
|
|||||||
/>
|
/>
|
||||||
<Text size="xs" c="dimmed">
|
<Text size="xs" c="dimmed">
|
||||||
Password must be at least 8 characters long. Leave password fields
|
Password must be at least 8 characters long. Leave password fields
|
||||||
empty if you don't want to change it.
|
empty if you don't want to change it.
|
||||||
</Text>
|
</Text>
|
||||||
</Stack>
|
</Stack>
|
||||||
</Box>
|
</Box>
|
||||||
|
|||||||
@@ -20,8 +20,8 @@ import { useUserAdmin } from '../../../hooks/useUserAdmin';
|
|||||||
import CreateUserModal from '../../modals/user/CreateUserModal';
|
import CreateUserModal from '../../modals/user/CreateUserModal';
|
||||||
import EditUserModal from '../../modals/user/EditUserModal';
|
import EditUserModal from '../../modals/user/EditUserModal';
|
||||||
import DeleteUserModal from '../../modals/user/DeleteUserModal';
|
import DeleteUserModal from '../../modals/user/DeleteUserModal';
|
||||||
import type { User } from '../../../types/authApi';
|
import type { User } from '@/types/models';
|
||||||
import type { CreateUserRequest, UpdateUserRequest } from '../../../types/adminApi';
|
import type { CreateUserRequest, UpdateUserRequest } from '@/types/api';
|
||||||
|
|
||||||
interface AdminUsersTabProps {
|
interface AdminUsersTabProps {
|
||||||
currentUser: User;
|
currentUser: User;
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import { Table, Group, Text, Box, LoadingOverlay, Alert } from '@mantine/core';
|
|||||||
import { IconAlertCircle } from '@tabler/icons-react';
|
import { IconAlertCircle } from '@tabler/icons-react';
|
||||||
import { useAdminData } from '../../../hooks/useAdminData';
|
import { useAdminData } from '../../../hooks/useAdminData';
|
||||||
import { formatBytes } from '../../../utils/formatBytes';
|
import { formatBytes } from '../../../utils/formatBytes';
|
||||||
import type { FileCountStats, WorkspaceStats } from '../../../types/adminApi';
|
import type { FileCountStats, WorkspaceStats } from '@/types/models';
|
||||||
|
|
||||||
const AdminWorkspacesTab: React.FC = () => {
|
const AdminWorkspacesTab: React.FC = () => {
|
||||||
const {
|
const {
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { Text, Switch, Group, Box } from '@mantine/core';
|
import { Text, Switch, Group, Box } from '@mantine/core';
|
||||||
import { useWorkspace } from '../../../contexts/WorkspaceContext';
|
import { useWorkspace } from '../../../contexts/WorkspaceContext';
|
||||||
import { Theme } from '@/types/theme';
|
import { Theme } from '@/types/models';
|
||||||
|
|
||||||
interface AppearanceSettingsProps {
|
interface AppearanceSettingsProps {
|
||||||
onThemeChange: (newTheme: Theme) => void;
|
onThemeChange: (newTheme: Theme) => void;
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { Box, TextInput, Text, Grid } from '@mantine/core';
|
import { Box, TextInput, Text, Grid } from '@mantine/core';
|
||||||
import type { Workspace } from '@/types/workspace';
|
import type { Workspace } from '@/types/models';
|
||||||
|
|
||||||
interface GeneralSettingsProps {
|
interface GeneralSettingsProps {
|
||||||
name: string;
|
name: string;
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import {
|
|||||||
Group,
|
Group,
|
||||||
Grid,
|
Grid,
|
||||||
} from '@mantine/core';
|
} from '@mantine/core';
|
||||||
import type { Workspace } from '@/types/workspace';
|
import type { Workspace } from '@/types/models';
|
||||||
|
|
||||||
interface GitSettingsProps {
|
interface GitSettingsProps {
|
||||||
gitEnabled: boolean;
|
gitEnabled: boolean;
|
||||||
@@ -19,7 +19,7 @@ interface GitSettingsProps {
|
|||||||
gitCommitMsgTemplate: string;
|
gitCommitMsgTemplate: string;
|
||||||
gitCommitName: string;
|
gitCommitName: string;
|
||||||
gitCommitEmail: string;
|
gitCommitEmail: string;
|
||||||
onInputChange: (key: keyof Workspace, value: any) => void;
|
onInputChange: (key: keyof Workspace, value: string | boolean) => void;
|
||||||
}
|
}
|
||||||
|
|
||||||
const GitSettings: React.FC<GitSettingsProps> = ({
|
const GitSettings: React.FC<GitSettingsProps> = ({
|
||||||
|
|||||||
@@ -17,10 +17,12 @@ import GeneralSettings from './GeneralSettings';
|
|||||||
import { useModalContext } from '../../../contexts/ModalContext';
|
import { useModalContext } from '../../../contexts/ModalContext';
|
||||||
import DangerZoneSettings from './DangerZoneSettings';
|
import DangerZoneSettings from './DangerZoneSettings';
|
||||||
import AccordionControl from '../AccordionControl';
|
import AccordionControl from '../AccordionControl';
|
||||||
import type { SettingsAction } from '../../../types/settings';
|
import {
|
||||||
import { SettingsActionType } from '../../../types/settings';
|
type Theme,
|
||||||
import type { Workspace } from '../../../types/workspace';
|
type Workspace,
|
||||||
|
type SettingsAction,
|
||||||
|
SettingsActionType,
|
||||||
|
} from '@/types/models';
|
||||||
// State and reducer for workspace settings
|
// State and reducer for workspace settings
|
||||||
interface WorkspaceSettingsState {
|
interface WorkspaceSettingsState {
|
||||||
localSettings: Partial<Workspace>;
|
localSettings: Partial<Workspace>;
|
||||||
@@ -46,7 +48,7 @@ function settingsReducer(
|
|||||||
initialSettings: action.payload || {},
|
initialSettings: action.payload || {},
|
||||||
hasUnsavedChanges: false,
|
hasUnsavedChanges: false,
|
||||||
};
|
};
|
||||||
case SettingsActionType.UPDATE_LOCAL_SETTINGS:
|
case SettingsActionType.UPDATE_LOCAL_SETTINGS: {
|
||||||
const newLocalSettings = { ...state.localSettings, ...action.payload };
|
const newLocalSettings = { ...state.localSettings, ...action.payload };
|
||||||
const hasChanges =
|
const hasChanges =
|
||||||
JSON.stringify(newLocalSettings) !==
|
JSON.stringify(newLocalSettings) !==
|
||||||
@@ -56,6 +58,7 @@ function settingsReducer(
|
|||||||
localSettings: newLocalSettings,
|
localSettings: newLocalSettings,
|
||||||
hasUnsavedChanges: hasChanges,
|
hasUnsavedChanges: hasChanges,
|
||||||
};
|
};
|
||||||
|
}
|
||||||
case SettingsActionType.MARK_SAVED:
|
case SettingsActionType.MARK_SAVED:
|
||||||
return {
|
return {
|
||||||
...state,
|
...state,
|
||||||
@@ -95,7 +98,7 @@ const WorkspaceSettings: React.FC = () => {
|
|||||||
}, [currentWorkspace]);
|
}, [currentWorkspace]);
|
||||||
|
|
||||||
const handleInputChange = useCallback(
|
const handleInputChange = useCallback(
|
||||||
(key: keyof Workspace, value: any): void => {
|
<K extends keyof Workspace>(key: K, value: Workspace[K]): void => {
|
||||||
dispatch({
|
dispatch({
|
||||||
type: SettingsActionType.UPDATE_LOCAL_SETTINGS,
|
type: SettingsActionType.UPDATE_LOCAL_SETTINGS,
|
||||||
payload: { [key]: value } as Partial<Workspace>,
|
payload: { [key]: value } as Partial<Workspace>,
|
||||||
@@ -194,7 +197,7 @@ const WorkspaceSettings: React.FC = () => {
|
|||||||
<Accordion.Panel>
|
<Accordion.Panel>
|
||||||
<AppearanceSettings
|
<AppearanceSettings
|
||||||
onThemeChange={(newTheme: string) =>
|
onThemeChange={(newTheme: string) =>
|
||||||
handleInputChange('theme', newTheme)
|
handleInputChange('theme', newTheme as Theme)
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
</Accordion.Panel>
|
</Accordion.Panel>
|
||||||
@@ -247,7 +250,7 @@ const WorkspaceSettings: React.FC = () => {
|
|||||||
<Button variant="default" onClick={handleClose}>
|
<Button variant="default" onClick={handleClose}>
|
||||||
Cancel
|
Cancel
|
||||||
</Button>
|
</Button>
|
||||||
<Button onClick={handleSubmit}>Save Changes</Button>
|
<Button onClick={() => void handleSubmit}>Save Changes</Button>
|
||||||
</Group>
|
</Group>
|
||||||
</Stack>
|
</Stack>
|
||||||
</Modal>
|
</Modal>
|
||||||
|
|||||||
Reference in New Issue
Block a user