| 1234567891011121314151617181920212223242526272829303132333435363738 |
- import React from "react";
- import PropTypes from "prop-types";
- import selectedTheme from "../../../../themes";
- import { replaceInRoute } from "../../../../util/helpers/routeHelpers";
- import { ITEM_DETAILS_PAGE } from "../../../../constants/pages";
- import { useTranslation } from "react-i18next";
- import { CheckButtonContainer } from "./CheckButton.styled";
-
- const CheckButton = (props) => {
- const { t } = useTranslation();
- const routeToItem = (itemId) => {
- history.push(
- replaceInRoute(ITEM_DETAILS_PAGE, {
- idProizvod: itemId,
- })
- );
- };
- return (
- <CheckButtonContainer
- variant={props.sponsored ? "contained" : "outlined"}
- buttoncolor={selectedTheme.colors.primaryPurple}
- textcolor={props.sponsored ? "white" : selectedTheme.colors.primaryPurple}
- style={{ fontWeight: "600" }}
- onClick={() => routeToItem(props.offerId)}
- disabled={props.disabled}
- >
- {t("offer.checkButtonLabel")}
- </CheckButtonContainer>
- );
- };
-
- CheckButton.propTypes = {
- sponsored: PropTypes.bool,
- offerId: PropTypes.string,
- disabled: PropTypes.bool,
- };
-
- export default CheckButton;
|