Fixed react errors while importing named exports from JSON files

This commit is contained in:
Paweł Malak 2023-07-20 19:04:31 +02:00
parent 35ae5f9ee7
commit 188c5bc04b
3 changed files with 9 additions and 3 deletions

View file

@ -15,7 +15,7 @@ import { Button, SettingsHeadline, InputGroup } from '../../UI';
import { inputHandler, generalSettingsTemplate } from '../../../utility';
// Data
import { queries } from '../../../utility/searchQueries.json';
import searchQueries from '../../../utility/searchQueries.json';
// Redux
import { State } from '../../../store/reducers';
@ -32,6 +32,8 @@ export const GeneralSettings = (): JSX.Element => {
const { updateConfig, sortApps, sortCategories, sortBookmarks } =
bindActionCreators(actionCreators, dispatch);
const queries = searchQueries.queries;
// Initial state
const [formData, setFormData] = useState<GeneralForm>(
generalSettingsTemplate

View file

@ -24,9 +24,11 @@ import { ProtectedRoute } from '../Routing/ProtectedRoute';
import { Container, Headline } from '../UI';
// Data
import { routes } from './settings.json';
import clientRoutes from './settings.json';
export const Settings = (): JSX.Element => {
const routes = clientRoutes.routes;
const { isAuthenticated } = useSelector((state: State) => state.auth);
const tabs = isAuthenticated ? routes : routes.filter((r) => !r.authRequired);

View file

@ -1,9 +1,11 @@
import { queries } from './searchQueries.json';
import searchQueries from './searchQueries.json';
import { SearchResult } from '../interfaces';
import { store } from '../store/store';
import { isUrlOrIp } from '.';
export const searchParser = (searchQuery: string): SearchResult => {
const queries = searchQueries.queries;
const result: SearchResult = {
isLocal: false,
isURL: false,