| import { | import { | ||||
| fetchOffers, | fetchOffers, | ||||
| fetchProfileOffers, | fetchProfileOffers, | ||||
| pinOffer, | |||||
| removeOffer, | removeOffer, | ||||
| } from "../../../../store/actions/offers/offersActions"; | } from "../../../../store/actions/offers/offersActions"; | ||||
| import { Trans, useTranslation } from "react-i18next"; | import { Trans, useTranslation } from "react-i18next"; | ||||
| }; | }; | ||||
| const removeOfferHandler = () => { | const removeOfferHandler = () => { | ||||
| dispatch(removeOffer({ offerId, handleApiResponseSuccess })); | |||||
| if (props.pin) dispatch(pinOffer({ offerId: props.offer?._id, handleApiResponseSuccess })); | |||||
| else dispatch(removeOffer({ offerId, handleApiResponseSuccess })); | |||||
| props.closeModalHandler(); | props.closeModalHandler(); | ||||
| if (history.location.pathname.includes("proizvodi")) { | if (history.location.pathname.includes("proizvodi")) { | ||||
| history.goBack(); | history.goBack(); |
| <></> | <></> | ||||
| )} | )} | ||||
| <ButtonsContainer vertical={props.vertical}> | <ButtonsContainer vertical={props.vertical}> | ||||
| {props?.offer?.pinned && ( | |||||
| <PinIcon vertical={props.vertical} isMyOffer={props.isMyOffer} /> | |||||
| )} | |||||
| {props.isMyOffer ? ( | {props.isMyOffer ? ( | ||||
| <> | <> | ||||
| <RemoveIconContainer | <RemoveIconContainer | ||||
| <PinOutlinedIcon /> | <PinOutlinedIcon /> | ||||
| </PinIconContainer> | </PinIconContainer> | ||||
| )} | )} | ||||
| {props?.offer?.pinned && ( | |||||
| <PinIcon vertical={props.vertical} isMyOffer={props.isMyOffer} /> | |||||
| )} | |||||
| </ButtonsContainer> | </ButtonsContainer> | ||||
| </OfferFlexContainer> | </OfferFlexContainer> | ||||
| </OfferCardContainer> | </OfferCardContainer> |
| text-overflow: ellipsis; | text-overflow: ellipsis; | ||||
| max-height: 33px; | max-height: 33px; | ||||
| margin-bottom: 28px; | margin-bottom: 28px; | ||||
| max-width: calc(100% - 200px); | |||||
| @media (max-width: 550px) { | @media (max-width: 550px) { | ||||
| width: 100%; | width: 100%; | ||||
| font-size: 18px; | font-size: 18px; | ||||
| } | } | ||||
| `; | `; | ||||
| export const PinIcon = styled(Pin)` | 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)` | export const CategoryIcon = styled(Category)` | ||||
| width: 14px; | width: 14px; |
| > | > | ||||
| {props.children} | {props.children} | ||||
| <ContentRightCardContainer container spacing={2}> | <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} | {props.rightCard} | ||||
| </RightCard> | </RightCard> | ||||
| </ContentRightCardContainer> | </ContentRightCardContainer> |
| locations: "locations", | locations: "locations", | ||||
| mineOffers: "users", | mineOffers: "users", | ||||
| removeOffer: "/users/{userId}/offers/{offerId}", | removeOffer: "/users/{userId}/offers/{offerId}", | ||||
| pinOffer: "offers/{id}/pin", | |||||
| pinOffer: "admin/offers/{id}/pin", | |||||
| }, | }, | ||||
| chat: { | chat: { | ||||
| getChat: "chats", | getChat: "chats", |