Update to latest frontend-kit

This commit is contained in:
Alejandro Celaya
2024-07-22 18:33:35 +02:00
parent 7039e11f3f
commit fa10aebeab
4 changed files with 50 additions and 69 deletions

View File

@@ -1,9 +1,10 @@
import { useParsedQuery } from '@shlinkio/shlink-frontend-kit';
import type { FC } from 'react';
import { Button } from 'reactstrap';
import { NoMenuLayout } from '../common/NoMenuLayout';
import type { FCWithDeps } from '../container/utils';
import { componentFactory } from '../container/utils';
import { useGoBack, useParsedQuery } from '../utils/helpers/hooks';
import { useGoBack } from '../utils/helpers/hooks';
import type { ServerData } from './data';
import { isServerWithId } from './data';
import { ServerForm } from './helpers/ServerForm';

View File

@@ -1,13 +1,7 @@
import { parseQuery } from '@shlinkio/shlink-frontend-kit';
import { useCallback, useMemo } from 'react';
import { useLocation, useNavigate } from 'react-router-dom';
import { useCallback } from 'react';
import { useNavigate } from 'react-router-dom';
export const useGoBack = () => {
const navigate = useNavigate();
return useCallback(() => navigate(-1), [navigate]);
};
export const useParsedQuery = <T>(): T => {
const { search } = useLocation();
return useMemo(() => parseQuery<T>(search), [search]);
};