|
|
|
@@ -9,12 +9,14 @@ import history from "../../../../store/utils/history"; |
|
|
|
|
|
|
|
const CheckButton = (props) => { |
|
|
|
const { t } = useTranslation(); |
|
|
|
const routeToItem = (itemId) => { |
|
|
|
history.push( |
|
|
|
replaceInRoute(ITEM_DETAILS_PAGE, { |
|
|
|
offerId: itemId, |
|
|
|
}) |
|
|
|
); |
|
|
|
const routeToItem = (event, itemId) => { |
|
|
|
event.stopPropagation(); |
|
|
|
if (!props?.disabled) |
|
|
|
history.push( |
|
|
|
replaceInRoute(ITEM_DETAILS_PAGE, { |
|
|
|
offerId: itemId, |
|
|
|
}) |
|
|
|
); |
|
|
|
}; |
|
|
|
return ( |
|
|
|
<CheckButtonContainer |
|
|
|
@@ -22,7 +24,7 @@ const CheckButton = (props) => { |
|
|
|
buttoncolor={selectedTheme.colors.primaryPurple} |
|
|
|
textcolor={props.sponsored ? "white" : selectedTheme.colors.primaryPurple} |
|
|
|
style={{ fontWeight: "600" }} |
|
|
|
onClick={() => routeToItem(props.offerId)} |
|
|
|
onClick={(event) => routeToItem(event, props.offerId)} |
|
|
|
disabled={props.disabled} |
|
|
|
> |
|
|
|
{t("offer.checkButtonLabel")} |