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.

Notice.js 1.0KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. /* @flow */
  2. import React, { Component } from 'react';
  3. declare var config: Object;
  4. /**
  5. * Notice react component.
  6. *
  7. * @class Notice
  8. */
  9. export default class Notice extends Component {
  10. state: Object;
  11. /**
  12. * Constructor of Notice component.
  13. *
  14. * @param {Object} props - The read-only React Component props with which
  15. * the new instance is to be initialized.
  16. */
  17. constructor(props: Object) {
  18. super(props);
  19. const { noticeMessage } = config;
  20. this.state = {
  21. noticeMessage
  22. };
  23. }
  24. /**
  25. * Implements React's {@link Component#render()}.
  26. *
  27. * @inheritdoc
  28. * @returns {ReactElement}
  29. */
  30. render() {
  31. const { noticeMessage } = this.state;
  32. if (!noticeMessage) {
  33. return null;
  34. }
  35. return (
  36. <div className = 'notice'>
  37. <span className = 'notice__message' >
  38. { noticeMessage }
  39. </span>
  40. </div>
  41. );
  42. }
  43. }