| @@ -16,6 +16,7 @@ import { useDispatch, useSelector } from "react-redux"; | |||
| import { | |||
| fetchOffers, | |||
| fetchProfileOffers, | |||
| pinOffer, | |||
| removeOffer, | |||
| } from "../../../../store/actions/offers/offersActions"; | |||
| import { Trans, useTranslation } from "react-i18next"; | |||
| @@ -45,7 +46,8 @@ const DeleteOffer = (props) => { | |||
| }; | |||
| const removeOfferHandler = () => { | |||
| dispatch(removeOffer({ offerId, handleApiResponseSuccess })); | |||
| if (props.pin) dispatch(pinOffer({ offerId: props.offer?._id, handleApiResponseSuccess })); | |||
| else dispatch(removeOffer({ offerId, handleApiResponseSuccess })); | |||
| props.closeModalHandler(); | |||
| if (history.location.pathname.includes("proizvodi")) { | |||
| history.goBack(); | |||
| @@ -197,6 +197,9 @@ const OfferCard = (props) => { | |||
| <></> | |||
| )} | |||
| <ButtonsContainer vertical={props.vertical}> | |||
| {props?.offer?.pinned && ( | |||
| <PinIcon vertical={props.vertical} isMyOffer={props.isMyOffer} /> | |||
| )} | |||
| {props.isMyOffer ? ( | |||
| <> | |||
| <RemoveIconContainer | |||
| @@ -237,9 +240,6 @@ const OfferCard = (props) => { | |||
| <PinOutlinedIcon /> | |||
| </PinIconContainer> | |||
| )} | |||
| {props?.offer?.pinned && ( | |||
| <PinIcon vertical={props.vertical} isMyOffer={props.isMyOffer} /> | |||
| )} | |||
| </ButtonsContainer> | |||
| </OfferFlexContainer> | |||
| </OfferCardContainer> | |||
| @@ -103,6 +103,7 @@ export const OfferTitle = styled(Typography)` | |||
| text-overflow: ellipsis; | |||
| max-height: 33px; | |||
| margin-bottom: 28px; | |||
| max-width: calc(100% - 200px); | |||
| @media (max-width: 550px) { | |||
| width: 100%; | |||
| font-size: 18px; | |||
| @@ -395,30 +396,8 @@ export const PinOutlinedIcon = styled(PinOutlined)` | |||
| } | |||
| `; | |||
| export const PinIcon = styled(Pin)` | |||
| position: absolute; | |||
| top: 20px; | |||
| right: 68px; | |||
| ${(props) => | |||
| props.isMyOffer && | |||
| ` | |||
| right: 134px; | |||
| top: 26px; | |||
| @media (max-width: 600px) { | |||
| top: 20px; | |||
| right: 94px; | |||
| } | |||
| `} | |||
| @media (max-width: 600px) { | |||
| top: 20px; | |||
| right: 55px; | |||
| ${(props) => | |||
| props.vertical && | |||
| ` | |||
| top: initial; | |||
| bottom: 18px; | |||
| right: 18px; | |||
| `} | |||
| } | |||
| position: relative; | |||
| top: 6px; | |||
| `; | |||
| export const CategoryIcon = styled(Category)` | |||
| width: 14px; | |||
| @@ -16,8 +16,8 @@ const ProfileLayout = (props) => { | |||
| > | |||
| {props.children} | |||
| <ContentRightCardContainer container spacing={2}> | |||
| <Content sm={12} md={8} lg={9} item>{props.content}</Content> | |||
| <RightCard sm={0} md={4} lg={3} item singleOffer={props.singleOffer} profile={props.profile}> | |||
| <Content sm={12} md={8} lg={8} xl={9} item>{props.content}</Content> | |||
| <RightCard sm={0} md={4} lg={4} xl={3} item singleOffer={props.singleOffer} profile={props.profile}> | |||
| {props.rightCard} | |||
| </RightCard> | |||
| </ContentRightCardContainer> | |||
| @@ -175,7 +175,7 @@ export default { | |||
| locations: "locations", | |||
| mineOffers: "users", | |||
| removeOffer: "/users/{userId}/offers/{offerId}", | |||
| pinOffer: "offers/{id}/pin", | |||
| pinOffer: "admin/offers/{id}/pin", | |||
| }, | |||
| chat: { | |||
| getChat: "chats", | |||