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.native.js 826B

123456789101112131415161718192021222324252627282930313233343536373839
  1. // @flow
  2. import React, { Component } from 'react';
  3. import { Text, View } from 'react-native';
  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. <View style = { styles.dialogContainer }>
  28. { childrenComponent }
  29. </View>
  30. );
  31. }
  32. }