signal-desktop/ts/components/conversation/conversation-details/ConversationDetailsIcon.tsx
Josh Perez c0510b08a5
Introduce conversation details screen for New Groups
Co-authored-by: Chris Svenningsen <chris@carbonfive.com>
Co-authored-by: Sidney Keese <me@sidke.com>
2021-01-29 13:19:24 -08:00

37 lines
701 B
TypeScript

// Copyright 2020 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
import React from 'react';
import { bemGenerator } from './util';
export type Props = {
ariaLabel: string;
icon: string;
onClick?: () => void;
};
const bem = bemGenerator('module-conversation-details-icon');
export const ConversationDetailsIcon: React.ComponentType<Props> = ({
ariaLabel,
icon,
onClick,
}) => {
const content = <div className={bem('icon', icon)} />;
if (onClick) {
return (
<button
aria-label={ariaLabel}
className={bem('button')}
type="button"
onClick={onClick}
>
{content}
</button>
);
}
return content;
};