소스 검색

Finished partly feature 710

feature/710
djordjemitrovic00 3 년 전
부모
커밋
2a78b3792c

+ 3
- 1
src/components/Cards/OfferCard/DeleteOffer/DeleteOffer.js 파일 보기

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();

+ 3
- 3
src/components/Cards/OfferCard/OfferCard.js 파일 보기

<></> <></>
)} )}
<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>

+ 3
- 24
src/components/Cards/OfferCard/OfferCard.styled.js 파일 보기

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;

+ 2
- 2
src/layouts/ProfileLayout/ProfileLayout.js 파일 보기

> >
{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>

+ 1
- 1
src/request/apiEndpoints.js 파일 보기

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",

Loading…
취소
저장