Browse Source

Fixed bug 1946

bugfix/1946
Djordje Mitrovic 3 years ago
parent
commit
6bac208696

+ 7
- 3
src/components/Buttons/IconButton/IconButton.js View File

const disabled = useMemo(() => { const disabled = useMemo(() => {
if (props?.customDisabled) return false; if (props?.customDisabled) return false;
return props?.disabled; return props?.disabled;
})
});
return ( return (
<IconButtonContainer <IconButtonContainer
style={props.containerStyle} style={props.containerStyle}
className={props.className} className={props.className}
onClick={(event) => event.stopPropagation()}
> >
<IconButtonStyled <IconButtonStyled
disabled={disabled}
onClick={props.onClick}
// disabled={disabled}
onClick={(event) => {
event.stopPropagation();
if (!disabled) props.onClick(event);
}}
sx={props.style} sx={props.style}
iconcolor={props.iconColor} iconcolor={props.iconColor}
// {...props} // {...props}

+ 9
- 7
src/components/Cards/OfferCard/CheckButton/CheckButton.js View File



const CheckButton = (props) => { const CheckButton = (props) => {
const { t } = useTranslation(); 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 ( return (
<CheckButtonContainer <CheckButtonContainer
buttoncolor={selectedTheme.colors.primaryPurple} buttoncolor={selectedTheme.colors.primaryPurple}
textcolor={props.sponsored ? "white" : selectedTheme.colors.primaryPurple} textcolor={props.sponsored ? "white" : selectedTheme.colors.primaryPurple}
style={{ fontWeight: "600" }} style={{ fontWeight: "600" }}
onClick={() => routeToItem(props.offerId)}
onClick={(event) => routeToItem(event, props.offerId)}
disabled={props.disabled} disabled={props.disabled}
> >
{t("offer.checkButtonLabel")} {t("offer.checkButtonLabel")}

Loading…
Cancel
Save