| PinIconContainer, | PinIconContainer, | ||||
| PinOutlinedIcon, | PinOutlinedIcon, | ||||
| ButtonsContainer, | ButtonsContainer, | ||||
| TooltipInnerContainer, | |||||
| } from "./OfferCard.styled"; | } from "./OfferCard.styled"; | ||||
| import { ReactComponent as Message } from "../../../assets/images/svg/mail.svg"; | import { ReactComponent as Message } from "../../../assets/images/svg/mail.svg"; | ||||
| import { useHistory } from "react-router-dom"; | import { useHistory } from "react-router-dom"; | ||||
| toggleDeleteOfferModal, | toggleDeleteOfferModal, | ||||
| toggleEditOfferModal, | toggleEditOfferModal, | ||||
| } from "../../../store/actions/modal/modalActions"; | } from "../../../store/actions/modal/modalActions"; | ||||
| import { Tooltip } from "@mui/material"; | |||||
| import { useTranslation } from "react-i18next"; | |||||
| const OfferCard = (props) => { | const OfferCard = (props) => { | ||||
| const dispatch = useDispatch(); | const dispatch = useDispatch(); | ||||
| const userId = useSelector(selectUserId); | const userId = useSelector(selectUserId); | ||||
| const { isMobile } = useIsMobile(); | const { isMobile } = useIsMobile(); | ||||
| const date = formatDateLocale(new Date(props.offer?._created)); | const date = formatDateLocale(new Date(props.offer?._created)); | ||||
| const { t } = useTranslation(); | |||||
| const pinOffer = (event) => { | const pinOffer = (event) => { | ||||
| event.stopPropagation(); | event.stopPropagation(); | ||||
| )} | )} | ||||
| {props.isMyOffer ? ( | {props.isMyOffer ? ( | ||||
| <> | <> | ||||
| <RemoveIconContainer | |||||
| vertical={props.vertical} | |||||
| onClick={openRemoveModal} | |||||
| > | |||||
| <RemoveIcon /> | |||||
| </RemoveIconContainer> | |||||
| <EditIconContainer | |||||
| vertical={props.vertical} | |||||
| onClick={openEditOfferModal} | |||||
| > | |||||
| <EditIcon /> | |||||
| </EditIconContainer> | |||||
| <Tooltip title={t("deleteOffer.tooltip")}> | |||||
| <TooltipInnerContainer> | |||||
| <RemoveIconContainer | |||||
| vertical={props.vertical} | |||||
| onClick={openRemoveModal} | |||||
| > | |||||
| <RemoveIcon /> | |||||
| </RemoveIconContainer> | |||||
| </TooltipInnerContainer> | |||||
| </Tooltip> | |||||
| <Tooltip title={t("offer.tooltip")}> | |||||
| <TooltipInnerContainer> | |||||
| <EditIconContainer | |||||
| vertical={props.vertical} | |||||
| onClick={openEditOfferModal} | |||||
| > | |||||
| <EditIcon /> | |||||
| </EditIconContainer> | |||||
| </TooltipInnerContainer> | |||||
| </Tooltip> | |||||
| </> | </> | ||||
| ) : props.aboveChat ? ( | ) : props.aboveChat ? ( | ||||
| <LikeIconContainer | <LikeIconContainer | ||||
| <LikeIcon disabled={props.disabledReviews} /> | <LikeIcon disabled={props.disabledReviews} /> | ||||
| </LikeIconContainer> | </LikeIconContainer> | ||||
| ) : ( | ) : ( | ||||
| <MessageIcon | |||||
| showMessageIcon={showMessageIcon} | |||||
| vertical={props.vertical} | |||||
| onClick={messageUser} | |||||
| > | |||||
| <Message /> | |||||
| </MessageIcon> | |||||
| <Tooltip title={t("messages.tooltip")}> | |||||
| <TooltipInnerContainer> | |||||
| <MessageIcon | |||||
| showMessageIcon={showMessageIcon} | |||||
| vertical={props.vertical} | |||||
| onClick={messageUser} | |||||
| > | |||||
| <Message /> | |||||
| </MessageIcon> | |||||
| </TooltipInnerContainer> | |||||
| </Tooltip> | |||||
| )} | )} | ||||
| {props.isAdmin && !props.pinned && ( | {props.isAdmin && !props.pinned && ( | ||||
| <PinIconContainer | <PinIconContainer |
| `} | `} | ||||
| } | } | ||||
| `; | `; | ||||
| export const TooltipInnerContainer = styled(Box)``; |
| USERS_DELETE_TYPE, | USERS_DELETE_TYPE, | ||||
| USERS_UNBLOCK_TYPE, | USERS_UNBLOCK_TYPE, | ||||
| } from "../../../constants/adminTypeConstants"; | } from "../../../constants/adminTypeConstants"; | ||||
| import { Tooltip } from "@mui/material"; | |||||
| const ProfileCard = (props) => { | const ProfileCard = (props) => { | ||||
| const isLoading = useSelector(selectIsLoadingByActionType(PROFILE_SCOPE)); | const isLoading = useSelector(selectIsLoadingByActionType(PROFILE_SCOPE)); | ||||
| </> | </> | ||||
| )} | )} | ||||
| {(isMyProfile || props.isAdmin) && ( | {(isMyProfile || props.isAdmin) && ( | ||||
| <EditButton | |||||
| onClick={handleEditProfile} | |||||
| isAdmin={props.isAdmin} | |||||
| disabled={!props.isAdmin && profile?._blocked} | |||||
| > | |||||
| <EditIcon /> | |||||
| </EditButton> | |||||
| <Tooltip title={t("editProfile.tooltip")}> | |||||
| <EditButton | |||||
| onClick={handleEditProfile} | |||||
| isAdmin={props.isAdmin} | |||||
| disabled={!props.isAdmin && profile?._blocked} | |||||
| > | |||||
| <EditIcon /> | |||||
| </EditButton> | |||||
| </Tooltip> | |||||
| )} | )} | ||||
| </ButtonsContainer> | </ButtonsContainer> | ||||
| <ProfileInfoContainer> | <ProfileInfoContainer> |
| HeaderTop, | HeaderTop, | ||||
| UserIcon, | UserIcon, | ||||
| UserIconContainer, | UserIconContainer, | ||||
| TooltipInnerContainer, | |||||
| } from "./ItemDetailsHeaderCard.styled"; | } from "./ItemDetailsHeaderCard.styled"; | ||||
| import { ItemDetailsHeaderContainer } from "./ItemDetailsHeaderCard.styled"; | import { ItemDetailsHeaderContainer } from "./ItemDetailsHeaderCard.styled"; | ||||
| import { ReactComponent as MessageColor } from "../../../assets/images/svg/mailColor.svg"; | import { ReactComponent as MessageColor } from "../../../assets/images/svg/mailColor.svg"; | ||||
| import { getImageUrl, variants } from "../../../util/helpers/imageUrlGetter"; | import { getImageUrl, variants } from "../../../util/helpers/imageUrlGetter"; | ||||
| import { useMemo } from "react"; | import { useMemo } from "react"; | ||||
| import itemDetailsData from "../../../notFoundData/itemDetailsData"; | import itemDetailsData from "../../../notFoundData/itemDetailsData"; | ||||
| import { Tooltip } from "@mui/material"; | |||||
| import { useTranslation } from "react-i18next"; | |||||
| const ItemDetailsHeaderCard = (props) => { | const ItemDetailsHeaderCard = (props) => { | ||||
| const history = useHistory(); | const history = useHistory(); | ||||
| const chats = useSelector(selectLatestChats); | const chats = useSelector(selectLatestChats); | ||||
| const routeMatch = useRouteMatch(); | const routeMatch = useRouteMatch(); | ||||
| const { t } = useTranslation(); | |||||
| const offer = useMemo(() => { | const offer = useMemo(() => { | ||||
| if (props.offer) { | if (props.offer) { | ||||
| if (props.offer.offer._id === routeMatch.params.idProizvod) { | if (props.offer.offer._id === routeMatch.params.idProizvod) { | ||||
| <UserIcon /> | <UserIcon /> | ||||
| </UserIconContainer> | </UserIconContainer> | ||||
| ) : ( | ) : ( | ||||
| <MessageIcon onClick={() => messageUser(offer)}> | |||||
| <MessageColor /> | |||||
| </MessageIcon> | |||||
| <Tooltip title={t("messages.tooltip")}> | |||||
| <TooltipInnerContainer> | |||||
| <MessageIcon onClick={() => messageUser(offer)}> | |||||
| <MessageColor /> | |||||
| </MessageIcon> | |||||
| </TooltipInnerContainer> | |||||
| </Tooltip> | |||||
| )} | )} | ||||
| </HeaderTop> | </HeaderTop> | ||||
| {!props.singleOffer && <StatisticDetails offer={offer} />} | {!props.singleOffer && <StatisticDetails offer={offer} />} |
| margin-left: 18px; | margin-left: 18px; | ||||
| `; | `; | ||||
| export const OfferTitle = styled(Typography)` | export const OfferTitle = styled(Typography)` | ||||
| margin-bottom:12px; | |||||
| margin-bottom: 12px; | |||||
| font-family: ${selectedTheme.fonts.textFont}; | font-family: ${selectedTheme.fonts.textFont}; | ||||
| color: ${(props) => | color: ${(props) => | ||||
| props.isMyProfile | props.isMyProfile | ||||
| export const MessageIcon = styled(IconButton)` | export const MessageIcon = styled(IconButton)` | ||||
| width: 40px; | width: 40px; | ||||
| height: 40px; | height: 40px; | ||||
| position: absolute; | |||||
| top: 10px; | |||||
| right: 10px; | |||||
| background-color: ${selectedTheme.colors.primaryPurple}; | background-color: ${selectedTheme.colors.primaryPurple}; | ||||
| border-radius: 100%; | border-radius: 100%; | ||||
| padding-top: 2px; | padding-top: 2px; | ||||
| background-color: ${selectedTheme.colors.primaryIconBackgroundColor}; | background-color: ${selectedTheme.colors.primaryIconBackgroundColor}; | ||||
| `; | `; | ||||
| export const UserIcon = styled(User)``; | export const UserIcon = styled(User)``; | ||||
| export const TooltipInnerContainer = styled(Box)` | |||||
| width: 40px; | |||||
| height: 40px; | |||||
| position: absolute; | |||||
| top: 10px; | |||||
| right: 10px; | |||||
| @media (max-width: 600px) { | |||||
| width: 32px; | |||||
| height: 32px; | |||||
| } | |||||
| `; |
| descriptionLabel: "Opis:", | descriptionLabel: "Opis:", | ||||
| checkButtonLabel: "Pogledaj proizvod", | checkButtonLabel: "Pogledaj proizvod", | ||||
| offers: "Objave", | offers: "Objave", | ||||
| tooltip: "Izmeni objavu", | |||||
| }, | }, | ||||
| apiErrors: { | apiErrors: { | ||||
| somethingWentWrong: "Greška sa serverom!", | somethingWentWrong: "Greška sa serverom!", | ||||
| goBack: "Nazad na sve poruke", | goBack: "Nazad na sve poruke", | ||||
| noMessages: "Poruke nisu pronađene.", | noMessages: "Poruke nisu pronađene.", | ||||
| noMessagesSecond: "Nažalost, nemate ni jednu poruku.", | noMessagesSecond: "Nažalost, nemate ni jednu poruku.", | ||||
| tooltip: "Pošalji poruku", | |||||
| }, | }, | ||||
| editProfile: { | editProfile: { | ||||
| website: "Web Sajt*", | website: "Web Sajt*", | ||||
| labelLocationValid: "Unesite ispravnu lokaciju!", | labelLocationValid: "Unesite ispravnu lokaciju!", | ||||
| labelPhoneValid: "Unesite validan broj telefona", | labelPhoneValid: "Unesite validan broj telefona", | ||||
| labelPhoneRequired: "Broj telefona je obavezan!", | labelPhoneRequired: "Broj telefona je obavezan!", | ||||
| tooltip: "Izmeni profil", | |||||
| }, | }, | ||||
| deleteOffer: { | deleteOffer: { | ||||
| areYouSure: "Da li ste sigurni da želite da <br /> obrišete proizvod?", | areYouSure: "Da li ste sigurni da želite da <br /> obrišete proizvod?", | ||||
| cancel: "Otkaži", | cancel: "Otkaži", | ||||
| delete: "Obriši", | delete: "Obriši", | ||||
| tooltip: "Obriši objavu", | |||||
| }, | }, | ||||
| itemDetailsCard: { | itemDetailsCard: { | ||||
| description: "Opis: ", | description: "Opis: ", | ||||
| blockedProfile: "Trenutno blokiran profil", | blockedProfile: "Trenutno blokiran profil", | ||||
| blockedProfileShort: "Blokiran profil", | blockedProfileShort: "Blokiran profil", | ||||
| mineProfileBlocked: "Vaš profil je trenutno blokiran.", | mineProfileBlocked: "Vaš profil je trenutno blokiran.", | ||||
| deletedProfile: "Obrisan profil" | |||||
| deletedProfile: "Obrisan profil", | |||||
| }, | }, | ||||
| about: { | about: { | ||||
| header: { | header: { |