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 '@mantine/notifications/styles.css';
|
||||||
import './App.scss';
|
import './App.scss';
|
||||||
|
|
||||||
interface AuthenticatedContentProps {}
|
type AuthenticatedContentProps = object;
|
||||||
|
|
||||||
const AuthenticatedContent: React.FC<AuthenticatedContentProps> = () => {
|
const AuthenticatedContent: React.FC<AuthenticatedContentProps> = () => {
|
||||||
const { user, loading, initialized } = useAuth();
|
const { user, loading, initialized } = useAuth();
|
||||||
@@ -37,7 +37,7 @@ const AuthenticatedContent: React.FC<AuthenticatedContentProps> = () => {
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
interface AppProps {}
|
type AppProps = object;
|
||||||
|
|
||||||
const App: React.FC<AppProps> = () => {
|
const App: React.FC<AppProps> = () => {
|
||||||
return (
|
return (
|
||||||
|
|||||||
@@ -47,7 +47,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) !==
|
||||||
@@ -57,6 +57,7 @@ function settingsReducer(
|
|||||||
localSettings: newLocalSettings,
|
localSettings: newLocalSettings,
|
||||||
hasUnsavedChanges: hasChanges,
|
hasUnsavedChanges: hasChanges,
|
||||||
};
|
};
|
||||||
|
}
|
||||||
case SettingsActionType.MARK_SAVED:
|
case SettingsActionType.MARK_SAVED:
|
||||||
return {
|
return {
|
||||||
...state,
|
...state,
|
||||||
@@ -254,7 +255,7 @@ const AccountSettings: React.FC<AccountSettingsProps> = ({
|
|||||||
Cancel
|
Cancel
|
||||||
</Button>
|
</Button>
|
||||||
<Button
|
<Button
|
||||||
onClick={handleSubmit}
|
onClick={() => void handleSubmit}
|
||||||
loading={loading}
|
loading={loading}
|
||||||
disabled={!state.hasUnsavedChanges}
|
disabled={!state.hasUnsavedChanges}
|
||||||
>
|
>
|
||||||
|
|||||||
Reference in New Issue
Block a user