| @@ -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; | |||
| @@ -17,6 +17,9 @@ export const ReviewsBox = styled(Box)` | |||
| position: relative; | |||
| top: -15px; | |||
| `} | |||
| @media (max-width: 1350px) { | |||
| min-width: 0; | |||
| } | |||
| /* margin-top: ${(props) => (props.profile ? "60px" : "0")}; */ | |||
| @media (max-width: 600px) { | |||
| position: relative; | |||
| @@ -10,13 +10,14 @@ import { | |||
| const ProfileLayout = (props) => { | |||
| return ( | |||
| <ProfileLayoutContainer | |||
| isAdmin={props.isAdmin} | |||
| singleOffer={props.singleOffer} | |||
| profile={props.profile} | |||
| > | |||
| {props.children} | |||
| <ContentRightCardContainer container spacing={2}> | |||
| <Content sm={12} md={9} lg={9} item>{props.content}</Content> | |||
| <RightCard sm={0} md={3} 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> | |||
| @@ -31,6 +32,7 @@ ProfileLayout.propTypes = { | |||
| rightCard: PropTypes.node, | |||
| singleOffer: PropTypes.bool, | |||
| profile: PropTypes.bool, | |||
| isAdmin: PropTypes.bool, | |||
| }; | |||
| export default ProfileLayout; | |||
| @@ -11,8 +11,8 @@ export const ProfileLayoutContainer = styled(Container)` | |||
| position: relative; | |||
| /* flex: 1; */ | |||
| height: 100%; | |||
| @media (max-width: 1200px) { | |||
| padding-right: 36px; | |||
| @media (max-width: 1350px) { | |||
| padding-right: ${props => props.isAdmin ? "36px" : "0"}; | |||
| } | |||
| @media (max-width: 600px) { | |||
| padding-left: 0; | |||
| @@ -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", | |||