ModalFooter.jsx 992 B

12345678910111213141516171819202122232425262728293031
  1. import React, {Component} from "react";
  2. import classNames from 'classnames';
  3. import styles from "./index.less";
  4. class ModalFooter extends Component {
  5. render() {
  6. const {btnName, handleCancel, handleConfirm} = this.props;
  7. const cancelClass = {
  8. overflow: "hidden",
  9. position: "relative",
  10. 'WebkitTransition':'color .2s linear,background-color .3s linear',
  11. 'transition': 'color .2s linear,background-color .3s linear',
  12. 'color':'#8e8e93',
  13. 'backgroundColor': 'transparent'
  14. }
  15. const btnClass = classNames(`${styles.btn} ${styles[btnName] || styles['primary']}`);
  16. return (
  17. <div className={styles['modal-footer']}>
  18. <button className={btnClass} onClick={handleConfirm}>确定</button>
  19. <button className={btnClass} style={cancelClass} onClick={handleCancel}>取消</button>
  20. </div>
  21. );
  22. }
  23. }
  24. export default ModalFooter;