mirror of
https://github.com/lordmathis/lemma.git
synced 2025-11-05 15:44:21 +00:00
Refactor type definitions in AuthenticatedContent and App components
This commit is contained in:
@@ -11,7 +11,7 @@ import '@mantine/core/styles.css';
|
||||
import '@mantine/notifications/styles.css';
|
||||
import './App.scss';
|
||||
|
||||
interface AuthenticatedContentProps {}
|
||||
type AuthenticatedContentProps = object;
|
||||
|
||||
const AuthenticatedContent: React.FC<AuthenticatedContentProps> = () => {
|
||||
const { user, loading, initialized } = useAuth();
|
||||
@@ -37,7 +37,7 @@ const AuthenticatedContent: React.FC<AuthenticatedContentProps> = () => {
|
||||
);
|
||||
};
|
||||
|
||||
interface AppProps {}
|
||||
type AppProps = object;
|
||||
|
||||
const App: React.FC<AppProps> = () => {
|
||||
return (
|
||||
|
||||
@@ -47,7 +47,7 @@ function settingsReducer(
|
||||
initialSettings: action.payload || {},
|
||||
hasUnsavedChanges: false,
|
||||
};
|
||||
case SettingsActionType.UPDATE_LOCAL_SETTINGS:
|
||||
case SettingsActionType.UPDATE_LOCAL_SETTINGS: {
|
||||
const newLocalSettings = { ...state.localSettings, ...action.payload };
|
||||
const hasChanges =
|
||||
JSON.stringify(newLocalSettings) !==
|
||||
@@ -57,6 +57,7 @@ function settingsReducer(
|
||||
localSettings: newLocalSettings,
|
||||
hasUnsavedChanges: hasChanges,
|
||||
};
|
||||
}
|
||||
case SettingsActionType.MARK_SAVED:
|
||||
return {
|
||||
...state,
|
||||
@@ -254,7 +255,7 @@ const AccountSettings: React.FC<AccountSettingsProps> = ({
|
||||
Cancel
|
||||
</Button>
|
||||
<Button
|
||||
onClick={handleSubmit}
|
||||
onClick={() => void handleSubmit}
|
||||
loading={loading}
|
||||
disabled={!state.hasUnsavedChanges}
|
||||
>
|
||||
|
||||
Reference in New Issue
Block a user