From 74c7d93940e9d40dfde849bca9d5e35e05e045ac Mon Sep 17 00:00:00 2001 From: HasarAli Date: Fri, 25 Feb 2022 01:13:11 -0500 Subject: [PATCH] fixed linting errors --- next-i18next.config.js | 1 + src/components/AddServicePage/AddService.jsx | 1 - src/components/Footer/Footer.jsx | 3 +- src/components/HeroComponents/LogoSection.jsx | 2 +- .../LargeProfileCard/LargeProfileCard.jsx | 4 +- src/components/Modals/JoinModal.jsx | 44 +++++++------ src/components/Navbar/Navbar.jsx | 10 +-- src/components/Navbar/Searchbox.jsx | 34 +++++----- .../SellerContact/SellerContact.jsx | 62 +++++++++---------- src/components/SettingsPage/SettingsPage.jsx | 2 +- .../firestore/__test__/firestore.test.js | 22 ++++--- src/firebase/index.js | 1 + src/firebase/utilities.js | 23 +++---- src/pages/add_service/index.jsx | 1 + src/pages/service/[uid]/index.jsx | 3 +- src/pages/services_search/index.jsx | 2 - 16 files changed, 102 insertions(+), 113 deletions(-) diff --git a/next-i18next.config.js b/next-i18next.config.js index ef7bdf1..6a4b3a4 100644 --- a/next-i18next.config.js +++ b/next-i18next.config.js @@ -1,4 +1,5 @@ const path = require("path"); + module.exports = { i18n: { defaultLocale: "en", diff --git a/src/components/AddServicePage/AddService.jsx b/src/components/AddServicePage/AddService.jsx index 861a815..6d033c1 100644 --- a/src/components/AddServicePage/AddService.jsx +++ b/src/components/AddServicePage/AddService.jsx @@ -21,7 +21,6 @@ const AddService = ({ user }) => { e.preventDefault(); const form = new FormData(e.target); const images = form.getAll("images"); - console.log("in handle", serviceData); addService(user, images, serviceData); }; diff --git a/src/components/Footer/Footer.jsx b/src/components/Footer/Footer.jsx index 8b77597..c8c61c7 100644 --- a/src/components/Footer/Footer.jsx +++ b/src/components/Footer/Footer.jsx @@ -4,8 +4,8 @@ import React from "react"; import Link from "next/link"; import { useTranslation } from "next-i18next"; import { useRouter } from "next/router"; -import { FooterContainer, MainContainer } from "./Footer.styled"; import cookie from "cookie-cutter"; +import { FooterContainer, MainContainer } from "./Footer.styled"; // eslint-disable-next-line arrow-body-style const Footer = () => { @@ -15,7 +15,6 @@ const Footer = () => { const changeLocale = () => { const locale = router.locale === "en" ? "ku" : "en"; cookie.set("NEXT_LOCALE", locale); - console.log(cookie.get("NEXT_LOCALE")); router.push(router.asPath, undefined, { locale }); }; diff --git a/src/components/HeroComponents/LogoSection.jsx b/src/components/HeroComponents/LogoSection.jsx index 90246fd..2b79a45 100644 --- a/src/components/HeroComponents/LogoSection.jsx +++ b/src/components/HeroComponents/LogoSection.jsx @@ -14,7 +14,7 @@ const LogoSection = () => {

{t("home.makeLogo")}

{t("home.designLogo")}

- + {t("home.tryKiraLogo")}
diff --git a/src/components/LargeProfileCard/LargeProfileCard.jsx b/src/components/LargeProfileCard/LargeProfileCard.jsx index fe23c26..ee33382 100644 --- a/src/components/LargeProfileCard/LargeProfileCard.jsx +++ b/src/components/LargeProfileCard/LargeProfileCard.jsx @@ -70,7 +70,7 @@ LargeProfileCard.propTypes = { uid: PropTypes.string.isRequired, photoURL: PropTypes.string, displayName: PropTypes.string.isRequired, - job: PropTypes.string, + title: PropTypes.string, location: PropTypes.string, about: PropTypes.string, skills: PropTypes.array, @@ -78,7 +78,7 @@ LargeProfileCard.propTypes = { LargeProfileCard.defaultProps = { photoURL: "", - job: "", + title: "", location: "", about: "", skills: [], diff --git a/src/components/Modals/JoinModal.jsx b/src/components/Modals/JoinModal.jsx index d32949a..296719b 100644 --- a/src/components/Modals/JoinModal.jsx +++ b/src/components/Modals/JoinModal.jsx @@ -38,29 +38,27 @@ const JoinModal = ({ showJoin, setShowJoin }) => { const { t } = useTranslation("navbar"); - return ( - <> - {showJoin && ( - - - - -

{t("navbar.joinNow")}

- -
- setShowJoin((show) => !show)} /> - -
-
-
-
- - - - - )} - - ); + if (showJoin) + return ( + + + + +

{t("navbar.joinNow")}

+ +
+ setShowJoin((show) => !show)} /> + +
+
+
+
+ + + + + ); + return null; }; export default JoinModal; diff --git a/src/components/Navbar/Navbar.jsx b/src/components/Navbar/Navbar.jsx index f032d25..a8c8d7f 100644 --- a/src/components/Navbar/Navbar.jsx +++ b/src/components/Navbar/Navbar.jsx @@ -5,11 +5,11 @@ import { MdSettings } from "react-icons/md"; import { FiLogOut } from "react-icons/fi"; import { useTranslation } from "next-i18next"; import { auth } from "src/firebase/firebase"; +import Link from "next/link"; import userContext from "../../context/context"; import Searchbox from "./Searchbox"; import { JoinBtn, Img, ProfileImg, DropDown } from "./Navbar.styled"; import JoinModal from "../Modals/JoinModal"; -import Link from "next/link"; const NavBar = () => { const [showJoin, setShowJoin] = useState(false); @@ -26,7 +26,7 @@ const NavBar = () => { - + { ) : (