Migrate tooltips from reactstrap to shlink-frontend-kit

This commit is contained in:
Alejandro Celaya
2025-06-08 12:54:54 +02:00
parent 531a61a57b
commit d3feee301e
3 changed files with 14 additions and 17 deletions

View File

@@ -1,9 +1,8 @@
import { faCheck as checkIcon } from '@fortawesome/free-solid-svg-icons';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import { Table } from '@shlinkio/shlink-frontend-kit/tailwind';
import { Table, Tooltip, useTooltip } from '@shlinkio/shlink-frontend-kit/tailwind';
import type { FC } from 'react';
import { Link } from 'react-router';
import { UncontrolledTooltip } from 'reactstrap';
import type { FCWithDeps } from '../container/utils';
import { componentFactory, useDependencies } from '../container/utils';
import type { ServerWithId } from './data';
@@ -20,6 +19,7 @@ type ManageServersRowDeps = {
const ManageServersRow: FCWithDeps<ManageServersRowProps, ManageServersRowDeps> = ({ server, hasAutoConnect }) => {
const { ManageServersRowDropdown } = useDependencies(ManageServersRow);
const { anchor, tooltip } = useTooltip();
return (
<Table.Row className="tw:relative">
@@ -30,11 +30,9 @@ const ManageServersRow: FCWithDeps<ManageServersRowProps, ManageServersRowDeps>
<FontAwesomeIcon
icon={checkIcon}
className="tw:text-lm-brand tw:dark:text-dm-brand"
id="autoConnectIcon"
{...anchor}
/>
<UncontrolledTooltip target="autoConnectIcon" placement="right">
Auto-connect to this server
</UncontrolledTooltip>
<Tooltip {...tooltip}>Auto-connect to this server</Tooltip>
</>
)}
</Table.Cell>