code refactor

This commit is contained in:
slawk0
2024-11-14 21:18:32 +01:00
parent 635bfd7e5d
commit ef8df113e4
4 changed files with 7 additions and 6 deletions

View File

@@ -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>;

View File

@@ -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>,
);

View File

@@ -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,
})

View File

@@ -1,4 +1,3 @@
import axios from 'axios';
import { useState, useEffect } from 'react';
import Cookies from 'js-cookie';
import { axiosClient } from '../App.tsx';