Parcourir la source

App now works

bugfix/app-changes
Djordje Mitrovic il y a 3 ans
Parent
révision
a2fec5ba83
32 fichiers modifiés avec 164 ajouts et 59 suppressions
  1. 2
    1
      src/components/Cards/FilterCard/Choser/SubcategoryChoser/SubcategoryChoser.js
  2. 1
    1
      src/components/Cards/FilterCard/FilterDropdown/Radio/FilterRadioDropdown.js
  3. 19
    0
      src/components/Cards/LittleOfferCard/LittleOfferCard.styled.js
  4. 5
    1
      src/components/Cards/MessageCard/MessageCard.styled.js
  5. 2
    2
      src/components/Cards/OfferCard/DeleteOffer/DeleteOffer.js
  6. 1
    1
      src/components/Cards/OfferCard/DeleteOffer/DeleteOffer.styled.js
  7. 2
    2
      src/components/Cards/OfferCard/DeleteOffer/DeleteOfferLabeledCard/DeleteOfferLabeledCard.js
  8. 5
    1
      src/components/Cards/OfferCard/DeleteOffer/DeleteOfferLabeledCard/DeleteOfferLabeledCard.styled.js
  9. 2
    1
      src/components/Cards/OfferCard/DeleteOffer/OfferDescription/OfferDescription.js
  10. 2
    0
      src/components/Cards/RequestExchangeCard/RequestExchangeCard.styled.js
  11. 3
    1
      src/components/Cards/UserReviewsCard/UserReviewsSingleCard/ReviewQuote/ReviewQuote.styled.js
  12. 15
    7
      src/components/CreateReview/CreateReview.styled.js
  13. 2
    1
      src/components/CreateReview/FirstStep/FirstStepCreateReview.js
  14. 5
    3
      src/components/CreateReview/FirstStep/FirstStepCreateReview.styled.js
  15. 13
    13
      src/components/CreateReview/SecondStep/SecondStepCreateReview.js
  16. 13
    1
      src/components/CreateReview/SecondStep/SecondStepCreateReview.styled.js
  17. 2
    1
      src/components/DirectChat/DirectChat.js
  18. 1
    1
      src/components/DirectChat/DirectChatContent/DirectChatContent.styled.js
  19. 5
    1
      src/components/DirectChat/DirectChatContent/DirectChatContentHeader/DirectChatContentHeader.js
  20. 7
    0
      src/components/DirectChat/DirectChatContent/DirectChatContentHeader/DirectChatContentHeader.styled.js
  21. 7
    1
      src/components/Header/Drawer/Buttons/MyProfileButton/MyProfileButton.js
  22. 8
    2
      src/components/ItemDetails/ItemDetailsHeaderCard/ItemDetailsHeaderCard.js
  23. 6
    1
      src/components/Popovers/MyMessages/MyMessages.js
  24. 7
    2
      src/components/UserReviews/UserReviews.js
  25. 3
    1
      src/components/UserReviews/UserReviews.styled.js
  26. 1
    0
      src/constants/chatConstants.js
  27. 2
    0
      src/i18n/resources/rs.js
  28. 5
    5
      src/pages/AdminHomePage/AdminLocationsPage/AdminLocationsPage.styled.js
  29. 2
    2
      src/request/index.js
  30. 2
    2
      src/store/middleware/accessTokensMiddleware.js
  31. 8
    2
      src/util/helpers/chatHelper.js
  32. 6
    2
      src/util/helpers/messageHelper.js

+ 2
- 1
src/components/Cards/FilterCard/Choser/SubcategoryChoser/SubcategoryChoser.js Voir le fichier

if ( if (
(filters.category.selectedCategoryLocally && (filters.category.selectedCategoryLocally &&
!("_id" in filters.category.selectedCategoryLocally)) || !("_id" in filters.category.selectedCategoryLocally)) ||
filters.category.selectedCategoryLocally?._id === 0
filters.category.selectedCategoryLocally?._id === 0 ||
!filters.category.selectedCategoryLocally
) { ) {
setIsOpened(false); setIsOpened(false);
setIsDisabled(true); setIsDisabled(true);

+ 1
- 1
src/components/Cards/FilterCard/FilterDropdown/Radio/FilterRadioDropdown.js Voir le fichier

fullWidth fullWidth
checked={ checked={
(props?.selected && !("_id" in props?.selected)) || (props?.selected && !("_id" in props?.selected)) ||
props?.selected?._id === 0
props?.selected?._id === 0 || !props?.selected
} }
onChange={props.setSelected} onChange={props.setSelected}
/> />

+ 19
- 0
src/components/Cards/LittleOfferCard/LittleOfferCard.styled.js Voir le fichier

display: flex; display: flex;
flex-direction: row; flex-direction: row;
position: relative; position: relative;
@media (max-width: 600px) {
width: 211px;
}
` `
export const OfferImage = styled.img` export const OfferImage = styled.img`
width: 54px; width: 54px;
` `
export const OfferDetails = styled(Box)` export const OfferDetails = styled(Box)`
display: flex; display: flex;
text-align: left;
flex-direction: column; flex-direction: column;
margin-top: 25px; margin-top: 25px;
margin-left: 9px; margin-left: 9px;
position: relative; position: relative;
top: 1.5px; top: 1.5px;
right: 2px; right: 2px;
& path {
stroke-width: 1;
}
` `
export const OfferSwapsIconContainer = styled(Icon)` export const OfferSwapsIconContainer = styled(Icon)`
width: 40px; width: 40px;
width: 40px; width: 40px;
height: 40px; height: 40px;
} }
@media (max-width: 600px) {
width: 32px;
height: 32px;
top: -15px;
right: -15px;
}
` `
export const OfferSwapsIcon = styled(Swaps)` export const OfferSwapsIcon = styled(Swaps)`
width: 18px; width: 18px;
height: 18px; height: 18px;
position: relative; position: relative;
top: 10px; top: 10px;
@media (max-width: 600px) {
width: 14px;
height: 14px;
top: 2px;
left: -4px;
}
` `

+ 5
- 1
src/components/Cards/MessageCard/MessageCard.styled.js Voir le fichier

overflow: hidden; overflow: hidden;
border-radius: 100%; border-radius: 100%;
@media (max-width: 600px) { @media (max-width: 600px) {
display: none;
width: 18px;
height: 18px;
min-width: 18px;
} }
`; `;
export const MessageContent = styled(Box)` export const MessageContent = styled(Box)`
min-width: 110px; min-width: 110px;
@media (max-width: 600px) { @media (max-width: 600px) {
width: 100%; width: 100%;
margin: 0;
${props => props.ismymessage ? "margin-right: 9px;" : "margin-left: 9px;"}
} }
`; `;
export const MessageText = styled(Typography)` export const MessageText = styled(Typography)`

+ 2
- 2
src/components/Cards/OfferCard/DeleteOffer/DeleteOffer.js Voir le fichier

import useIsMobile from "../../../../hooks/useIsMobile"; import useIsMobile from "../../../../hooks/useIsMobile";
import { getImageUrl, variants } from "../../../../util/helpers/imageUrlGetter"; import { getImageUrl, variants } from "../../../../util/helpers/imageUrlGetter";
import { selectQueryString } from "../../../../store/selectors/queryStringSelectors"; import { selectQueryString } from "../../../../store/selectors/queryStringSelectors";
import OfferDescription from "./OfferDescription/OfferDescription";
import CancelButton from "./CancelButton/CancelButton"; import CancelButton from "./CancelButton/CancelButton";
import SaveButton from "./SaveButton/SaveButton"; import SaveButton from "./SaveButton/SaveButton";
import { closeModal } from "../../../../store/actions/modal/modalActions"; import { closeModal } from "../../../../store/actions/modal/modalActions";
ITEM_DETAILS_PAGE, ITEM_DETAILS_PAGE,
PROFILE_PAGE, PROFILE_PAGE,
} from "../../../../constants/pages"; } from "../../../../constants/pages";
import { OfferDescriptionContainer } from "./DeleteOfferLabeledCard/DeleteOfferLabeledCard.styled";


const DeleteOffer = (props) => { const DeleteOffer = (props) => {
const dispatch = useDispatch(); const dispatch = useDispatch();
)} )}
/> />
</OfferImageContainer> </OfferImageContainer>
<OfferDescription
<OfferDescriptionContainer
offerName={props.offer.name} offerName={props.offer.name}
categoryName={props.offer.category.name} categoryName={props.offer.category.name}
/> />

+ 1
- 1
src/components/Cards/OfferCard/DeleteOffer/DeleteOffer.styled.js Voir le fichier

border-radius: 2px; border-radius: 2px;


@media screen and (max-width: 600px) { @media screen and (max-width: 600px) {
margin-right: 13px;
/* margin-right: 13px; */
} }
`; `;



+ 2
- 2
src/components/Cards/OfferCard/DeleteOffer/DeleteOfferLabeledCard/DeleteOfferLabeledCard.js Voir le fichier

import React from "react"; import React from "react";
import PropTypes from "prop-types"; import PropTypes from "prop-types";
import { import {
OfferDescriptionContainer,
OfferImage, OfferImage,
OfferImageContainer, OfferImageContainer,
OfferInfo, OfferInfo,
getImageUrl, getImageUrl,
variants, variants,
} from "../../../../../util/helpers/imageUrlGetter"; } from "../../../../../util/helpers/imageUrlGetter";
import OfferDescription from "../OfferDescription/OfferDescription";
import useIsMobile from "../../../../../hooks/useIsMobile"; import useIsMobile from "../../../../../hooks/useIsMobile";


const DeleteOfferLabeledCard = (props) => { const DeleteOfferLabeledCard = (props) => {
)} )}
/> />
</OfferImageContainer> </OfferImageContainer>
<OfferDescription
<OfferDescriptionContainer
offerName={props.offer.name} offerName={props.offer.name}
categoryName={props.offer.category.name} categoryName={props.offer.category.name}
/> />

+ 5
- 1
src/components/Cards/OfferCard/DeleteOffer/DeleteOfferLabeledCard/DeleteOfferLabeledCard.styled.js Voir le fichier

import selectedTheme from "../../../../../themes"; import selectedTheme from "../../../../../themes";
import { ReactComponent as Remove } from "../../../../../assets/images/svg/trash-gold.svg"; import { ReactComponent as Remove } from "../../../../../assets/images/svg/trash-gold.svg";
import { IconButton } from "../../../../Buttons/IconButton/IconButton"; import { IconButton } from "../../../../Buttons/IconButton/IconButton";
import OfferDescription from "../OfferDescription/OfferDescription";
export const OfferInfo = styled(Box)` export const OfferInfo = styled(Box)`
width: 211px; width: 211px;
height: 90px; height: 90px;
border-radius: 2px; border-radius: 2px;


@media screen and (max-width: 600px) { @media screen and (max-width: 600px) {
margin-right: 13px;
/* margin-right: 13px; */
} }
`; `;


export const RemoveIcon = styled(Remove)` export const RemoveIcon = styled(Remove)`
cursor: default; cursor: default;
`; `;
export const OfferDescriptionContainer = styled(OfferDescription)`
margin-left: 0;
`

+ 2
- 1
src/components/Cards/OfferCard/DeleteOffer/OfferDescription/OfferDescription.js Voir le fichier



const OfferDescription = (props) => { const OfferDescription = (props) => {
return ( return (
<OfferDescriptionContainer>
<OfferDescriptionContainer className={props?.className}>
<OfferDescriptionTitle>{props.offerName}</OfferDescriptionTitle> <OfferDescriptionTitle>{props.offerName}</OfferDescriptionTitle>
<OfferCategoryContainer> <OfferCategoryContainer>
<CategoryIconContainer <CategoryIconContainer
OfferDescription.propTypes = { OfferDescription.propTypes = {
offerName: PropTypes.string, offerName: PropTypes.string,
categoryName: PropTypes.string, categoryName: PropTypes.string,
className: PropTypes.string,
}; };


export default OfferDescription; export default OfferDescription;

+ 2
- 0
src/components/Cards/RequestExchangeCard/RequestExchangeCard.styled.js Voir le fichier

min-width: 110px; min-width: 110px;
@media (max-width: 600px) { @media (max-width: 600px) {
width: 100%; width: 100%;
margin: 0;
${props => props.ismymessage ? "margin-right: 9px;" : "margin-left: 9px;"}
} }
`; `;
export const MessageText = styled(Typography)` export const MessageText = styled(Typography)`

+ 3
- 1
src/components/Cards/UserReviewsCard/UserReviewsSingleCard/ReviewQuote/ReviewQuote.styled.js Voir le fichier

export const ThumbContainer = styled(Grid)` export const ThumbContainer = styled(Grid)`
max-width: 20px; max-width: 20px;
`; `;
export const ReviewQuoteTextContainer = styled(Grid)``;
export const ReviewQuoteTextContainer = styled(Box)`
flex: 1;
`;
export const ReviewQuoteText = styled(Typography)` export const ReviewQuoteText = styled(Typography)`
font-family: ${selectedTheme.fonts.textFont}; font-family: ${selectedTheme.fonts.textFont};
font-size: 16px; font-size: 16px;

+ 15
- 7
src/components/CreateReview/CreateReview.styled.js Voir le fichier

max-width: 100vw; max-width: 100vw;
left: 0; left: 0;
top: 0; top: 0;
padding: 0 30px;
padding: 0 18px;
} }
`; `;
export const NextButton = styled(PrimaryButton)` export const NextButton = styled(PrimaryButton)`
@media (max-width: 600px) { @media (max-width: 600px) {
height: 42px; height: 42px;
position: absolute; position: absolute;
bottom: 15px;
width: calc(100% - 48px);
bottom: 9px;
width: calc(100vw - 36px);
left: 0; left: 0;
margin-left: 24px;
margin-left: 9px;
} }
`; `;
export const CloseButton = styled(IconButton)` export const CloseButton = styled(IconButton)`
top: 36px; top: 36px;
right: 36px; right: 36px;
@media (max-width: 600px) { @media (max-width: 600px) {
top: 24px;
right: 24px;
top: 32px;
right: 22px;
} }
`; `;
export const CloseIcon = styled(Close)` export const CloseIcon = styled(Close)`
left: 36px; left: 36px;


@media (max-width: 600px) { @media (max-width: 600px) {
top: 24px;
top: 40px;
left: 24px; left: 24px;
width: 18px; width: 18px;
height: 18px; height: 18px;
margin-bottom: 24px; margin-bottom: 24px;
} }
`; `;
export const CreateReviewFlexContainer = styled(Box)`
@media (max-width: 600px) {
width: 100vw;
height: 100vh;
display: flex;
flex-direction: column;
}
`

+ 2
- 1
src/components/CreateReview/FirstStep/FirstStepCreateReview.js Voir le fichier

const FirstStepCreateReview = (props) => { const FirstStepCreateReview = (props) => {
const offer = props.offer; const offer = props.offer;
const interlocutor = props.interlocutor; const interlocutor = props.interlocutor;
console.log(props);
const { t } = useTranslation(); const { t } = useTranslation();
const handleSubmit = (values) => { const handleSubmit = (values) => {
props.goToNextStep(values); props.goToNextStep(values);
)} )}
/> />
</ProfileImageContainer> </ProfileImageContainer>
<ProfileName>{interlocutor.name}</ProfileName>
<ProfileName>{interlocutor.company.name}</ProfileName>
<LittleOfferCard <LittleOfferCard
image={offer?.images[0]} image={offer?.images[0]}
name={offer?.name} name={offer?.name}

+ 5
- 3
src/components/CreateReview/FirstStep/FirstStepCreateReview.styled.js Voir le fichier

text-align: center; text-align: center;
padding: 36px; padding: 36px;
@media (max-width: 600px) { @media (max-width: 600px) {
padding: 18px;
padding: 0;
padding-top: 36px;
flex: 1;
} }
`; `;
export const CreateReviewTitle = styled(Typography)` export const CreateReviewTitle = styled(Typography)`
text-align: left; text-align: left;
${props => props.exchange && `background-color: ${selectedTheme.colors.backgroundSponsoredColor};`} ${props => props.exchange && `background-color: ${selectedTheme.colors.backgroundSponsoredColor};`}
@media (max-width: 600px) { @media (max-width: 600px) {
height: 33px;
height: 40px;
font-size: 14px; font-size: 14px;
margin-bottom: 12px;
margin-bottom: 18px;
} }
`; `;
export const SelectOption = styled(Option)` export const SelectOption = styled(Option)`

+ 13
- 13
src/components/CreateReview/SecondStep/SecondStepCreateReview.js Voir le fichier

: t("reviews.modalTitle")} : t("reviews.modalTitle")}
</CreateReviewTitle> </CreateReviewTitle>
<ReviewCard <ReviewCard
givingReview
profileReviews={[
{
name: mineProfile?.company?.name,
image: mineProfile?.image,
offerName: props?.offer?.name,
offerImage: props?.offer?.images[0],
isGoodCommunication: props.review?.correctCommunication,
isSuccessfulSwap: props.review?.exchangeSucceed,
quote: props.review.comment,
},
]}
givingReview={{
name: mineProfile?.company?.name,
image: mineProfile?.image,
offerName: props?.offer?.name,
offerImage: props?.offer?.images[0],
isGoodCommunication: props.review?.correctCommunication,
isSuccessfulSwap: props.review?.exchangeSucceed,
quote: props.review.comment,
}}
/>
<NextButton
removingReview={props.removingReview}
onClick={goToNextStep}
/> />
<NextButton removingReview={props.removingReview} onClick={goToNextStep} />
</SecondStepCreateReviewContainer> </SecondStepCreateReviewContainer>
); );
}; };

+ 13
- 1
src/components/CreateReview/SecondStep/SecondStepCreateReview.styled.js Voir le fichier

export const SecondStepCreateReviewContainer = styled(Box)` export const SecondStepCreateReviewContainer = styled(Box)`
padding: 36px; padding: 36px;
@media (max-width: 600px) { @media (max-width: 600px) {
padding: 18px;
padding: 0;
padding-top: 36px;
} }
`; `;
export const ReviewCard = styled(UserReviews)` export const ReviewCard = styled(UserReviews)`
margin: 0; margin: 0;
} }
} }
& * {
overflow:hidden;
}
@media (max-width: 600px) {
position: relative;
top: -24px;
& > div {
position: static;
margin-top: 0px;
}
}
`; `;

+ 2
- 1
src/components/DirectChat/DirectChat.js Voir le fichier

import { convertLocalDateToUTCDate } from "../../util/helpers/dateHelpers"; import { convertLocalDateToUTCDate } from "../../util/helpers/dateHelpers";
import requesterStatus from "../../constants/requesterStatus"; import requesterStatus from "../../constants/requesterStatus";
import exchangeStatus from "../../constants/exchangeStatus"; import exchangeStatus from "../../constants/exchangeStatus";
import { NEW_CHAT } from "../../constants/chatConstants";


const DirectChat = () => { const DirectChat = () => {
const chat = useSelector(selectSelectedChat); const chat = useSelector(selectSelectedChat);
}, [allChats, routeMatch, requester]); }, [allChats, routeMatch, requester]);


const refreshChat = () => { const refreshChat = () => {
if (routeMatch.params?.chatId === "newMessage") {
if (routeMatch.params?.chatId === NEW_CHAT) {
dispatch(fetchOneOffer(location.state.offerId)); dispatch(fetchOneOffer(location.state.offerId));
dispatch(setOneChat({})); dispatch(setOneChat({}));
} else { } else {

+ 1
- 1
src/components/DirectChat/DirectChatContent/DirectChatContent.styled.js Voir le fichier

/* justify-content: flex-end; */ /* justify-content: flex-end; */
/* align-items: flex-end; */ /* align-items: flex-end; */
@media (max-width: 600px) { @media (max-width: 600px) {
padding: 18px 0;
padding: 18px 18px;
} }
&::-webkit-scrollbar { &::-webkit-scrollbar {
width: 5px; width: 5px;

+ 5
- 1
src/components/DirectChat/DirectChatContent/DirectChatContentHeader/DirectChatContentHeader.js Voir le fichier

<DirectChatHeaderStatusContainer> <DirectChatHeaderStatusContainer>
<DirectChatHeaderStatusText> <DirectChatHeaderStatusText>
{props.exchangeState === exchangeStatus.I_OFFERED {props.exchangeState === exchangeStatus.I_OFFERED
? t("messages.requestSentLong")
? isMobile
? t("messages.requestSentShort")
: t("messages.requestSentLong")
: isMobile
? t("messages.requestSuccessfulShort")
: t("messages.requestSuccessfulLong")} : t("messages.requestSuccessfulLong")}
</DirectChatHeaderStatusText> </DirectChatHeaderStatusText>
</DirectChatHeaderStatusContainer> </DirectChatHeaderStatusContainer>

+ 7
- 0
src/components/DirectChat/DirectChatContent/DirectChatContentHeader/DirectChatContentHeader.styled.js Voir le fichier

height: 39px; height: 39px;
width: 100%; width: 100%;
padding: 9px 36px; padding: 9px 36px;
@media (max-width: 600px) {
height: 36px;
padding: 8px 18px;
}
`; `;
export const DirectChatHeaderStatusText = styled(Typography)` export const DirectChatHeaderStatusText = styled(Typography)`
font-family: ${selectedTheme.fonts.textFont}; font-family: ${selectedTheme.fonts.textFont};
font-size: 16px; font-size: 16px;
line-height: 21px; line-height: 21px;
color: white; color: white;
@media (max-width: 600px) {
font-size: 14px;
}
`; `;

+ 7
- 1
src/components/Header/Drawer/Buttons/MyProfileButton/MyProfileButton.js Voir le fichier

import { selectProfileName } from "../../../../../store/selectors/profileSelectors"; import { selectProfileName } from "../../../../../store/selectors/profileSelectors";
import { selectUserId } from "../../../../../store/selectors/loginSelectors"; import { selectUserId } from "../../../../../store/selectors/loginSelectors";
import history from "../../../../../store/utils/history"; import history from "../../../../../store/utils/history";
import { PROFILE_PAGE } from "../../../../../constants/pages";
import { replaceInRoute } from "../../../../../util/helpers/routeHelpers";


const MyProfileButton = (props) => { const MyProfileButton = (props) => {
const name = useSelector(selectProfileName); const name = useSelector(selectProfileName);
const { t } = useTranslation(); const { t } = useTranslation();
const handleClick = () => { const handleClick = () => {
props.toggleDrawer(); props.toggleDrawer();
history.push(`/profile/${userId}`);
history.push(
replaceInRoute(PROFILE_PAGE, {
profileId: userId,
})
);
}; };
return ( return (
<DrawerButton onClick={handleClick}> <DrawerButton onClick={handleClick}>

+ 8
- 2
src/components/ItemDetails/ItemDetailsHeaderCard/ItemDetailsHeaderCard.js Voir le fichier

DIRECT_CHAT_PAGE, DIRECT_CHAT_PAGE,
PROFILE_PAGE, PROFILE_PAGE,
} from "../../../constants/pages"; } from "../../../constants/pages";
import { NEW_CHAT } from "../../../constants/chatConstants";


const ItemDetailsHeaderCard = (props) => { const ItemDetailsHeaderCard = (props) => {
const history = useHistory(); const history = useHistory();
}); });
} else { } else {
if (offer?.user?._id !== userId) { if (offer?.user?._id !== userId) {
history.push(`/messages/newMessage`, {
offerId: offer?._id,
history.push({
pathname: replaceInRoute(DIRECT_CHAT_PAGE, {
chatId: NEW_CHAT,
}),
state: {
offerId: offer?._id,
},
}); });
} }
} }

+ 6
- 1
src/components/Popovers/MyMessages/MyMessages.js Voir le fichier

}, [chats]); }, [chats]);
const goToMessages = () => { const goToMessages = () => {
if (lastChats.length !== 0) { if (lastChats.length !== 0) {
history.push(`/messages/${chats[0].chat?._id}`);
console.log(chats);
history.push({
pathname: replaceInRoute(DIRECT_CHAT_PAGE, {
chatId: chats[0]._id,
}),
});
props.closePopover(); props.closePopover();
} else { } else {
makeErrorToastMessage(t("messages.noMessagesToast")); makeErrorToastMessage(t("messages.noMessagesToast"));

+ 7
- 2
src/components/UserReviews/UserReviews.js Voir le fichier

return mineUserId; return mineUserId;
} }
return offer?.user?._id; return offer?.user?._id;
}, [offer]);
}, [offer, routeMatch.params]);


useEffect(() => { useEffect(() => {
if (!props?.givingReview && userId) { if (!props?.givingReview && userId) {
} }
}, [props.givingReview, userId]); }, [props.givingReview, userId]);


console.log(props);
const lastThreeReviews = useMemo(() => { const lastThreeReviews = useMemo(() => {
if (props.givingReview) return [props.givingReview];
if (props.isProfileReviews && Array.isArray(reviews) && !props.isAdmin) { if (props.isProfileReviews && Array.isArray(reviews) && !props.isAdmin) {
return reviews.filter((singleReview) => { return reviews.filter((singleReview) => {
let userWhoRecievedReview = let userWhoRecievedReview =
}; };


return ( return (
<UserReviewsContainer className={props.className}>
<UserReviewsContainer
className={props.className}
givingReview={props.givingReview}
>
{!props.givingReview && {!props.givingReview &&
(isLoadingReview || isLoadingReview === undefined) ? ( (isLoadingReview || isLoadingReview === undefined) ? (
<SkeletonUserReviews /> <SkeletonUserReviews />

+ 3
- 1
src/components/UserReviews/UserReviews.styled.js Voir le fichier

import selectedTheme from "../../themes"; import selectedTheme from "../../themes";
import { ReactComponent as DownArrow } from "../../assets/images/svg/up-arrow.svg"; import { ReactComponent as DownArrow } from "../../assets/images/svg/up-arrow.svg";


export const UserReviewsContainer = styled(Box)``;
export const UserReviewsContainer = styled(Box)`
${(props) => props.givingReview && `overflow: hidden;`}
`;


export const ReviewsBox = styled(Box)` export const ReviewsBox = styled(Box)`
width: 100%; width: 100%;

+ 1
- 0
src/constants/chatConstants.js Voir le fichier

export const NEW_CHAT = "newChat"

+ 2
- 0
src/i18n/resources/rs.js Voir le fichier

acceptedRequest: "Prihvaćeno", acceptedRequest: "Prihvaćeno",
declineRequest: "Odbij", declineRequest: "Odbij",
requestSuccessfulLong: "Uspešno ste ostvarili trampu sa ovom kompanijom.", requestSuccessfulLong: "Uspešno ste ostvarili trampu sa ovom kompanijom.",
requestSuccessfulShort: "Uspešno ste otvarili trampu.",
requestSentLong: "Ponudili ste trampu kompaniji. Čeka se odgovor...", requestSentLong: "Ponudili ste trampu kompaniji. Čeka se odgovor...",
requestSentShort: "Ponudili ste trampu kompaniji.",
}, },
editProfile: { editProfile: {
website: "Web Sajt", website: "Web Sajt",

+ 5
- 5
src/pages/AdminHomePage/AdminLocationsPage/AdminLocationsPage.styled.js Voir le fichier

padding: 18px; padding: 18px;
min-height: (100vh - 72px); min-height: (100vh - 72px);
padding-bottom: 100px; padding-bottom: 100px;
top: 65px;
top: 38px;
} }
`; `;
export const AdminLocationsHeader = styled(Header)` export const AdminLocationsHeader = styled(Header)`
top: 0; top: 0;
@media (max-width: 600px) { @media (max-width: 600px) {
top: -5px;
top: 0px;
margin-top: 0px; margin-top: 0px;
& > div { & > div {
margin-top: -10px;
margin-top: 0px;
} }
& > div > div > div:nth-child(1) {
top: 15px;
& > div > div > div {
top: 25px;
left: 0; left: 0;
} }
} }

+ 2
- 2
src/request/index.js Voir le fichier

// baseURL: "http://192.168.88.175:3005/", // baseURL: "http://192.168.88.175:3005/",
// baseURL: "http://192.168.88.143:3001/", // DULE // baseURL: "http://192.168.88.143:3001/", // DULE
// baseURL: "https://trampa-api.dilig.net/", // baseURL: "https://trampa-api.dilig.net/",
// baseURL: "https://trampa-api-test.dilig.net/",
baseURL: "http://localhost:3001/",
baseURL: "https://trampa-api-test.dilig.net/",
// baseURL: "http://localhost:3001/",
// baseURL: process.env.REACT_APP_BASE_API_URL, // baseURL: process.env.REACT_APP_BASE_API_URL,
headers: { headers: {
"Content-Type": "application/json", "Content-Type": "application/json",

+ 2
- 2
src/store/middleware/accessTokensMiddleware.js Voir le fichier

// const baseURL = "http://192.168.88.143:3001/"; // DULE // const baseURL = "http://192.168.88.143:3001/"; // DULE
// const baseURL = "http://192.168.88.175:3005/"; // const baseURL = "http://192.168.88.175:3005/";
// const baseURL = "https://trampa-api.dilig.net/"; // const baseURL = "https://trampa-api.dilig.net/";
// const baseURL = "https://trampa-api-test.dilig.net/";
const baseURL = "https://trampa-api-test.dilig.net/";
// const baseURL = "http://192.168.88.150:3001/"; // DJOLE // const baseURL = "http://192.168.88.150:3001/"; // DJOLE
const baseURL = "http://localhost:3001/";
// const baseURL = "http://localhost:3001/";
// const baseURL = process.env.REACT_APP_BASE_API_URL // const baseURL = process.env.REACT_APP_BASE_API_URL


//Interceptor unique name //Interceptor unique name

+ 8
- 2
src/util/helpers/chatHelper.js Voir le fichier

import { NEW_CHAT } from "../../constants/chatConstants";
import { DIRECT_CHAT_PAGE } from "../../constants/pages"; import { DIRECT_CHAT_PAGE } from "../../constants/pages";
import history from "../../store/utils/history"; import history from "../../store/utils/history";
import { replaceInRoute } from "./routeHelpers"; import { replaceInRoute } from "./routeHelpers";
history.push(replaceInRoute(DIRECT_CHAT_PAGE, { chatId: chatItem?._id })); history.push(replaceInRoute(DIRECT_CHAT_PAGE, { chatId: chatItem?._id }));
} else { } else {
if (offer?.user?._id !== userId) { if (offer?.user?._id !== userId) {
history.push(`/messages/newMessage`, {
offerId: offer?._id,
history.push({
pathname: replaceInRoute(DIRECT_CHAT_PAGE, {
chatId: NEW_CHAT,
}),
state: {
offerId: offer?._id,
},
}); });
} }
} }

+ 6
- 2
src/util/helpers/messageHelper.js Voir le fichier

import { NEW_CHAT } from "../../constants/chatConstants";
import { DIRECT_CHAT_PAGE } from "../../constants/pages"; import { DIRECT_CHAT_PAGE } from "../../constants/pages";
import history from "../../store/utils/history"; import history from "../../store/utils/history";
import { replaceInRoute } from "./routeHelpers"; import { replaceInRoute } from "./routeHelpers";
); );
} else { } else {
if (offer?.offer?.userId !== userId) { if (offer?.offer?.userId !== userId) {
history.push(replaceInRoute(DIRECT_CHAT_PAGE, { chatId: "newMessage" }), {
offerId: offer?.offer?._id,
history.push({
pathname: replaceInRoute(DIRECT_CHAT_PAGE, { chatId: NEW_CHAT }),
state: {
offerId: offer?.offer?._id,
},
}); });
} }
} }

Chargement…
Annuler
Enregistrer