SampleModal.js 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. import React, { Component } from 'react';
  2. import PropTypes from 'prop-types';
  3. import './SampleModal.scss';
  4. import { Dialog } from 'ca-ui-toolkit';
  5. const GUIDE_PIC_IMG_PATH = 'images/SampleModalGuide.png';
  6. export class SampleModal extends Component {
  7. static propTypes = {
  8. /** Handler to close the modal */
  9. closeHandler: PropTypes.func.isRequired,
  10. /** A copy of the i18n object used to translate strings */
  11. stringGetter: PropTypes.object,
  12. /** The helper to open the sample folder in the side nav-bar */
  13. sampleOpener: PropTypes.func
  14. };
  15. render() {
  16. const { stringGetter } = this.props;
  17. const dialogProps = {
  18. size: 'large',
  19. width: '634px',
  20. minWidth: '634px',
  21. clickaway: true,
  22. theme: 'ba-theme-default',
  23. className: 'sampleModal_dialog',
  24. style: { 'padding-bottom': '64px' },
  25. startingFocusIndex: -1
  26. };
  27. return (<Dialog
  28. {...dialogProps}
  29. onClose={() => {
  30. this.props.closeHandler();
  31. }}
  32. >
  33. <Dialog.Header>{stringGetter.get('modal_sample_title')}</Dialog.Header>
  34. <Dialog.Body>
  35. <div>{stringGetter.get('modal_sample_description')}</div>
  36. <div className="sampleModalPicContainer">
  37. <img src={GUIDE_PIC_IMG_PATH}></img>
  38. </div>
  39. </Dialog.Body>
  40. <Dialog.Footer>
  41. <Dialog.Button label={stringGetter.get('modal_sample_button_text')} onClick={() => {this.props.closeHandler();this.props.sampleOpener();}} primary/>
  42. </Dialog.Footer>
  43. </Dialog>);
  44. }
  45. }