mirror of
https://github.com/shlinkio/shlink-web-client.git
synced 2026-03-17 21:13:48 +00:00
Move more non-shared components to shlink-web-component
This commit is contained in:
@@ -9,10 +9,10 @@ import { useEffect, useState } from 'react';
|
||||
import { Button, FormGroup, Input, Row } from 'reactstrap';
|
||||
import type { InputType } from 'reactstrap/types/lib/Input';
|
||||
import { Checkbox } from '../../src/utils/Checkbox';
|
||||
import { IconInput } from '../../src/utils/IconInput';
|
||||
import { SimpleCard } from '../../src/utils/SimpleCard';
|
||||
import type { DomainSelectorProps } from '../domains/DomainSelector';
|
||||
import type { TagsSelectorProps } from '../tags/helpers/TagsSelector';
|
||||
import { IconInput } from '../utils/components/IconInput';
|
||||
import type { DateTimeInputProps } from '../utils/dates/DateTimeInput';
|
||||
import { DateTimeInput } from '../utils/dates/DateTimeInput';
|
||||
import { formatIsoDate } from '../utils/dates/helpers/date';
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { isEmpty, pipe } from 'ramda';
|
||||
import { useMemo } from 'react';
|
||||
import { useCallback, useMemo } from 'react';
|
||||
import { useLocation, useNavigate } from 'react-router-dom';
|
||||
import { orderToString, stringToOrder } from '../../../src/utils/helpers/ordering';
|
||||
import type { TagsFilteringMode } from '../../api-contract';
|
||||
@@ -57,7 +57,7 @@ export const useShortUrlsQuery = (): [ShortUrlsFiltering, ToFirstPage] => {
|
||||
),
|
||||
[search],
|
||||
);
|
||||
const toFirstPageWithExtra = (extra: Partial<ShortUrlsFiltering>) => {
|
||||
const toFirstPageWithExtra = useCallback((extra: Partial<ShortUrlsFiltering>) => {
|
||||
const merged = { ...filtering, ...extra };
|
||||
const { orderBy, tags, excludeBots, excludeMaxVisitsReached, excludePastValidUntil, ...mergedFiltering } = merged;
|
||||
const query: ShortUrlsQuery = {
|
||||
@@ -72,7 +72,7 @@ export const useShortUrlsQuery = (): [ShortUrlsFiltering, ToFirstPage] => {
|
||||
const queryString = isEmpty(stringifiedQuery) ? '' : `?${stringifiedQuery}`;
|
||||
|
||||
navigate(`${routesPrefix}/list-short-urls/1${queryString}`);
|
||||
};
|
||||
}, [filtering, navigate, routesPrefix]);
|
||||
|
||||
return [filtering, toFirstPageWithExtra];
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user