Selaa lähdekoodia

Fixed bug 1946

bugfix/1946
Djordje Mitrovic 3 vuotta sitten
vanhempi
commit
6bac208696

+ 7
- 3
src/components/Buttons/IconButton/IconButton.js Näytä tiedosto

@@ -7,15 +7,19 @@ export const IconButton = (props) => {
const disabled = useMemo(() => {
if (props?.customDisabled) return false;
return props?.disabled;
})
});
return (
<IconButtonContainer
style={props.containerStyle}
className={props.className}
onClick={(event) => event.stopPropagation()}
>
<IconButtonStyled
disabled={disabled}
onClick={props.onClick}
// disabled={disabled}
onClick={(event) => {
event.stopPropagation();
if (!disabled) props.onClick(event);
}}
sx={props.style}
iconcolor={props.iconColor}
// {...props}

+ 9
- 7
src/components/Cards/OfferCard/CheckButton/CheckButton.js Näytä tiedosto

@@ -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")}

Loading…
Peruuta
Tallenna