From d79af2aac33453b07eaddb74e055fdbd2d05bece Mon Sep 17 00:00:00 2001 From: Mj Dev Date: Thu, 28 Dec 2023 00:51:24 +0330 Subject: [PATCH] correcting some spell issues --- backend/controllers/chatControllers.js | 2 +- backend/controllers/userControllers.js | 2 +- backend/server.js | 8 ++++---- frontend/src/App.js | 4 ++-- frontend/src/Pages/Chatpage.js | 8 ++++---- .../src/components/Authentication/Login.js | 4 ++-- .../src/components/Authentication/Signup.js | 12 ++++++------ frontend/src/components/Chatbox.js | 4 ++-- frontend/src/components/MyChats.js | 2 +- frontend/src/components/SingleChat.js | 18 +++++++++--------- .../components/miscellaneous/GroupChatModal.js | 4 ++-- .../src/components/miscellaneous/SideDrawer.js | 2 +- .../miscellaneous/UpdateGroupChatModal.js | 12 ++++++------ 13 files changed, 41 insertions(+), 41 deletions(-) diff --git a/backend/controllers/chatControllers.js b/backend/controllers/chatControllers.js index 85f9c16..039554c 100644 --- a/backend/controllers/chatControllers.js +++ b/backend/controllers/chatControllers.js @@ -79,7 +79,7 @@ const fetchChats = asyncHandler(async (req, res) => { //@access Protected const createGroupChat = asyncHandler(async (req, res) => { if (!req.body.users || !req.body.name) { - return res.status(400).send({ message: "Please Fill all the feilds" }); + return res.status(400).send({ message: "Please Fill all the Fields" }); } var users = JSON.parse(req.body.users); diff --git a/backend/controllers/userControllers.js b/backend/controllers/userControllers.js index 16dd7d7..839680d 100644 --- a/backend/controllers/userControllers.js +++ b/backend/controllers/userControllers.js @@ -27,7 +27,7 @@ const registerUser = asyncHandler(async (req, res) => { if (!name || !email || !password) { res.status(400); - throw new Error("Please Enter all the Feilds"); + throw new Error("Please Enter all the Fields"); } const userExists = await User.findOne({ email }); diff --git a/backend/server.js b/backend/server.js index e4a1452..cd2f49b 100644 --- a/backend/server.js +++ b/backend/server.js @@ -72,15 +72,15 @@ io.on("connection", (socket) => { socket.on("typing", (room) => socket.in(room).emit("typing")); socket.on("stop typing", (room) => socket.in(room).emit("stop typing")); - socket.on("new message", (newMessageRecieved) => { - var chat = newMessageRecieved.chat; + socket.on("new message", (newMessageReceived) => { + var chat = newMessageReceived.chat; if (!chat.users) return console.log("chat.users not defined"); chat.users.forEach((user) => { - if (user._id == newMessageRecieved.sender._id) return; + if (user._id == newMessageReceived.sender._id) return; - socket.in(user._id).emit("message recieved", newMessageRecieved); + socket.in(user._id).emit("message received", newMessageReceived); }); }); diff --git a/frontend/src/App.js b/frontend/src/App.js index 4263ced..3a17331 100644 --- a/frontend/src/App.js +++ b/frontend/src/App.js @@ -1,13 +1,13 @@ import "./App.css"; import Homepage from "./Pages/Homepage"; import { Route } from "react-router-dom"; -import Chatpage from "./Pages/Chatpage"; +import ChatPage from "./Pages/Chatpage"; function App() { return (
- +
); } diff --git a/frontend/src/Pages/Chatpage.js b/frontend/src/Pages/Chatpage.js index 8085a2c..cfccdcf 100644 --- a/frontend/src/Pages/Chatpage.js +++ b/frontend/src/Pages/Chatpage.js @@ -1,11 +1,11 @@ import { Box } from "@chakra-ui/layout"; import { useState } from "react"; -import Chatbox from "../components/Chatbox"; +import ChatBox from "../components/Chatbox"; import MyChats from "../components/MyChats"; import SideDrawer from "../components/miscellaneous/SideDrawer"; import { ChatState } from "../Context/ChatProvider"; -const Chatpage = () => { +const ChatPage = () => { const [fetchAgain, setFetchAgain] = useState(false); const { user } = ChatState(); @@ -15,11 +15,11 @@ const Chatpage = () => { {user && } {user && ( - + )} ); }; -export default Chatpage; +export default ChatPage; diff --git a/frontend/src/components/Authentication/Login.js b/frontend/src/components/Authentication/Login.js index 38701d8..79a55af 100644 --- a/frontend/src/components/Authentication/Login.js +++ b/frontend/src/components/Authentication/Login.js @@ -23,7 +23,7 @@ const Login = () => { setLoading(true); if (!email || !password) { toast({ - title: "Please Fill all the Feilds", + title: "Please Fill all the Fields", status: "warning", duration: 5000, isClosable: true, @@ -59,7 +59,7 @@ const Login = () => { history.push("/chats"); } catch (error) { toast({ - title: "Error Occured!", + title: "Error Occurred!", description: error.response.data.message, status: "error", duration: 5000, diff --git a/frontend/src/components/Authentication/Signup.js b/frontend/src/components/Authentication/Signup.js index f137580..4181244 100644 --- a/frontend/src/components/Authentication/Signup.js +++ b/frontend/src/components/Authentication/Signup.js @@ -15,16 +15,16 @@ const Signup = () => { const [name, setName] = useState(); const [email, setEmail] = useState(); - const [confirmpassword, setConfirmpassword] = useState(); + const [confirmPassword, setConfirmPassword] = useState(); const [password, setPassword] = useState(); const [pic, setPic] = useState(); const [picLoading, setPicLoading] = useState(false); const submitHandler = async () => { setPicLoading(true); - if (!name || !email || !password || !confirmpassword) { + if (!name || !email || !password || !confirmPassword) { toast({ - title: "Please Fill all the Feilds", + title: "Please Fill all the Fields", status: "warning", duration: 5000, isClosable: true, @@ -33,7 +33,7 @@ const Signup = () => { setPicLoading(false); return; } - if (password !== confirmpassword) { + if (password !== confirmPassword) { toast({ title: "Passwords Do Not Match", status: "warning", @@ -73,7 +73,7 @@ const Signup = () => { history.push("/chats"); } catch (error) { toast({ - title: "Error Occured!", + title: "Error Occurred!", description: error.response.data.message, status: "error", duration: 5000, @@ -167,7 +167,7 @@ const Signup = () => { setConfirmpassword(e.target.value)} + onChange={(e) => setConfirmPassword(e.target.value)} />