2018-04-03 22:56:12 +00:00
|
|
|
import React from 'react';
|
2018-05-22 19:31:43 +00:00
|
|
|
import classNames from 'classnames';
|
2018-04-03 22:56:12 +00:00
|
|
|
|
2018-04-05 19:21:22 +00:00
|
|
|
interface Props {
|
2018-04-03 22:56:12 +00:00
|
|
|
/**
|
|
|
|
* Corresponds to the theme setting in the app, and the class added to the root element.
|
|
|
|
*/
|
2018-10-09 22:56:14 +00:00
|
|
|
ios: boolean;
|
2018-06-25 23:57:06 +00:00
|
|
|
theme: 'light-theme' | 'dark-theme';
|
2018-04-14 01:01:02 +00:00
|
|
|
type: 'private' | 'group';
|
2018-04-03 22:56:12 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Provides the parent elements necessary to allow the main Signal Desktop stylesheet to
|
2018-04-05 22:30:40 +00:00
|
|
|
* apply (with no changes) to messages in the Style Guide.
|
2018-04-03 22:56:12 +00:00
|
|
|
*/
|
2018-05-22 19:31:43 +00:00
|
|
|
export class ConversationContext extends React.Component<Props> {
|
2018-04-03 22:56:12 +00:00
|
|
|
public render() {
|
2018-10-09 22:56:14 +00:00
|
|
|
const { ios, theme, type } = this.props;
|
2018-04-03 22:56:12 +00:00
|
|
|
|
|
|
|
return (
|
2018-10-09 22:56:14 +00:00
|
|
|
<div
|
|
|
|
className={classNames(theme || 'light-theme', ios ? 'ios-theme' : null)}
|
|
|
|
>
|
2018-05-22 19:31:43 +00:00
|
|
|
<div className={classNames('conversation', type || 'private')}>
|
2018-04-27 21:25:04 +00:00
|
|
|
<div className="discussion-container" style={{ padding: '0.5em' }}>
|
|
|
|
<ul className="message-list">{this.props.children}</ul>
|
2018-04-03 22:56:12 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|