您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

DialogContent.js 841B

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