Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

CheckButton.js 1.1KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. import React from "react";
  2. import PropTypes from "prop-types";
  3. import selectedTheme from "../../../../themes";
  4. import { replaceInRoute } from "../../../../util/helpers/routeHelpers";
  5. import { ITEM_DETAILS_PAGE } from "../../../../constants/pages";
  6. import { useTranslation } from "react-i18next";
  7. import { CheckButtonContainer } from "./CheckButton.styled";
  8. const CheckButton = (props) => {
  9. const { t } = useTranslation();
  10. const routeToItem = (itemId) => {
  11. history.push(
  12. replaceInRoute(ITEM_DETAILS_PAGE, {
  13. idProizvod: itemId,
  14. })
  15. );
  16. };
  17. return (
  18. <CheckButtonContainer
  19. variant={props.sponsored ? "contained" : "outlined"}
  20. buttoncolor={selectedTheme.colors.primaryPurple}
  21. textcolor={props.sponsored ? "white" : selectedTheme.colors.primaryPurple}
  22. style={{ fontWeight: "600" }}
  23. onClick={() => routeToItem(props.offerId)}
  24. disabled={props.disabled}
  25. >
  26. {t("offer.checkButtonLabel")}
  27. </CheckButtonContainer>
  28. );
  29. };
  30. CheckButton.propTypes = {
  31. sponsored: PropTypes.bool,
  32. offerId: PropTypes.string,
  33. disabled: PropTypes.bool,
  34. };
  35. export default CheckButton;