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

InlineDialogFailure.js 2.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. import AKButton from '@atlaskit/button';
  2. import React, { Component } from 'react';
  3. import { translate } from '../../../i18n';
  4. declare var interfaceConfig: Object;
  5. /**
  6. * Inline dialog that represents a failure and allows a retry.
  7. */
  8. class InlineDialogFailure extends Component {
  9. /**
  10. * {@code InlineDialogFailure}'s property types.
  11. *
  12. * @static
  13. */
  14. static propTypes = {
  15. /**
  16. * Allows to retry the call that previously didn't succeed.
  17. */
  18. onRetry: React.PropTypes.func,
  19. /**
  20. * Invoked to obtain translated strings.
  21. */
  22. t: React.PropTypes.func
  23. };
  24. /**
  25. * Renders the content of this component.
  26. *
  27. * @returns {ReactElement}
  28. */
  29. render() {
  30. const { t } = this.props;
  31. const supportLink = interfaceConfig.SUPPORT_URL;
  32. const supportLinkElem
  33. = supportLink
  34. ? ( // eslint-disable-line no-extra-parens
  35. <div className = 'inline-dialog-error-text'>
  36. <span>{ t('inlineDialogFailure.supportMsg') }</span>
  37. <span>
  38. <a
  39. href = { supportLink }
  40. rel = 'noopener noreferrer'
  41. target = '_blank'>
  42. { t('inlineDialogFailure.support') }
  43. </a>
  44. </span>
  45. <span>.</span>
  46. </div>
  47. )
  48. : null;
  49. return (
  50. <div className = 'inline-dialog-error'>
  51. <div className = 'inline-dialog-error-text'>
  52. { t('inlineDialogFailure.msg') }
  53. </div>
  54. { supportLinkElem }
  55. <AKButton
  56. className = 'inline-dialog-error-button'
  57. onClick = { this.props.onRetry } >
  58. { t('inlineDialogFailure.retry') }
  59. </AKButton>
  60. </div>
  61. );
  62. }
  63. }
  64. export default translate(InlineDialogFailure);