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

PrimaryButtonWithIcon.js 940B

12345678910111213141516171819202122232425262728293031323334
  1. import React from "react";
  2. import PropTypes from "prop-types";
  3. import {
  4. PrimaryButtonWithIconContainer,
  5. IconStyled,
  6. PrimaryButtonWithIconStyled,
  7. } from "./PrimaryButtonWithIcon.styled";
  8. const PrimaryButtonWithIcon = (props) => {
  9. return (
  10. <PrimaryButtonWithIconContainer
  11. style={props.containerStyle}
  12. className={props.className}
  13. >
  14. <PrimaryButtonWithIconStyled sx={props.style} {...props.buttonProps} onClick={props.onClick}>
  15. <IconStyled style={props.iconStyle}>{props.icon}</IconStyled>
  16. {props.children}
  17. </PrimaryButtonWithIconStyled>
  18. </PrimaryButtonWithIconContainer>
  19. );
  20. };
  21. PrimaryButtonWithIcon.propTypes = {
  22. children: PropTypes.node,
  23. icon: PropTypes.node,
  24. className: PropTypes.string,
  25. containerStyle: PropTypes.any,
  26. style: PropTypes.any,
  27. iconStyle: PropTypes.any,
  28. buttonProps: PropTypes.any,
  29. onClick: PropTypes.func,
  30. };
  31. export default PrimaryButtonWithIcon;