2023-01-03 19:55:46 +00:00
|
|
|
// Copyright 2020 Signal Messenger, LLC
|
2020-10-30 20:34:04 +00:00
|
|
|
// SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
|
2020-07-24 01:35:32 +00:00
|
|
|
import React from 'react';
|
2020-11-20 19:39:50 +00:00
|
|
|
import classNames from 'classnames';
|
2020-07-24 01:35:32 +00:00
|
|
|
|
2020-11-19 18:11:35 +00:00
|
|
|
import { Tooltip } from './Tooltip';
|
2021-10-26 19:15:33 +00:00
|
|
|
import type { LocalizerType } from '../types/Util';
|
2020-07-24 01:35:32 +00:00
|
|
|
|
|
|
|
type PropsType = {
|
2020-11-20 19:39:50 +00:00
|
|
|
className?: string;
|
2021-10-18 22:10:22 +00:00
|
|
|
tooltipContainerRef?: React.RefObject<HTMLElement>;
|
2020-07-24 01:35:32 +00:00
|
|
|
i18n: LocalizerType;
|
|
|
|
};
|
|
|
|
|
2022-11-18 00:45:19 +00:00
|
|
|
export function InContactsIcon(props: PropsType): JSX.Element {
|
2021-10-18 22:10:22 +00:00
|
|
|
const { className, i18n, tooltipContainerRef } = props;
|
2020-07-24 01:35:32 +00:00
|
|
|
|
2020-09-12 00:46:52 +00:00
|
|
|
/* eslint-disable jsx-a11y/no-noninteractive-tabindex */
|
2020-07-24 01:35:32 +00:00
|
|
|
return (
|
2021-10-18 22:10:22 +00:00
|
|
|
<Tooltip
|
|
|
|
content={i18n('contactInAddressBook')}
|
|
|
|
popperModifiers={[
|
|
|
|
{
|
|
|
|
name: 'preventOverflow',
|
|
|
|
options: {
|
|
|
|
boundary: tooltipContainerRef?.current || undefined,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
]}
|
|
|
|
>
|
2021-01-11 21:43:21 +00:00
|
|
|
<span
|
|
|
|
aria-label={i18n('contactInAddressBook')}
|
|
|
|
className={classNames('module-in-contacts-icon__icon', className)}
|
|
|
|
role="img"
|
|
|
|
tabIndex={0}
|
|
|
|
/>
|
|
|
|
</Tooltip>
|
2020-07-24 01:35:32 +00:00
|
|
|
);
|
2020-09-12 00:46:52 +00:00
|
|
|
/* eslint-enable jsx-a11y/no-noninteractive-tabindex */
|
2022-11-18 00:45:19 +00:00
|
|
|
}
|