diff --git a/client/src/components/Settings/SearchSettings/CustomQueries/CustomQueries.module.css b/client/src/components/Settings/GeneralSettings/CustomQueries/CustomQueries.module.css similarity index 100% rename from client/src/components/Settings/SearchSettings/CustomQueries/CustomQueries.module.css rename to client/src/components/Settings/GeneralSettings/CustomQueries/CustomQueries.module.css diff --git a/client/src/components/Settings/SearchSettings/CustomQueries/CustomQueries.tsx b/client/src/components/Settings/GeneralSettings/CustomQueries/CustomQueries.tsx similarity index 100% rename from client/src/components/Settings/SearchSettings/CustomQueries/CustomQueries.tsx rename to client/src/components/Settings/GeneralSettings/CustomQueries/CustomQueries.tsx diff --git a/client/src/components/Settings/SearchSettings/CustomQueries/QueriesForm.tsx b/client/src/components/Settings/GeneralSettings/CustomQueries/QueriesForm.tsx similarity index 100% rename from client/src/components/Settings/SearchSettings/CustomQueries/QueriesForm.tsx rename to client/src/components/Settings/GeneralSettings/CustomQueries/QueriesForm.tsx diff --git a/client/src/components/Settings/SearchSettings/SearchSettings.tsx b/client/src/components/Settings/GeneralSettings/GeneralSettings.tsx similarity index 92% rename from client/src/components/Settings/SearchSettings/SearchSettings.tsx rename to client/src/components/Settings/GeneralSettings/GeneralSettings.tsx index 9b057f5..8c2e5fd 100644 --- a/client/src/components/Settings/SearchSettings/SearchSettings.tsx +++ b/client/src/components/Settings/GeneralSettings/GeneralSettings.tsx @@ -3,7 +3,7 @@ import { useState, useEffect, FormEvent, ChangeEvent, Fragment } from 'react'; import { useDispatch, useSelector } from 'react-redux'; // Typescript -import { Query, SearchForm } from '../../../interfaces'; +import { Query, GeneralForm } from '../../../interfaces'; // Components import { CustomQueries } from './CustomQueries/CustomQueries'; @@ -12,7 +12,7 @@ import { CustomQueries } from './CustomQueries/CustomQueries'; import { Button, SettingsHeadline, InputGroup } from '../../UI'; // Utils -import { inputHandler, searchSettingsTemplate } from '../../../utility'; +import { inputHandler, generalSettingsTemplate } from '../../../utility'; // Data import { queries } from '../../../utility/searchQueries.json'; @@ -22,7 +22,7 @@ import { State } from '../../../store/reducers'; import { bindActionCreators } from 'redux'; import { actionCreators } from '../../../store'; -export const SearchSettings = (): JSX.Element => { +export const GeneralSettings = (): JSX.Element => { const { loading, customQueries, config } = useSelector( (state: State) => state.config ); @@ -31,7 +31,9 @@ export const SearchSettings = (): JSX.Element => { const { updateConfig } = bindActionCreators(actionCreators, dispatch); // Initial state - const [formData, setFormData] = useState(searchSettingsTemplate); + const [formData, setFormData] = useState( + generalSettingsTemplate + ); // Get config useEffect(() => { @@ -53,7 +55,7 @@ export const SearchSettings = (): JSX.Element => { e: ChangeEvent, options?: { isNumber?: boolean; isBool?: boolean } ) => { - inputHandler({ + inputHandler({ e, options, setStateHandler: setFormData, diff --git a/client/src/components/Settings/Settings.tsx b/client/src/components/Settings/Settings.tsx index f9f5102..7a297c9 100644 --- a/client/src/components/Settings/Settings.tsx +++ b/client/src/components/Settings/Settings.tsx @@ -16,7 +16,7 @@ import { WeatherSettings } from './WeatherSettings/WeatherSettings'; import { UISettings } from './UISettings/UISettings'; import { AppDetails } from './AppDetails/AppDetails'; import { StyleSettings } from './StyleSettings/StyleSettings'; -import { SearchSettings } from './SearchSettings/SearchSettings'; +import { GeneralSettings } from './GeneralSettings/GeneralSettings'; import { DockerSettings } from './DockerSettings/DockerSettings'; import { ProtectedRoute } from '../Routing/ProtectedRoute'; @@ -59,8 +59,8 @@ export const Settings = (): JSX.Element => { component={WeatherSettings} />