PostingDialogHeader.jsx 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. import React from "react"
  2. const PostingDialogHeader = ({
  3. children,
  4. close,
  5. fullscreen,
  6. minimize,
  7. minimized,
  8. fullscreenEnter,
  9. fullscreenExit,
  10. open,
  11. }) => (
  12. <div className="posting-dialog-header">
  13. <div className="posting-dialog-caption">{children}</div>
  14. {minimized ? (
  15. <button
  16. className="btn btn-posting-dialog"
  17. title={pgettext("dialog", "Open")}
  18. type="button"
  19. onClick={open}
  20. >
  21. <span className="material-icon">expand_less</span>
  22. </button>
  23. ) : (
  24. <button
  25. className="btn btn-posting-dialog"
  26. title={pgettext("dialog", "Minimize")}
  27. type="button"
  28. onClick={minimize}
  29. >
  30. <span className="material-icon">expand_more</span>
  31. </button>
  32. )}
  33. {fullscreen ? (
  34. <button
  35. className="btn btn-posting-dialog hidden-xs"
  36. title={pgettext("dialog", "Exit the fullscreen mode")}
  37. type="button"
  38. onClick={fullscreenExit}
  39. >
  40. <span className="material-icon">fullscreen_exit</span>
  41. </button>
  42. ) : (
  43. <button
  44. className="btn btn-posting-dialog hidden-xs"
  45. title={pgettext("dialog", "Enter the fullscreen mode")}
  46. type="button"
  47. onClick={fullscreenEnter}
  48. >
  49. <span className="material-icon">fullscreen</span>
  50. </button>
  51. )}
  52. <button
  53. className="btn btn-posting-dialog"
  54. title={pgettext("dialog", "Cancel")}
  55. type="button"
  56. onClick={close}
  57. >
  58. <span className="material-icon">close</span>
  59. </button>
  60. </div>
  61. )
  62. export default PostingDialogHeader