diff --git a/.eslintrc.js b/.eslintrc.js index e221600..30c0bcf 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -17,6 +17,9 @@ module.exports = { ], parserOptions: { sourceType: 'script' + }, + rules: { + 'error': 0, } } ], diff --git a/backend/package.json b/backend/package.json index 373ca3a..b9993ce 100644 --- a/backend/package.json +++ b/backend/package.json @@ -31,7 +31,6 @@ }, "devDependencies": { "jest": "^29.7.0", - "nodemon": "^3.0.1", - "prettier": "^3.1.0" + "nodemon": "^3.0.1" } } \ No newline at end of file diff --git a/frontend/postcss.config.js b/frontend/postcss.config.js index 2e7af2b..2b75bd8 100644 --- a/frontend/postcss.config.js +++ b/frontend/postcss.config.js @@ -1,6 +1,6 @@ export default { plugins: { tailwindcss: {}, - autoprefixer: {}, - }, + autoprefixer: {} + } } diff --git a/frontend/src/App.jsx b/frontend/src/App.jsx index d58db49..fbeff8b 100644 --- a/frontend/src/App.jsx +++ b/frontend/src/App.jsx @@ -1,6 +1,6 @@ -import "./App.css"; -import { Route, Routes } from "react-router-dom"; -import Home from "./pages/Home"; +import './App.css' +import { Route, Routes } from 'react-router-dom' +import Home from './pages/Home' import Login from "./pages/Login"; import Signup from "./pages/Signup"; import Navbar from "./components/common/Navbar"; @@ -22,14 +22,14 @@ import AddCourse from "./components/core/Dashboard/AddCourse"; import Instructor from "./components/core/Dashboard/InstructorDashboard/InstructorDashboard"; import { ACCOUNT_TYPE } from "./utils/constants"; import EditCourse from "./components/core/Dashboard/EditCourse"; -import { useSelector } from "react-redux"; +import { useSelector } from 'react-redux' import Catalog from "./pages/Catalog"; import CourseDetails from "./pages/CourseDetails"; import ViewCourse from "./pages/ViewCourse"; import VideoDetails from "./components/core/ViewCourse/VideoDetails"; -export default function App() { - const { user } = useSelector((state) => state.profile); +export default function App () { + const { user } = useSelector((state) => state.profile) return (
- {" "} - {modalData?.text1}{" "} -
-- {" "} - {modalData?.text2}{" "} -
+const ConfirmationModal = ({ modalData }) => ( ++ {modalData?.text1} +
++ {modalData?.text2} +
-{link.title}
{" "} {link.title}{" "} diff --git a/frontend/src/components/common/ReviewSlider.jsx b/frontend/src/components/common/ReviewSlider.jsx index 0a40edd..9a00831 100644 --- a/frontend/src/components/common/ReviewSlider.jsx +++ b/frontend/src/components/common/ReviewSlider.jsx @@ -1,4 +1,4 @@ -import { useEffect, useState } from "react"; +import { useEffect, useState } from 'react' import ReactStars from "react-rating-stars-component"; import { Swiper, SwiperSlide } from "swiper/react"; // Import Swiper React components @@ -65,9 +65,9 @@ function ReviewSlider() {
{review?.review.split(" ").length > truncateWords ? `${review?.review - .split(" ") - .slice(0, truncateWords) - .join(" ")} ...` + .split(" ") + .slice(0, truncateWords) + .join(" ")} ...` : `${review?.review}`}
diff --git a/frontend/src/components/core/Auth/LoginForm.jsx b/frontend/src/components/core/Auth/LoginForm.jsx index d050c63..688f8a9 100644 --- a/frontend/src/components/core/Auth/LoginForm.jsx +++ b/frontend/src/components/core/Auth/LoginForm.jsx @@ -1,25 +1,26 @@ import { useState } from "react" import { AiOutlineEye, AiOutlineEyeInvisible } from "react-icons/ai" -import { useDispatch } from "react-redux" +import { useDispatch } from 'react-redux' import { Link, useNavigate } from "react-router-dom" import { login } from "../../../services/operations/authAPI.js" -function LoginForm(){ +function LoginForm() { const navigate = useNavigate() const dispatch = useDispatch() - const [formData, setFormData] = useState({email: "", password: "" }) + const [formData, setFormData] = useState({ email: "", password: "" }) const [showPassword, setShowPassword] = useState(false) const { email, password } = formData function handleOnChange(e) { - setFormData( (prevData) =>({ ...prevData , [e.target.name] : e.target.value }) -)} + setFormData((prevData) => ({ ...prevData, [e.target.name]: e.target.value }) + ) + } - function handleOnSubmit(e){ + function handleOnSubmit(e) { e.preventDefault() dispatch(login(email, password, navigate)) } @@ -27,30 +28,31 @@ function LoginForm(){ return ( - - )} + ) +} diff --git a/frontend/src/components/core/Auth/OpenRoute.jsx b/frontend/src/components/core/Auth/OpenRoute.jsx index 47a671d..4f073fa 100644 --- a/frontend/src/components/core/Auth/OpenRoute.jsx +++ b/frontend/src/components/core/Auth/OpenRoute.jsx @@ -1,5 +1,5 @@ // This will prevent authenticated users from accessing this route -import { useSelector } from "react-redux" +import { useSelector } from 'react-redux' import { Navigate } from "react-router-dom" function OpenRoute({ children }) { diff --git a/frontend/src/components/core/Auth/ProfileDropDown.jsx b/frontend/src/components/core/Auth/ProfileDropDown.jsx index 86506d3..8b0a4dd 100644 --- a/frontend/src/components/core/Auth/ProfileDropDown.jsx +++ b/frontend/src/components/core/Auth/ProfileDropDown.jsx @@ -1,8 +1,8 @@ -import { useRef, useState } from "react"; +import { useRef, useState } from 'react' import { AiOutlineCaretDown } from "react-icons/ai"; import { VscDashboard, VscSignOut } from "react-icons/vsc"; -import { useDispatch, useSelector } from "react-redux"; -import { Link, useNavigate } from "react-router-dom"; +import { useDispatch, useSelector } from 'react-redux' +import { Link, useNavigate } from 'react-router-dom' import useOnClickOutside from "../../../hooks/useOnClickOutside.js"; import { logout } from "../../../services/operations/authAPI"; diff --git a/frontend/src/components/core/Auth/SignupForm.jsx b/frontend/src/components/core/Auth/SignupForm.jsx index 768db88..916c705 100644 --- a/frontend/src/components/core/Auth/SignupForm.jsx +++ b/frontend/src/components/core/Auth/SignupForm.jsx @@ -1,8 +1,8 @@ -import { useState } from "react"; +import { useState } from 'react' import { toast } from "react-hot-toast"; import { AiOutlineEye, AiOutlineEyeInvisible } from "react-icons/ai"; -import { useDispatch } from "react-redux"; -import { useNavigate } from "react-router-dom"; +import { useDispatch } from 'react-redux' +import { useNavigate } from 'react-router-dom' import CountryCode from "../../../data/countrycode.json"; import { sendOtp } from "../../../services/operations/authAPI"; import { setSignupData } from "../../../slices/authSlice"; diff --git a/frontend/src/components/core/Auth/Template.jsx b/frontend/src/components/core/Auth/Template.jsx index 1d73f63..d13e8f4 100644 --- a/frontend/src/components/core/Auth/Template.jsx +++ b/frontend/src/components/core/Auth/Template.jsx @@ -1,4 +1,4 @@ -import { useSelector } from "react-redux"; +import { useSelector } from 'react-redux' import frameImg from "../../../assets/Images/frame.png"; import LoginForm from "./LoginForm"; diff --git a/frontend/src/components/core/Catalog/Course_Card.jsx b/frontend/src/components/core/Catalog/Course_Card.jsx index 99aa2dc..7ad0f1e 100644 --- a/frontend/src/components/core/Catalog/Course_Card.jsx +++ b/frontend/src/components/core/Catalog/Course_Card.jsx @@ -1,7 +1,7 @@ -import { useEffect, useState } from "react"; +import { useEffect, useState } from 'react' import RatingStars from "../../common/RatingStars"; import GetAvgRating from "../../../utils/avgRating"; -import { Link } from "react-router-dom"; +import { Link } from 'react-router-dom' const Course_Card = ({ course, Height }) => { const [avgReviewCount, setAvgReviewCount] = useState(0); diff --git a/frontend/src/components/core/Course/CourseAccordionBar.jsx b/frontend/src/components/core/Course/CourseAccordionBar.jsx index 88465dd..a8bfa69 100644 --- a/frontend/src/components/core/Course/CourseAccordionBar.jsx +++ b/frontend/src/components/core/Course/CourseAccordionBar.jsx @@ -1,4 +1,4 @@ -import { useEffect, useRef, useState } from "react"; +import { useEffect, useRef, useState } from 'react' import { AiOutlineDown } from "react-icons/ai"; import CourseSubSectionAccordion from "./CourseSubSectionAccordion"; diff --git a/frontend/src/components/core/Course/CourseDetailsCard.jsx b/frontend/src/components/core/Course/CourseDetailsCard.jsx index 9f70666..3507771 100644 --- a/frontend/src/components/core/Course/CourseDetailsCard.jsx +++ b/frontend/src/components/core/Course/CourseDetailsCard.jsx @@ -1,8 +1,8 @@ import copy from "copy-to-clipboard"; import { BsFillCaretRightFill } from "react-icons/bs"; import { FaShareSquare } from "react-icons/fa"; -import { useDispatch, useSelector } from "react-redux"; -import { useNavigate } from "react-router-dom"; +import { useDispatch, useSelector } from 'react-redux' +import { useNavigate } from 'react-router-dom' import { addToCart } from "../../../slices/cartSlice"; import { toast } from "react-hot-toast"; import { ACCOUNT_TYPE } from "../../../utils/constants"; diff --git a/frontend/src/components/core/Dashboard/AddCourse/CourseBuilder/CourseBuilderForm.jsx b/frontend/src/components/core/Dashboard/AddCourse/CourseBuilder/CourseBuilderForm.jsx index f14e210..298a9bd 100644 --- a/frontend/src/components/core/Dashboard/AddCourse/CourseBuilder/CourseBuilderForm.jsx +++ b/frontend/src/components/core/Dashboard/AddCourse/CourseBuilder/CourseBuilderForm.jsx @@ -1,9 +1,9 @@ -import { useState } from "react"; +import { useState } from 'react' import { useForm } from "react-hook-form"; import { toast } from "react-hot-toast"; import { IoAddCircleOutline } from "react-icons/io5"; import { MdNavigateNext } from "react-icons/md"; -import { useDispatch, useSelector } from "react-redux"; +import { useDispatch, useSelector } from 'react-redux' import { createSection, diff --git a/frontend/src/components/core/Dashboard/AddCourse/CourseBuilder/NestedView.jsx b/frontend/src/components/core/Dashboard/AddCourse/CourseBuilder/NestedView.jsx index a06cf6a..620b80d 100644 --- a/frontend/src/components/core/Dashboard/AddCourse/CourseBuilder/NestedView.jsx +++ b/frontend/src/components/core/Dashboard/AddCourse/CourseBuilder/NestedView.jsx @@ -1,10 +1,10 @@ -import { useState } from "react"; +import { useState } from 'react' import { AiFillCaretDown } from "react-icons/ai"; import { FaPlus } from "react-icons/fa"; import { MdEdit } from "react-icons/md"; import { RiDeleteBin6Line } from "react-icons/ri"; import { RxDropdownMenu } from "react-icons/rx"; -import { useDispatch, useSelector } from "react-redux"; +import { useDispatch, useSelector } from 'react-redux' import { deleteSection, diff --git a/frontend/src/components/core/Dashboard/AddCourse/CourseBuilder/SubSectionModal.jsx b/frontend/src/components/core/Dashboard/AddCourse/CourseBuilder/SubSectionModal.jsx index 457b4b4..4eab7f6 100644 --- a/frontend/src/components/core/Dashboard/AddCourse/CourseBuilder/SubSectionModal.jsx +++ b/frontend/src/components/core/Dashboard/AddCourse/CourseBuilder/SubSectionModal.jsx @@ -1,8 +1,8 @@ -import { useEffect, useState } from "react"; +import { useEffect, useState } from 'react' import { useForm } from "react-hook-form"; import { toast } from "react-hot-toast"; import { RxCross2 } from "react-icons/rx"; -import { useDispatch, useSelector } from "react-redux"; +import { useDispatch, useSelector } from 'react-redux' import { createSubSection, diff --git a/frontend/src/components/core/Dashboard/AddCourse/CourseInformation/ChipInput.jsx b/frontend/src/components/core/Dashboard/AddCourse/CourseInformation/ChipInput.jsx index 2cd982f..e68222f 100644 --- a/frontend/src/components/core/Dashboard/AddCourse/CourseInformation/ChipInput.jsx +++ b/frontend/src/components/core/Dashboard/AddCourse/CourseInformation/ChipInput.jsx @@ -1,6 +1,6 @@ -import { useEffect, useState } from "react"; +import { useEffect, useState } from 'react' import { MdClose } from "react-icons/md"; -import { useSelector } from "react-redux"; +import { useSelector } from 'react-redux' export default function ChipInput({ label, diff --git a/frontend/src/components/core/Dashboard/AddCourse/CourseInformation/CourseInformationForm.jsx b/frontend/src/components/core/Dashboard/AddCourse/CourseInformation/CourseInformationForm.jsx index f79c91a..dfabef0 100644 --- a/frontend/src/components/core/Dashboard/AddCourse/CourseInformation/CourseInformationForm.jsx +++ b/frontend/src/components/core/Dashboard/AddCourse/CourseInformation/CourseInformationForm.jsx @@ -1,9 +1,9 @@ -import { useEffect, useState } from "react"; +import { useEffect, useState } from 'react' import { useForm } from "react-hook-form"; import { toast } from "react-hot-toast"; import { HiOutlineCurrencyRupee } from "react-icons/hi"; import { MdNavigateNext } from "react-icons/md"; -import { useDispatch, useSelector } from "react-redux"; +import { useDispatch, useSelector } from 'react-redux' import { addCourseDetails, editCourseDetails, @@ -64,7 +64,7 @@ export default function CourseInformationForm() { currentValues.courseBenefits !== course.whatYouWillLearn || currentValues.courseCategory._id !== course.category._id || currentValues.courseRequirements.toString() !== - course.instructions.toString() || + course.instructions.toString() || currentValues.courseImage !== course.thumbnail ) { return true; diff --git a/frontend/src/components/core/Dashboard/AddCourse/CourseInformation/RequirementField.jsx b/frontend/src/components/core/Dashboard/AddCourse/CourseInformation/RequirementField.jsx index 4099575..4aee3ee 100644 --- a/frontend/src/components/core/Dashboard/AddCourse/CourseInformation/RequirementField.jsx +++ b/frontend/src/components/core/Dashboard/AddCourse/CourseInformation/RequirementField.jsx @@ -1,5 +1,5 @@ -import { useEffect, useState } from "react"; -import { useSelector } from "react-redux"; +import { useEffect, useState } from 'react' +import { useSelector } from 'react-redux' import PropTypes from "prop-types"; export default function RequirementsField({ diff --git a/frontend/src/components/core/Dashboard/AddCourse/PublishCourse/index.jsx b/frontend/src/components/core/Dashboard/AddCourse/PublishCourse/index.jsx index b65249f..38bf9ee 100644 --- a/frontend/src/components/core/Dashboard/AddCourse/PublishCourse/index.jsx +++ b/frontend/src/components/core/Dashboard/AddCourse/PublishCourse/index.jsx @@ -1,6 +1,6 @@ import { useEffect, useState } from "react" import { useForm } from "react-hook-form" -import { useDispatch, useSelector } from "react-redux" +import { useDispatch, useSelector } from 'react-redux' import { useNavigate } from "react-router-dom" import { editCourseDetails } from "../../../../../services/operations/courseDetailsAPI" @@ -19,7 +19,7 @@ export default function PublishCourse() { const [loading, setLoading] = useState(false) useEffect(() => { - if (course?.status === COURSE_STATUS.PUBLISHED){ + if (course?.status === COURSE_STATUS.PUBLISHED) { setValue("public", true) } }, []) @@ -34,7 +34,7 @@ export default function PublishCourse() { } const handleCoursePublish = async () => { - if( // check if form has been updated or not + if ( // check if form has been updated or not (course?.status === COURSE_STATUS.PUBLISHED && getValues("public") === true) || (course?.status === COURSE_STATUS.DRAFT && getValues("public") === false) @@ -48,7 +48,7 @@ export default function PublishCourse() { formData.append("status", courseStatus) setLoading(true) const result = await editCourseDetails(formData, token) - if(result) { + if (result) { goToCourses() } setLoading(false) @@ -63,12 +63,12 @@ export default function PublishCourse() {Publish Settings
-