Sfoglia il codice sorgente

Finished 2249

bugfix/2249
jovan.cirkovic 3 anni fa
parent
commit
62a6bc7e43

+ 2
- 2
src/components/About/AboutComponent.js Vedi File

@@ -16,12 +16,12 @@ const AboutComponent = forwardRef((props, ref) => {
<AboutComponentContainer ref={ref}>
<AboutHeader />
<AboutSection
title={t("about.history.title")}
// title={t("about.history.title")}
text={t("about.history.text")}
image={SectionImage1}
/>
<AboutSection
title={t("about.vision.title")}
// title={t("about.vision.title")}
text={t("about.vision.text")}
image={SectionImage2}
reverse

+ 11
- 11
src/components/About/AboutPageContent.js Vedi File

@@ -7,13 +7,13 @@ import scrollConstants from "../../constants/scrollConstants";
import { setAboutRouteSelected } from "../../store/actions/app/appActions";
import { AboutPageContainer } from "./AboutPageContent.styled";
import AboutComponent from "./AboutComponent";
import PricesComponent from "../Prices/PricesComponent";
// import PricesComponent from "../Prices/PricesComponent";
import PrivacyPolicyComponent from "../PrivacyPolicy/PrivacyPolicyComponent";
import AboutFooter from "../Footer/AboutFooter";

const AboutPageContent = () => {
const aboutRef = useRef(null);
const pricesRef = useRef(null);
// const pricesRef = useRef(null);
const privacyPolicyRef = useRef(null);
const dispatch = useDispatch();
const aboutRouteSelected = useSelector(selectAboutRouteSelected);
@@ -26,13 +26,13 @@ const AboutPageContent = () => {
dispatch(setAboutRouteSelected(scrollConstants.about.aboutPage));
}
}
if (location.state.navigation === scrollConstants.about.pricesPage) {
const yAxis = pricesRef.current.offsetTop;
window.scrollTo({ top: yAxis, behavior: "smooth" });
if (aboutRouteSelected !== scrollConstants.about.pricesPage) {
dispatch(setAboutRouteSelected(scrollConstants.about.pricesPage));
}
}
// if (location.state.navigation === scrollConstants.about.pricesPage) {
// const yAxis = pricesRef.current.offsetTop;
// window.scrollTo({ top: yAxis, behavior: "smooth" });
// if (aboutRouteSelected !== scrollConstants.about.pricesPage) {
// dispatch(setAboutRouteSelected(scrollConstants.about.pricesPage));
// }
// }
if (
location.state.navigation === scrollConstants.about.privacyPolicyPage
) {
@@ -52,7 +52,7 @@ const AboutPageContent = () => {
const listener = () => {
if (
window.scrollY >
pricesRef.current.offsetTop - window.innerHeight / 2
privacyPolicyRef.current.offsetTop - window.innerHeight / 2
) {
if (
window.scrollY >
@@ -78,7 +78,7 @@ const AboutPageContent = () => {
return (
<AboutPageContainer>
<AboutComponent ref={aboutRef} id={scrollConstants.about.aboutPage} />
<PricesComponent ref={pricesRef} id={scrollConstants.about.pricesPage} />
{/* <PricesComponent ref={pricesRef} id={scrollConstants.about.pricesPage} /> */}
<PrivacyPolicyComponent
ref={privacyPolicyRef}
id={scrollConstants.about.privacyPolicyPage}

+ 35
- 15
src/components/Cards/ProfileCard/ProfileCard.js Vedi File

@@ -75,32 +75,52 @@ const ProfileCard = (props) => {
dispatch(fetchProfileOffers(profileId));
};

let numberOfExchanges =
profile?.statistics?.exchanges?.failedExchanges +
profile?.statistics?.exchanges?.succeededExchanges;
let numberOfExchanges;
if (
profile?.statistics?.exchanges?.succeededExchanges &&
profile?.statistics?.exchanges?.failedExchanges
) {
numberOfExchanges =
profile?.statistics?.exchanges?.failedExchanges +
profile?.statistics?.exchanges?.succeededExchanges;
} else if (profile?.statistics?.exchanges?.succeededExchanges) {
numberOfExchanges = profile?.statistics?.exchanges?.succeededExchanges;
} else {
numberOfExchanges = 0;
}

let percentOfSucceededExchanges;
if (profile?.statistics?.exchanges?.succeededExchanges === 0) {
percentOfSucceededExchanges = 0;
} else {
if (
profile?.statistics?.exchanges?.succeededExchanges &&
profile?.statistics?.exchanges?.failedExchanges
) {
percentOfSucceededExchanges = Math.round(
profile.statistics.exchanges.succeededExchanges /
((profile.statistics.exchanges.succeededExchanges +
profile.statistics.exchanges.failedExchanges) /
profile?.statistics?.exchanges?.succeededExchanges /
((profile?.statistics?.exchanges?.succeededExchanges +
profile?.statistics?.exchanges?.failedExchanges) /
100)
);
} else if (profile?.statistics?.exchanges?.succeededExchanges) {
percentOfSucceededExchanges = 100;
} else {
percentOfSucceededExchanges = 0;
}

let percentOfSucceededCommunication;
if (profile?.statistics?.exchanges?.succeededCommunication === 0) {
percentOfSucceededCommunication = 0;
} else {
if (
profile?.statistics?.exchanges?.succeededCommunication &&
profile?.statistics?.exchanges?.failedCommunication
) {
percentOfSucceededCommunication = Math.round(
profile.statistics.exchanges.succeededCommunication /
((profile.statistics.exchanges.succeededCommunication +
profile.statistics.exchanges.failedCommunication) /
profile?.statistics?.exchanges?.succeededCommunication /
((profile?.statistics?.exchanges?.succeededCommunication +
profile?.statistics?.exchanges?.failedCommunication) /
100)
);
} else if (profile?.statistics?.exchanges?.succeededCommunication) {
percentOfSucceededCommunication = 100;
} else {
percentOfSucceededCommunication = 0;
}

let verifiedUser =

+ 10
- 10
src/components/Header/AboutHeader/AboutHeader.js Vedi File

@@ -19,14 +19,14 @@ const AboutHeader = () => {
},
});
};
const navigatePrices = () => {
history.replace({
state: {
clicked: true,
navigation: scrollConstants.about.pricesPage,
},
});
};
// const navigatePrices = () => {
// history.replace({
// state: {
// clicked: true,
// navigation: scrollConstants.about.pricesPage,
// },
// });
// };
const navigatePrivacyPolicy = () => {
history.replace({
state: {
@@ -43,12 +43,12 @@ const AboutHeader = () => {
>
{t("about.header.navigation")}
</LinkRoute>
<LinkRoute
{/* <LinkRoute
selected={aboutRouteSelected === scrollConstants.about.pricesPage}
onClick={navigatePrices}
>
{t("prices.header.navigation")}
</LinkRoute>
</LinkRoute> */}
<LinkRoute
selected={
aboutRouteSelected === scrollConstants.about.privacyPolicyPage

+ 2
- 2
src/components/Popovers/MyProfile/MyProfile.js Vedi File

@@ -23,7 +23,7 @@ import PropTypes from "prop-types";
import LogoutButton from "./LogoutButton/LogoutButton";
import AboutButton from "./AboutButton/AboutButton";
import PrivacyPolicyButton from "./PrivacyPolicyButton/PrivacyPolicyButton";
import PricesButton from "./PricesButton/PricesButton";
// import PricesButton from "./PricesButton/PricesButton";
import { ADMIN_HOME_PAGE, PROFILE_PAGE } from "../../../constants/pages";
import {
dynamicRouteMatches,
@@ -99,7 +99,7 @@ export const MyProfile = (props) => {
adminButtonOnClick={() => goToAdminHome()}
>
<GrayButtonsContainer>
<PricesButton closePopover={props.closePopover} />
{/* <PricesButton closePopover={props.closePopover} /> */}
<AboutButton closePopover={props.closePopover} />
<PrivacyPolicyButton closePopover={props.closePopover} />
</GrayButtonsContainer>

+ 5
- 5
src/components/PrivacyPolicy/PrivacyPolicyComponent.js Vedi File

@@ -2,15 +2,15 @@ import React, { forwardRef } from "react";
import PropTypes from "prop-types";
import PrivacyPolicyHeader from "./PrivacyPolicyHeader/PrivacyPolicyHeader";
import { PrivacyPolicyContainer } from "./PrivacyPolicyComponent.styled";
import PrivacyPolicySection from "./PrivacyPolicySection/PrivacyPolicySection";
import { useTranslation } from "react-i18next";
// import PrivacyPolicySection from "./PrivacyPolicySection/PrivacyPolicySection";
// import { useTranslation } from "react-i18next";

const PrivacyPolicyComponent = forwardRef((props, ref) => {
const { t } = useTranslation();
// const { t } = useTranslation();
return (
<PrivacyPolicyContainer id={props.id} ref={ref}>
<PrivacyPolicyHeader />
<PrivacyPolicySection
{/* <PrivacyPolicySection
title={t("privacyPolicy.firstSection.title")}
text={t("privacyPolicy.firstSection.text")}
/>
@@ -25,7 +25,7 @@ const PrivacyPolicyComponent = forwardRef((props, ref) => {
<PrivacyPolicySection
title={t("privacyPolicy.forthSection.title")}
text={t("privacyPolicy.forthSection.text")}
/>
/> */}
</PrivacyPolicyContainer>
);
});

+ 9
- 3
src/components/PrivacyPolicy/PrivacyPolicyHeader/PrivacyPolicyHeader.js Vedi File

@@ -2,15 +2,21 @@ import React from "react";
import PropTypes from "prop-types";
import { useTranslation } from "react-i18next";
import { PrivacyPolicyContainer } from "../../../pages/PrivacyPolicy/PrivacyPolicyPage.styled";
import { PrivacyPolicyHeaderLine, PrivacyPolicyHeaderParagraph, PrivacyPolicyHeaderTitle } from "./PrivacyPolicyHeader.styled";
import {
PrivacyPolicyHeaderLine,
// PrivacyPolicyHeaderParagraph,
PrivacyPolicyHeaderTitle,
} from "./PrivacyPolicyHeader.styled";

const PrivacyPolicyHeader = () => {
const { t } = useTranslation();
return (
<PrivacyPolicyContainer>
<PrivacyPolicyHeaderTitle>{t("privacyPolicy.header.title")}</PrivacyPolicyHeaderTitle>
<PrivacyPolicyHeaderTitle>
{t("privacyPolicy.header.title")}
</PrivacyPolicyHeaderTitle>
<PrivacyPolicyHeaderLine />
<PrivacyPolicyHeaderParagraph>{t("privacyPolicy.header.paragraph")}</PrivacyPolicyHeaderParagraph>
{/* <PrivacyPolicyHeaderParagraph>{t("privacyPolicy.header.paragraph")}</PrivacyPolicyHeaderParagraph> */}
</PrivacyPolicyContainer>
);
};

+ 35
- 15
src/components/ProfileMini/ProfileMini.js Vedi File

@@ -27,32 +27,52 @@ const ProfileMini = () => {
return false;
}, [offer, userId]);

let numberOfExchanges =
offer?.user?.statistics?.exchanges?.failedExchanges +
offer?.user?.statistics?.exchanges?.succeededExchanges;
let numberOfExchanges;
if (
offer?.user?.statistics?.exchanges?.succeededExchanges &&
offer?.user?.statistics?.exchanges?.failedExchanges
) {
numberOfExchanges =
offer?.user?.statistics?.exchanges?.failedExchanges +
offer?.user?.statistics?.exchanges?.succeededExchanges;
} else if (offer?.user?.statistics?.exchanges?.succeededExchanges) {
numberOfExchanges = offer?.user?.statistics?.exchanges?.succeededExchanges;
} else {
numberOfExchanges = 0;
}

let percentOfSucceededExchanges;
if (offer?.user?.statistics?.exchanges?.succeededExchanges === 0) {
percentOfSucceededExchanges = 0;
} else {
if (
offer?.user?.statistics?.exchanges?.succeededExchanges &&
offer?.user?.statistics?.exchanges?.failedExchanges
) {
percentOfSucceededExchanges = Math.round(
offer?.user?.statistics.exchanges.succeededExchanges /
((offer?.user?.statistics.exchanges.succeededExchanges +
offer?.user?.statistics.exchanges.failedExchanges) /
offer?.user?.statistics?.exchanges?.succeededExchanges /
((offer?.user?.statistics?.exchanges?.succeededExchanges +
offer?.user?.statistics?.exchanges?.failedExchanges) /
100)
);
} else if (offer?.user?.statistics?.exchanges?.succeededExchanges) {
percentOfSucceededExchanges = 100;
} else {
percentOfSucceededExchanges = 0;
}

let percentOfSucceededCommunication;
if (offer?.user?.statistics?.exchanges?.succeededCommunication === 0) {
percentOfSucceededCommunication = 0;
} else {
if (
offer?.user?.statistics?.exchanges?.succeededCommunication &&
offer?.user?.statistics?.exchanges?.failedCommunication
) {
percentOfSucceededCommunication = Math.round(
offer?.user?.statistics.exchanges.succeededCommunication /
((offer?.user?.statistics.exchanges.succeededCommunication +
offer?.user?.statistics.exchanges.failedCommunication) /
offer?.user?.statistics?.exchanges?.succeededCommunication /
((offer?.user?.statistics?.exchanges?.succeededCommunication +
offer?.user?.statistics?.exchanges?.failedCommunication) /
100)
);
} else if (offer?.user?.statistics?.exchanges?.succeededCommunication) {
percentOfSucceededCommunication = 100;
} else {
percentOfSucceededCommunication = 0;
}

let verifiedUser =

+ 6
- 5
src/i18n/resources/rs.js Vedi File

@@ -118,6 +118,7 @@ export default {
websiteError: "Unesite ispravnu adresu svog website!",
websiteRequired: "Website je obavezan!",
companyNameError: "Naziv kompanije je zauzet!",
acceptTermsCheckbox: "Saglasan sam sa pravima privatnosti",
},
forgotPassword: {
title: "Povrati lozinku",
@@ -338,18 +339,18 @@ export default {
},
about: {
header: {
title: "O Trampi",
navigation: "O nama",
title: "Priča o Trampi",
navigation: "Šta je Trampa?",
paragraph:
"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec ac augue tortor. Nulla facilisi. Cras vestibulum risus eget tincidunt egestas. Duis blandit enim sit amet dui vehicula luctus. Suspendisse id blandit arcu, vitae consequat nisi. Duis ut vestibulum tellus. Curabitur eu fringilla nisi.",
"Znate ono kada smo bili mali pa je najveću radost u školi predstavljalo menjanje sličica na odmoru? Trampa je upravo to, samo što sada više nismo đaci u školi već poslovni, odrasli, ljudi.",
},
history: {
title: "Istorija",
text: "Suspendisse non semper ligula. Nam nec neque non justo vehicula hendrerit vel ut ligula. Pellentesque venenatis leo at nisl facilisis euismod. Quisque at cursus quam. Praesent gravida metus erat, nec tempus nibh accumsan sed. Duis non ornare ipsum. Suspendisse justo metus, cursus eget efficitur vitae, imperdiet id neque. Ut vel commodo nunc. Morbi iaculis, arcu in commodo sollicitudin, est nisl feugiat mi, euismod accumsan odio ligula nec diam. Vestibulum eros est, ornare et varius sit amet, placerat sed nibh. Mauris elementum rutrum feugiat. Quisque consectetur, dui sed pharetra eleifend, augue nibh rhoncus felis, et feugiat tortor felis blandit dui. Ut gravida lacinia feugiat. In hac habitasse platea dictumst. Mauris cursus lectus ac libero ultrices lacinia. Sed vel nibh tincidunt, tristique arcu fermentum, sollicitudin lorem.",
text: "Ideja o Trampi je sinula sasvim spontano. Mladen i ja smo prijatelji iz detinjstva koji su nekada bili profesionalni latino plesači koje su kasnije drugačija životna interesovanja odvela na različite strane pa je tako Mladen otišao u preduzetnike, a ja u programere. Međutim, Trampa je učinila da nas dvoje opet budemo partneri, samo ovog puta ne plesni već poslovni. Zbog prirode biznisa kojim se Mladenova porodica bavi, neretko se desi da neke stvari ostanu da, žargonski rečeno, čuče u skladištu duži period. Neretko je to prehrambena roba i prave se veliki gubitci u samom poslovanju. Upravo se tu javila ideja o Trampi. Trampa je mesto gde rečenica ‘jedna strana u pregovorima uvek izlazi kao gubitnik’ jednostavno gubi smisao jer sa Trampom obe strane koje učestvuju pobeđuju!",
},
vision: {
title: "Naša vizija",
text: "Aenean ut risus faucibus, tempor urna id, luctus urna. Nam placerat scelerisque hendrerit. Nam tortor augue, porta sed nulla vitae, rutrum rhoncus arcu. Ut in leo turpis. Pellentesque eu laoreet orci. Nam id nisi mauris. Orci varius natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Integer nulla leo, consequat a lacus in, sollicitudin sollicitudin ex. Nunc blandit tincidunt turpis nec vestibulum. Interdum et malesuada fames ac ante ipsum primis in faucibus. Morbi tincidunt ipsum eget velit venenatis, quis sollicitudin nulla dapibus.",
text: "Predmet Trampe nije kupovina već razmena, dakle nema novčane nadoknade, sve se bazira na robnoj/uslužnoj razmeni.Trampa je razvijena sa idejom da Vaša roba nađe novu upotrebnu vrednost kod svog novog vlasnika ujedno zadovoljavajući vaše potrebe.",
},
searchOffers: "Pretražite oglase",
},

+ 17
- 6
src/pages/RegisterPages/Register/ThirdPart/ThirdPartOfRegistration.js Vedi File

@@ -1,6 +1,9 @@
import React, { useEffect } from "react";
import React, { useEffect, useState } from "react";
import PropTypes from "prop-types";
import {
CheckboxInput,
CheckboxInputContainer,
CheckboxInputText,
FormContainer,
// RegisterDescription,
} from "./ThirdPartOfRegistration.styled";
@@ -17,10 +20,11 @@ import thirdPartValidation from "../../../../validations/registerValidations/thi
import { PrimaryAnimatedButton } from "../../../../components/Styles/globalStyleComponents";

const ThirdPartOfRegistration = (props) => {
const [checkboxValue, setCheckboxValue] = useState(false);
const { t } = useTranslation();
const locations = useSelector(selectLocations);
const dispatch = useDispatch();
console.log(checkboxValue);
useEffect(() => {
dispatch(fetchLocations());
}, []);
@@ -50,7 +54,6 @@ const ThirdPartOfRegistration = (props) => {
{/* <RegisterDescription component="p" variant="p">
{t("register.descriptionThird")}
</RegisterDescription> */}

<TextField
name="phoneNumber"
placeholder={t("common.labelPhone")}
@@ -75,7 +78,6 @@ const ThirdPartOfRegistration = (props) => {
: Math.max(0, parseInt(e.target.value)).toString().slice(0, 14);
}}
/>

<AutoSuggestTextField
placeholder={t("common.labelLocation")}
data={locations.map((item) => ({ name: item.city }))}
@@ -85,7 +87,6 @@ const ThirdPartOfRegistration = (props) => {
formik.setFieldValue("location", newValue)
}
/>

<TextField
name="website"
placeholder={t("common.labelWebsite")}
@@ -97,9 +98,14 @@ const ThirdPartOfRegistration = (props) => {
helperText={formik.touched.website && formik.errors.website}
fullWidth
/>
<CheckboxInputContainer>
<CheckboxInput onClick={() => setCheckboxValue(!checkboxValue)} />
<CheckboxInputText>
{t("register.acceptTermsCheckbox")}
</CheckboxInputText>
</CheckboxInputContainer>

<ErrorMessage formik={formik} />

<PrimaryAnimatedButton
type="submit"
variant="contained"
@@ -107,6 +113,11 @@ const ThirdPartOfRegistration = (props) => {
fullWidth
textcolor="white"
isLoading={props.isLoading}
disabled={
formik.values.phoneNumber.length === 0 ||
formik.values.location.length === 0 ||
!checkboxValue
}
>
{t("common.continue")}
</PrimaryAnimatedButton>

+ 14
- 1
src/pages/RegisterPages/Register/ThirdPart/ThirdPartOfRegistration.styled.js Vedi File

@@ -1,4 +1,4 @@
import { Typography } from "@mui/material";
import { Typography, Checkbox, Box } from "@mui/material";
import styled from "styled-components";
import selectedTheme from "../../../../themes";

@@ -27,3 +27,16 @@ export const RegisterDescription = styled(Typography)`
margin-top: 14px;
}
`;

export const CheckboxInputContainer = styled(Box)`
display: flex;
align-items: center;
margin: -5px 0 10px -5px;
`;

export const CheckboxInput = styled(Checkbox)``;

export const CheckboxInputText = styled(Typography)`
font-family: ${selectedTheme.fonts.textFont};
font-size: 14px;
`;

+ 1
- 1
src/validations/editProfileValidation.js Vedi File

@@ -13,7 +13,7 @@ export default (locations) =>
i18n.t("editProfile.labelLocationValid")
)
.required(i18n.t("register.labelLocationRequired")),
firmWebsite: Yup.string().required(i18n.t("register.websiteRequired")),
firmWebsite: Yup.string(),
// firmApplink: Yup.string(),
firmPhone: Yup.string()
.min(6, i18n.t("editProfile.labelPhoneValid"))

+ 5
- 6
src/validations/registerValidations/thirdPartValidation.js Vedi File

@@ -13,10 +13,9 @@ export default (locations) =>
i18n.t("register.labelLocationValid")
)
.required(i18n.t("register.labelLocationRequired")),
website: Yup.string()
.matches(
/^((ftp|http|https):\/\/)?(www.)?(?!.*(ftp|http|https|www.))[a-zA-Z0-9_-]+(\.[a-zA-Z]+)+((\/)[\w#]+)*(\/\w+\?[a-zA-Z0-9_]+=\w+(&[a-zA-Z0-9_]+=\w+)*)?$/gm,
i18n.t("register.websiteError")
)
.required(i18n.t("register.websiteRequired")),
website: Yup.string().matches(
/^((ftp|http|https):\/\/)?(www.)?(?!.*(ftp|http|https|www.))[a-zA-Z0-9_-]+(\.[a-zA-Z]+)+((\/)[\w#]+)*(\/\w+\?[a-zA-Z0-9_]+=\w+(&[a-zA-Z0-9_]+=\w+)*)?$/gm,
i18n.t("register.websiteError")
),
// .required(i18n.t("register.websiteRequired")),
});

Loading…
Annulla
Salva