jiti-meet/react/features/base/dialog/components/DialogContent.js

44 lines
923 B
JavaScript
Raw Normal View History

2018-09-04 07:29:48 +00:00
// @flow
import React, { Component } from 'react';
import { Container, Text } from '../../react';
import { type StyleType } from '../../styles';
2018-09-04 07:29:48 +00:00
2018-10-18 08:28:08 +00:00
import styles from './styles';
2018-09-04 07:29:48 +00:00
type Props = {
/**
* Children of the component.
*/
children: string | React$Node,
style: ?StyleType
2018-09-04 07:29:48 +00:00
};
/**
* Generic dialog content container to provide the same styling for all custom
* dialogs.
*/
export default class DialogContent extends Component<Props> {
/**
* Implements {@code Component#render}.
*
* @inheritdoc
*/
render() {
const { children, style } = this.props;
2018-09-04 07:29:48 +00:00
const childrenComponent = typeof children === 'string'
? <Text style = { style }>{ children }</Text>
2018-09-04 07:29:48 +00:00
: children;
return (
<Container style = { styles.dialogContainer }>
2018-09-04 07:29:48 +00:00
{ childrenComponent }
</Container>
2018-09-04 07:29:48 +00:00
);
}
}