whoops
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
import type { KeyboardEventHandler } from 'react';
|
import type { KeyboardEventHandler } from 'react';
|
||||||
import { useCallback, useEffect, useRef, useState } from 'react';
|
import { useCallback, useEffect, useRef, useState } from 'react';
|
||||||
import { SubmitHandler, useForm } from 'react-hook-form';
|
import { SubmitHandler, useForm } from 'react-hook-form';
|
||||||
import { socket } from '@/socket/socket.tsx';
|
import { socket } from '@/socket/socket.ts';
|
||||||
import { File, Paperclip, Send, X } from 'lucide-react';
|
import { File, Paperclip, Send, X } from 'lucide-react';
|
||||||
import LoadingWheel from '@/components/chat/LoadingWheel.tsx';
|
import LoadingWheel from '@/components/chat/LoadingWheel.tsx';
|
||||||
import { FileWithPreviewProps } from '@/types/types.ts';
|
import { FileWithPreviewProps } from '@/types/types.ts';
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { useEffect, useRef, useState } from 'react';
|
import { useEffect, useRef, useState } from 'react';
|
||||||
import { socket } from '@/socket/socket.tsx';
|
import { socket } from '@/socket/socket.ts';
|
||||||
import { useOutletContext } from 'react-router-dom';
|
import { useOutletContext } from 'react-router-dom';
|
||||||
import { sendContact } from '@/api/contactsApi.tsx';
|
import { sendContact } from '@/api/contactsApi.tsx';
|
||||||
import LoadingWheel from '../LoadingWheel.tsx';
|
import LoadingWheel from '../LoadingWheel.tsx';
|
||||||
@@ -215,7 +215,7 @@ function MessagesArea() {
|
|||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
scrollToBottom();
|
scrollToBottom();
|
||||||
});
|
}, []);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div ref={containerRef} className="flex flex-col h-full overflow-y-auto">
|
<div ref={containerRef} className="flex flex-col h-full overflow-y-auto">
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import LoadingWheel from '../LoadingWheel.tsx';
|
import LoadingWheel from '../LoadingWheel.tsx';
|
||||||
import { useEffect, useRef, useState } from 'react';
|
import { useEffect, useRef, useState } from 'react';
|
||||||
import { SubmitHandler, useForm } from 'react-hook-form';
|
import { SubmitHandler, useForm } from 'react-hook-form';
|
||||||
import { socket } from '@/socket/socket.tsx';
|
import { socket } from '@/socket/socket.ts';
|
||||||
import { UserRoundPlus } from 'lucide-react';
|
import { UserRoundPlus } from 'lucide-react';
|
||||||
import { Button } from '@/components/ui/button.tsx';
|
import { Button } from '@/components/ui/button.tsx';
|
||||||
import { useChat } from '@/context/chat/useChat.ts';
|
import { useChat } from '@/context/chat/useChat.ts';
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { useEffect } from 'react';
|
import { useEffect } from 'react';
|
||||||
import { socket } from '@/socket/socket.tsx';
|
import { socket } from '@/socket/socket.ts';
|
||||||
import GroupIcon from '../../../../assets/group.svg';
|
import GroupIcon from '../../../../assets/group.svg';
|
||||||
import {
|
import {
|
||||||
AlertDialog,
|
AlertDialog,
|
||||||
@@ -32,7 +32,7 @@ function ContactsList() {
|
|||||||
fetchContacts().catch((e) =>
|
fetchContacts().catch((e) =>
|
||||||
console.error('Failed to fetch contacts: ', e),
|
console.error('Failed to fetch contacts: ', e),
|
||||||
);
|
);
|
||||||
});
|
}, []);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (!socket) return;
|
if (!socket) return;
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { useEffect, useMemo, useState } from 'react';
|
import { useEffect, useMemo, useState } from 'react';
|
||||||
import { socket } from '@/socket/socket.tsx';
|
import { socket } from '@/socket/socket.ts';
|
||||||
import { Crown, Sword } from 'lucide-react';
|
import { Crown, Sword } from 'lucide-react';
|
||||||
import {
|
import {
|
||||||
ContextMenu,
|
ContextMenu,
|
||||||
|
|||||||
@@ -87,15 +87,13 @@ const SidebarProvider = React.forwardRef<
|
|||||||
[setOpenProp, open],
|
[setOpenProp, open],
|
||||||
);
|
);
|
||||||
|
|
||||||
// Helper to toggle the sidebar.
|
|
||||||
const toggleSidebar = React.useCallback(() => {
|
const toggleSidebar = React.useCallback(() => {
|
||||||
return isMobile
|
return isMobile
|
||||||
? setOpenMobile((open) => !open)
|
? setOpenMobile((open) => !open)
|
||||||
: setOpen((open) => !open);
|
: setOpen((open) => !open);
|
||||||
}, [isMobile, setOpen, setOpenMobile]);
|
}, [isMobile, setOpen, setOpenMobile]);
|
||||||
|
|
||||||
// Adds a keyboard shortcut to toggle the sidebar.
|
useEffect(() => {
|
||||||
React.useEffect(() => {
|
|
||||||
const handleKeyDown = (event: KeyboardEvent) => {
|
const handleKeyDown = (event: KeyboardEvent) => {
|
||||||
if (
|
if (
|
||||||
event.key === SIDEBAR_KEYBOARD_SHORTCUT &&
|
event.key === SIDEBAR_KEYBOARD_SHORTCUT &&
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import { ChatContext } from '@/context/chat/ChatContext.tsx';
|
import { ChatContext } from '@/context/chat/ChatContext.tsx';
|
||||||
import { ReactNode, useState } from 'react';
|
import { ReactNode, useState } from 'react';
|
||||||
import { ChatMessagesProps, ContactsProps, MeProps } from '@/types/types.ts';
|
import { ChatMessagesProps, ContactsProps, MeProps } from '@/types/types.ts';
|
||||||
import { joinRoom } from '@/socket/socket.tsx';
|
import { joinRoom } from '@/socket/socket.ts';
|
||||||
import { getMessages, setContactStatus } from '@/api/contactsApi.tsx';
|
import { getMessages, setContactStatus } from '@/api/contactsApi.tsx';
|
||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
|
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import ContactForm from '../components/chat/leftSidebar/ContactForm.tsx';
|
|||||||
import MessagesArea from '../components/chat/chatArea/MessagesArea.tsx';
|
import MessagesArea from '../components/chat/chatArea/MessagesArea.tsx';
|
||||||
import { useEffect } from 'react';
|
import { useEffect } from 'react';
|
||||||
import ContactsList from '../components/chat/leftSidebar/ContactsList.tsx';
|
import ContactsList from '../components/chat/leftSidebar/ContactsList.tsx';
|
||||||
import { initializeSocket } from '../socket/socket.tsx';
|
import { initializeSocket } from '../socket/socket.ts';
|
||||||
import Cookies from 'js-cookie';
|
import Cookies from 'js-cookie';
|
||||||
import ParticipantsBar from '@/components/chat/rightSidebar/ParticipantsBar.tsx';
|
import ParticipantsBar from '@/components/chat/rightSidebar/ParticipantsBar.tsx';
|
||||||
import { useChat } from '@/context/chat/useChat.ts';
|
import { useChat } from '@/context/chat/useChat.ts';
|
||||||
@@ -29,7 +29,7 @@ function Chat() {
|
|||||||
localStorage.removeItem('contact');
|
localStorage.removeItem('contact');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
}, []);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="text-white flex h-screen">
|
<div className="text-white flex h-screen">
|
||||||
|
|||||||
Reference in New Issue
Block a user