Added support for tag mode on short URLs list

This commit is contained in:
Alejandro Celaya
2022-01-31 10:15:25 +01:00
parent 1011b062ae
commit 2de0276195
7 changed files with 67 additions and 8 deletions

View File

@@ -0,0 +1,24 @@
import { FC, useRef } from 'react';
import { UncontrolledTooltip } from 'reactstrap';
import { UncontrolledTooltipProps } from 'reactstrap/lib/Tooltip';
import { BooleanControlProps } from './BooleanControl';
import ToggleSwitch from './ToggleSwitch';
export const TooltipToggleSwitch: FC<BooleanControlProps & { tooltip?: Omit<UncontrolledTooltipProps, 'target'> }> = (
{ children, tooltip = {}, ...rest },
) => {
const ref = useRef<HTMLSpanElement>();
return (
<>
<span
ref={(el) => {
ref.current = el ?? undefined;
}}
>
<ToggleSwitch {...rest} />
</span>
<UncontrolledTooltip target={(() => ref.current) as any} {...tooltip}>{children}</UncontrolledTooltip>
</>
);
};

View File

@@ -25,3 +25,5 @@ export const supportsDomainRedirects = supportsQrErrorCorrection;
export const supportsForwardQuery = serverMatchesVersions({ minVersion: '2.9.0' });
export const supportsDefaultDomainRedirectsEdition = serverMatchesVersions({ minVersion: '2.10.0' });
export const supportsAllTagsFiltering = serverMatchesVersions({ minVersion: '3.0.0' });