You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

DialogContent.js 923B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. // @flow
  2. import React, { Component } from 'react';
  3. import { Container, Text } from '../../react';
  4. import { type StyleType } from '../../styles';
  5. import styles from './styles';
  6. type Props = {
  7. /**
  8. * Children of the component.
  9. */
  10. children: string | React$Node,
  11. style: ?StyleType
  12. };
  13. /**
  14. * Generic dialog content container to provide the same styling for all custom
  15. * dialogs.
  16. */
  17. export default class DialogContent extends Component<Props> {
  18. /**
  19. * Implements {@code Component#render}.
  20. *
  21. * @inheritdoc
  22. */
  23. render() {
  24. const { children, style } = this.props;
  25. const childrenComponent = typeof children === 'string'
  26. ? <Text style = { style }>{ children }</Text>
  27. : children;
  28. return (
  29. <Container style = { styles.dialogContainer }>
  30. { childrenComponent }
  31. </Container>
  32. );
  33. }
  34. }