瀏覽代碼

Merge branch 'feature/710' of https://git.dilig.net/selenaaasi/trampa-frontend

bugfix/740
djordjemitrovic00 3 年之前
父節點
當前提交
f9c04816f9

+ 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;

+ 3
- 0
src/components/UserReviews/UserReviews.styled.js 查看文件

position: relative; position: relative;
top: -15px; top: -15px;
`} `}
@media (max-width: 1350px) {
min-width: 0;
}
/* margin-top: ${(props) => (props.profile ? "60px" : "0")}; */ /* margin-top: ${(props) => (props.profile ? "60px" : "0")}; */
@media (max-width: 600px) { @media (max-width: 600px) {
position: relative; position: relative;

+ 4
- 2
src/layouts/ProfileLayout/ProfileLayout.js 查看文件

const ProfileLayout = (props) => { const ProfileLayout = (props) => {
return ( return (
<ProfileLayoutContainer <ProfileLayoutContainer
isAdmin={props.isAdmin}
singleOffer={props.singleOffer} singleOffer={props.singleOffer}
profile={props.profile} profile={props.profile}
> >
{props.children} {props.children}
<ContentRightCardContainer container spacing={2}> <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} {props.rightCard}
</RightCard> </RightCard>
</ContentRightCardContainer> </ContentRightCardContainer>
rightCard: PropTypes.node, rightCard: PropTypes.node,
singleOffer: PropTypes.bool, singleOffer: PropTypes.bool,
profile: PropTypes.bool, profile: PropTypes.bool,
isAdmin: PropTypes.bool,
}; };


export default ProfileLayout; export default ProfileLayout;

+ 2
- 2
src/layouts/ProfileLayout/ProfileLayout.styled.js 查看文件

position: relative; position: relative;
/* flex: 1; */ /* flex: 1; */
height: 100%; height: 100%;
@media (max-width: 1200px) {
padding-right: 36px;
@media (max-width: 1350px) {
padding-right: ${props => props.isAdmin ? "36px" : "0"};
} }
@media (max-width: 600px) { @media (max-width: 600px) {
padding-left: 0; padding-left: 0;

+ 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…
取消
儲存