code refactor
This commit is contained in:
@@ -28,8 +28,6 @@ type MessagesAreaProps = {
|
||||
currentContact: string | null;
|
||||
setContactStatus: (contact: string, read: boolean) => void;
|
||||
updateContactStatus: (contact: ContactProps, read: boolean) => void;
|
||||
setCursor: React.Dispatch<React.SetStateAction<number | null>>;
|
||||
cursor: number | null;
|
||||
messageHandler: (msg: ChatMessages) => void;
|
||||
setContactsList: React.Dispatch<React.SetStateAction<ContactsProps[]>>;
|
||||
fetchPreviousMessages: (contact: string | null) => Promise<void>;
|
||||
|
||||
@@ -3,4 +3,8 @@ import { createRoot } from 'react-dom/client';
|
||||
import App from './App.tsx';
|
||||
import './index.css';
|
||||
|
||||
createRoot(document.getElementById('root')!).render(<App />);
|
||||
createRoot(document.getElementById('root')!).render(
|
||||
<StrictMode>
|
||||
<App />
|
||||
</StrictMode>,
|
||||
);
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import { useForm, SubmitHandler } from 'react-hook-form';
|
||||
import axios from 'axios';
|
||||
import icon from '../../assets/icon.png';
|
||||
import { Link, useNavigate } from 'react-router-dom';
|
||||
import { useContext, useState } from 'react';
|
||||
import { AuthContext } from '../utils/AuthProvider.tsx';
|
||||
import LoadingWheel from '../components/chat/LoadingWheel.tsx';
|
||||
import { axiosClient } from '../App.tsx';
|
||||
|
||||
type Inputs = {
|
||||
username: string;
|
||||
@@ -22,7 +22,7 @@ export default function Login() {
|
||||
|
||||
const onSubmit: SubmitHandler<Inputs> = (data) => {
|
||||
setIsLoading(true);
|
||||
axios
|
||||
axiosClient
|
||||
.post('/api/auth/login', data, {
|
||||
withCredentials: true,
|
||||
})
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import axios from 'axios';
|
||||
import { useState, useEffect } from 'react';
|
||||
import Cookies from 'js-cookie';
|
||||
import { axiosClient } from '../App.tsx';
|
||||
|
||||
Reference in New Issue
Block a user