signal-desktop/ts/components/conversation/conversation-details/PanelSection.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

34 lines
905 B
TypeScript

// Copyright 2020 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
import React from 'react';
import classNames from 'classnames';
import { bemGenerator } from './util';
export type Props = {
actions?: React.ReactNode;
borderless?: boolean;
centerTitle?: boolean;
title?: string;
};
const bem = bemGenerator('module-conversation-details-panel-section');
const borderlessClass = bem('root', 'borderless');
export const PanelSection: React.ComponentType<Props> = ({
actions,
borderless,
centerTitle,
children,
title,
}) => (
<div className={classNames(bem('root'), borderless ? borderlessClass : null)}>
{(title || actions) && (
<div className={bem('header', { center: centerTitle || false })}>
{title && <div className={bem('title')}>{title}</div>}
{actions && <div>{actions}</div>}
</div>
)}
<div>{children}</div>
</div>
);