Reorganize root folder structure: Remove apps layer layer
This commit is contained in:
@@ -3,8 +3,8 @@ import { AnimatePresence } from 'framer-motion';
|
||||
import { useAuthStore } from './modules/auth/application/authStore';
|
||||
import AuthPage from './modules/auth/presentation/AuthPage';
|
||||
import ChatPage from './modules/chats/presentation/ChatPage';
|
||||
import AdminPage from './pages/AdminPage';
|
||||
import NotificationProvider from './components/NotificationProvider';
|
||||
import AdminPage from './modules/admin/presentation/pages/AdminPage';
|
||||
import NotificationProvider from './core/presentation/components/ui/NotificationProvider';
|
||||
|
||||
export default function App() {
|
||||
const { token, user, checkAuth, isLoading } = useAuthStore();
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { memo } from 'react';
|
||||
import { getInitials, generateAvatarColor } from '../lib/utils';
|
||||
import { getInitials, generateAvatarColor } from '../../../utils/utils';
|
||||
|
||||
interface AvatarProps {
|
||||
src?: string | null;
|
||||
@@ -1,6 +1,6 @@
|
||||
import { motion, AnimatePresence } from 'framer-motion';
|
||||
import { AlertTriangle } from 'lucide-react';
|
||||
import { useLang } from '../lib/i18n';
|
||||
import { useLang } from '../../../infrastructure/i18n';
|
||||
|
||||
interface ConfirmModalProps {
|
||||
open: boolean;
|
||||
@@ -2,7 +2,7 @@ import { useState, useRef, useEffect, useMemo } from 'react';
|
||||
import { createPortal } from 'react-dom';
|
||||
import { motion, AnimatePresence } from 'framer-motion';
|
||||
import { ChevronLeft, ChevronRight, Calendar } from 'lucide-react';
|
||||
import { useLang } from '../lib/i18n';
|
||||
import { useLang } from '../../../infrastructure/i18n';
|
||||
|
||||
interface DatePickerProps {
|
||||
value: string;
|
||||
@@ -1,6 +1,6 @@
|
||||
import { motion, AnimatePresence } from 'framer-motion';
|
||||
import { X, AlertCircle, CheckCircle, AlertTriangle, Info } from 'lucide-react';
|
||||
import { useNotificationStore, NotificationType } from '../stores/notificationStore';
|
||||
import { useNotificationStore, NotificationType } from '../../../application/stores/notificationStore';
|
||||
|
||||
const icons: Record<NotificationType, React.ReactNode> = {
|
||||
info: <Info className="text-blue-400" size={20} />,
|
||||
@@ -29,16 +29,16 @@ import {
|
||||
Shield,
|
||||
Eye,
|
||||
} from 'lucide-react';
|
||||
import { useAuthStore } from '../modules/auth/application/authStore';
|
||||
import { useFriendStore } from '../modules/friends/application/friendStore';
|
||||
import { useChatStore } from '../modules/chats/application/chatStore';
|
||||
import { UserApi } from '../modules/users/infrastructure/userApi';
|
||||
import { getSocket } from '../lib/socket';
|
||||
import { useLang } from '../lib/i18n';
|
||||
import { useThemeStore, ChatTheme } from '../stores/themeStore';
|
||||
import DatePicker from './DatePicker';
|
||||
import TelegramImportModal from './TelegramImportModal';
|
||||
import type { User as UserType, UserPresence, FriendRequest, FriendWithId } from '../lib/types';
|
||||
import { useAuthStore } from '../../../modules/auth/application/authStore';
|
||||
import { useFriendStore } from '../../../modules/friends/application/friendStore';
|
||||
import { useChatStore } from '../../../modules/chats/application/chatStore';
|
||||
import { UserApi } from '../../../modules/users/infrastructure/userApi';
|
||||
import { getSocket } from '../../infrastructure/socket';
|
||||
import { useLang } from '../../infrastructure/i18n';
|
||||
import { useThemeStore, ChatTheme } from '../../application/stores/themeStore';
|
||||
import DatePicker from '../components/ui/DatePicker';
|
||||
import TelegramImportModal from '../../../modules/users/presentation/components/TelegramImportModal';
|
||||
import type { User as UserType, UserPresence, FriendRequest, FriendWithId } from '../../domain/types';
|
||||
|
||||
type SideView = 'main' | 'profile' | 'settings' | 'about' | 'themes' | 'friends';
|
||||
|
||||
@@ -8,21 +8,21 @@ import {
|
||||
X,
|
||||
User as UserIcon,
|
||||
} from 'lucide-react';
|
||||
import { useAuthStore } from '../modules/auth/application/authStore';
|
||||
import { useChatStore } from '../modules/chats/application/chatStore';
|
||||
import { useNotificationStore } from '../stores/notificationStore';
|
||||
import { useLang } from '../lib/i18n';
|
||||
import { StoryApi } from '../modules/stories/infrastructure/storyApi';
|
||||
import { getSocket } from '../lib/socket';
|
||||
import { getInitials, generateAvatarColor } from '../lib/utils';
|
||||
import Avatar from './Avatar';
|
||||
import { StoryGroup } from '../lib/types';
|
||||
import ChatListItem from '../modules/chats/presentation/components/ChatListItem';
|
||||
import NewChatModal from '../modules/chats/presentation/components/NewChatModal';
|
||||
import UserProfile from '../modules/users/presentation/components/UserProfile';
|
||||
import { useAuthStore } from '../../../modules/auth/application/authStore';
|
||||
import { useChatStore } from '../../../modules/chats/application/chatStore';
|
||||
import { useNotificationStore } from '../../application/stores/notificationStore';
|
||||
import { useLang } from '../../infrastructure/i18n';
|
||||
import { StoryApi } from '../../../modules/stories/infrastructure/storyApi';
|
||||
import { getSocket } from '../../infrastructure/socket';
|
||||
import { getInitials, generateAvatarColor } from '../../utils/utils';
|
||||
import Avatar from '../components/ui/Avatar';
|
||||
import { StoryGroup } from '../../domain/types';
|
||||
import ChatListItem from '../../../modules/chats/presentation/components/ChatListItem';
|
||||
import NewChatModal from '../../../modules/chats/presentation/components/NewChatModal';
|
||||
import UserProfile from '../../../modules/users/presentation/components/UserProfile';
|
||||
import SideMenu from './SideMenu';
|
||||
import StoryViewer, { CreateStoryModal } from '../modules/stories/presentation/components/StoryViewer';
|
||||
import { useStoryStore } from '../modules/stories/application/storyStore';
|
||||
import StoryViewer, { CreateStoryModal } from '../../../modules/stories/presentation/components/StoryViewer';
|
||||
import { useStoryStore } from '../../../modules/stories/application/storyStore';
|
||||
|
||||
const API_URL = import.meta.env.VITE_API_URL || '';
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { create } from 'zustand';
|
||||
import { AuthApi } from '../infrastructure/authApi';
|
||||
import { connectSocket, disconnectSocket } from '../../../lib/socket';
|
||||
import type { User } from '../../../lib/types';
|
||||
import { connectSocket, disconnectSocket } from '../../../core/infrastructure/socket';
|
||||
import type { User } from '../../../core/domain/types';
|
||||
|
||||
interface AuthState {
|
||||
token: string | null;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { httpClient } from '../../../lib/httpClient';
|
||||
import type { User } from '../../../lib/types';
|
||||
import { httpClient } from '../../../core/infrastructure/httpClient';
|
||||
import type { User } from '../../../core/domain/types';
|
||||
|
||||
export class AuthApi {
|
||||
static async login(username: string, password: string) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { useState, useEffect } from 'react';
|
||||
import { motion, AnimatePresence } from 'framer-motion';
|
||||
import { useLang } from '../../../lib/i18n';
|
||||
import { useLang } from '../../../core/infrastructure/i18n';
|
||||
import { MessageSquare } from 'lucide-react';
|
||||
import LoginForm from './components/LoginForm';
|
||||
import RegisterForm from './components/RegisterForm';
|
||||
|
||||
@@ -2,7 +2,7 @@ import React, { useState, FormEvent } from 'react';
|
||||
import { motion, AnimatePresence } from 'framer-motion';
|
||||
import { Eye, EyeOff, ArrowRight } from 'lucide-react';
|
||||
import { useAuthStore } from '../../application/authStore';
|
||||
import { useLang } from '../../../../lib/i18n';
|
||||
import { useLang } from '../../../../core/infrastructure/i18n';
|
||||
import type { LoginCredentials } from '../../domain/types';
|
||||
|
||||
interface Props {
|
||||
|
||||
@@ -2,7 +2,7 @@ import React, { useState, FormEvent } from 'react';
|
||||
import { motion, AnimatePresence } from 'framer-motion';
|
||||
import { Eye, EyeOff, ArrowRight } from 'lucide-react';
|
||||
import { useAuthStore } from '../../application/authStore';
|
||||
import { useLang } from '../../../../lib/i18n';
|
||||
import { useLang } from '../../../../core/infrastructure/i18n';
|
||||
import type { RegisterCredentials } from '../../domain/types';
|
||||
|
||||
interface Props {
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import { useState, useEffect, useRef, useCallback } from 'react';
|
||||
import { motion, AnimatePresence } from 'framer-motion';
|
||||
import { Phone, PhoneOff, Video, VideoOff, Mic, MicOff, Monitor, MonitorOff, Maximize, Minimize, SwitchCamera, Minimize2, Maximize2, Volume2, ShieldCheck, ShieldOff, ChevronUp } from 'lucide-react';
|
||||
import { getSocket } from '../lib/socket';
|
||||
import { UserApi } from '../modules/users/infrastructure/userApi';
|
||||
import { useLang } from '../lib/i18n';
|
||||
import { playCallRingtone, stopCallRingtone, playUnavailableSound } from '../lib/sounds';
|
||||
import { getSocket } from '../../../../core/infrastructure/socket';
|
||||
import { UserApi } from '../../../users/infrastructure/userApi';
|
||||
import { useLang } from '../../../../core/infrastructure/i18n';
|
||||
import { playCallRingtone, stopCallRingtone, playUnavailableSound } from '../../../../core/utils/sounds';
|
||||
|
||||
type CallState = 'idle' | 'calling' | 'incoming' | 'connected' | 'ended';
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
import { useState, useEffect, useRef, useCallback } from 'react';
|
||||
import { motion, AnimatePresence } from 'framer-motion';
|
||||
import { Phone, PhoneOff, Video, VideoOff, Mic, MicOff, Monitor, MonitorOff, Minimize2, Volume2, ShieldCheck, ShieldOff, ChevronUp } from 'lucide-react';
|
||||
import { useChatStore } from '../modules/chats/application/chatStore';
|
||||
import { useAuthStore } from '../modules/auth/application/authStore';
|
||||
import { getSocket } from '../lib/socket';
|
||||
import { getMediaUrl } from '../lib/utils';
|
||||
import { UserApi } from '../modules/users/infrastructure/userApi';
|
||||
import { useLang } from '../lib/i18n';
|
||||
import { useChatStore } from '../../../chats/application/chatStore';
|
||||
import { useAuthStore } from '../../../auth/application/authStore';
|
||||
import { getSocket } from '../../../../core/infrastructure/socket';
|
||||
import { getMediaUrl } from '../../../../core/utils/utils';
|
||||
import { UserApi } from '../../../users/infrastructure/userApi';
|
||||
import { useLang } from '../../../../core/infrastructure/i18n';
|
||||
|
||||
interface ParticipantInfo {
|
||||
id: string;
|
||||
@@ -1,7 +1,7 @@
|
||||
import { create } from 'zustand';
|
||||
import { ChatApi } from '../infrastructure/chatApi';
|
||||
import { useAuthStore } from '../../auth/application/authStore';
|
||||
import type { Chat, ChatMember, Message, TypingUser } from '../../../lib/types';
|
||||
import type { Chat, ChatMember, Message, TypingUser } from '../../../core/domain/types';
|
||||
|
||||
interface ChatState {
|
||||
chats: Chat[];
|
||||
@@ -109,7 +109,7 @@ export const useChatStore = create<ChatState>((set, get) => ({
|
||||
} catch (error: any) {
|
||||
console.error('Load chats error:', error);
|
||||
set({ isLoadingChats: false });
|
||||
const { addNotification } = (await import('../../../stores/notificationStore')).useNotificationStore.getState();
|
||||
const { addNotification } = (await import('../../../core/application/stores/notificationStore')).useNotificationStore.getState();
|
||||
addNotification('error', error.message || 'Failed to load chats');
|
||||
}
|
||||
},
|
||||
@@ -144,7 +144,7 @@ export const useChatStore = create<ChatState>((set, get) => ({
|
||||
} catch (error: any) {
|
||||
console.error('Load messages error:', error);
|
||||
set({ isLoadingMessages: false });
|
||||
const { addNotification } = (await import('../../../stores/notificationStore')).useNotificationStore.getState();
|
||||
const { addNotification } = (await import('../../../core/application/stores/notificationStore')).useNotificationStore.getState();
|
||||
addNotification('error', error.message || 'Failed to load messages');
|
||||
}
|
||||
},
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { httpClient } from '../../../lib/httpClient';
|
||||
import type { Chat, Message } from '../../../lib/types';
|
||||
import { httpClient } from '../../../core/infrastructure/httpClient';
|
||||
import type { Chat, Message } from '../../../core/domain/types';
|
||||
|
||||
export class ChatApi {
|
||||
static async getChats() {
|
||||
|
||||
@@ -2,16 +2,16 @@ import { useEffect, useRef, useState } from 'react';
|
||||
import { motion, AnimatePresence } from 'framer-motion';
|
||||
import { useChatStore } from '../application/chatStore';
|
||||
import { useAuthStore } from '../../auth/application/authStore';
|
||||
import { getSocket, disconnectSocket } from '../../../lib/socket';
|
||||
import { getSocket, disconnectSocket } from '../../../core/infrastructure/socket';
|
||||
import { ChatApi } from '../infrastructure/chatApi';
|
||||
import { playNotificationSound, isChatMuted, playCallRingtone, stopCallRingtone } from '../../../lib/sounds';
|
||||
import { useLang } from '../../../lib/i18n';
|
||||
import type { Message, UserBasic, CallInfo } from '../../../lib/types';
|
||||
import { playNotificationSound, isChatMuted, playCallRingtone, stopCallRingtone } from '../../../core/utils/sounds';
|
||||
import { useLang } from '../../../core/infrastructure/i18n';
|
||||
import type { Message, UserBasic, CallInfo } from '../../../core/domain/types';
|
||||
import { Send, Check, Phone, PhoneOff } from 'lucide-react';
|
||||
import Sidebar from '../../../components/Sidebar';
|
||||
import Sidebar from '../../../core/presentation/layouts/Sidebar';
|
||||
import ChatView from './components/ChatView';
|
||||
import CallModal from '../../../components/CallModal';
|
||||
import GroupCallModal from '../../../components/GroupCallModal';
|
||||
import CallModal from '../../calls/presentation/components/CallModal';
|
||||
import GroupCallModal from '../../calls/presentation/components/GroupCallModal';
|
||||
|
||||
export default function ChatPage() {
|
||||
const {
|
||||
|
||||
@@ -2,14 +2,14 @@ import { useState, useRef, useEffect, memo } from 'react';
|
||||
import { formatDistanceToNow } from 'date-fns';
|
||||
import { ru, enUS } from 'date-fns/locale';
|
||||
import { Check, CheckCheck, Image, FileText, Mic, Video, Pin, Trash2, Bookmark } from 'lucide-react';
|
||||
import { useAuthStore } from '../../../../modules/auth/application/authStore';
|
||||
import { useAuthStore } from '../../../auth/application/authStore';
|
||||
import { useChatStore } from '../../application/chatStore';
|
||||
import { useLang } from '../../../../lib/i18n';
|
||||
import { stripMarkdown } from '../../../../lib/utils';
|
||||
import { useLang } from '../../../../core/infrastructure/i18n';
|
||||
import { stripMarkdown } from '../../../../core/utils/utils';
|
||||
import { ChatApi } from '../../infrastructure/chatApi';
|
||||
import ConfirmModal from '../../../../components/ConfirmModal';
|
||||
import Avatar from '../../../../components/Avatar';
|
||||
import type { Chat } from '../../../../lib/types';
|
||||
import ConfirmModal from '../../../../core/presentation/components/ui/ConfirmModal';
|
||||
import Avatar from '../../../../core/presentation/components/ui/Avatar';
|
||||
import type { Chat } from '../../../../core/domain/types';
|
||||
|
||||
interface ChatListItemProps {
|
||||
chat: Chat;
|
||||
|
||||
@@ -20,22 +20,22 @@ import {
|
||||
MessageSquare,
|
||||
} from 'lucide-react';
|
||||
import { useChatStore } from '../../application/chatStore';
|
||||
import { useAuthStore } from '../../../../modules/auth/application/authStore';
|
||||
import { useAuthStore } from '../../../auth/application/authStore';
|
||||
import { ChatApi } from '../../infrastructure/chatApi';
|
||||
import { getSocket } from '../../../../lib/socket';
|
||||
import { isChatMuted, toggleMuteChat } from '../../../../lib/sounds';
|
||||
import { useLang } from '../../../../lib/i18n';
|
||||
import { formatLastSeen } from '../../../../lib/utils';
|
||||
import type { UserBasic, Message } from '../../../../lib/types';
|
||||
import { getSocket } from '../../../../core/infrastructure/socket';
|
||||
import { isChatMuted, toggleMuteChat } from '../../../../core/utils/sounds';
|
||||
import { useLang } from '../../../../core/infrastructure/i18n';
|
||||
import { formatLastSeen } from '../../../../core/utils/utils';
|
||||
import type { UserBasic, Message } from '../../../../core/domain/types';
|
||||
import MessageBubble from './MessageBubble';
|
||||
import MessageInput from './MessageInput';
|
||||
import TypingIndicator from '../../../../components/TypingIndicator';
|
||||
import TypingIndicator from './TypingIndicator';
|
||||
import UserProfile from '../../../users/presentation/components/UserProfile';
|
||||
import GroupSettings from './GroupSettings';
|
||||
import ForwardModal from '../../../../components/ForwardModal';
|
||||
import ConfirmModal from '../../../../components/ConfirmModal';
|
||||
import Avatar from '../../../../components/Avatar';
|
||||
import { useThemeStore } from '../../../../stores/themeStore';
|
||||
import ForwardModal from './ForwardModal';
|
||||
import ConfirmModal from '../../../../core/presentation/components/ui/ConfirmModal';
|
||||
import Avatar from '../../../../core/presentation/components/ui/Avatar';
|
||||
import { useThemeStore } from '../../../../core/application/stores/themeStore';
|
||||
|
||||
export default function ChatView({ onStartCall, onStartGroupCall }: { onStartCall?: (targetUser: UserBasic, type: 'voice' | 'video') => void; onStartGroupCall?: (chatId: string, chatName: string, type: 'voice' | 'video') => void }) {
|
||||
const { user, config } = useAuthStore();
|
||||
|
||||
@@ -3,9 +3,9 @@ import { createPortal } from 'react-dom';
|
||||
import Picker from '@emoji-mart/react';
|
||||
import data from '@emoji-mart/data';
|
||||
import { Search, TrendingUp, Loader2 } from 'lucide-react';
|
||||
import { useLang } from '../lib/i18n';
|
||||
import { useAuthStore } from '../modules/auth/application/authStore';
|
||||
import { AppApi } from '../lib/appApi';
|
||||
import { useLang } from '../../../../core/infrastructure/i18n';
|
||||
import { useAuthStore } from '../../../auth/application/authStore';
|
||||
import { AppApi } from '../../../../core/infrastructure/appApi';
|
||||
|
||||
interface KlipyGif {
|
||||
id: string;
|
||||
@@ -1,10 +1,10 @@
|
||||
import { useState } from 'react';
|
||||
import { motion, AnimatePresence } from 'framer-motion';
|
||||
import { X, Search } from 'lucide-react';
|
||||
import { useChatStore } from '../modules/chats/application/chatStore';
|
||||
import { useAuthStore } from '../modules/auth/application/authStore';
|
||||
import { useLang } from '../lib/i18n';
|
||||
import Avatar from './Avatar';
|
||||
import { useChatStore } from '../../application/chatStore';
|
||||
import { useAuthStore } from '../../../auth/application/authStore';
|
||||
import { useLang } from '../../../../core/infrastructure/i18n';
|
||||
import Avatar from '../../../../core/presentation/components/ui/Avatar';
|
||||
|
||||
interface ForwardModalProps {
|
||||
onClose: () => void;
|
||||
@@ -22,15 +22,15 @@ import {
|
||||
import Cropper from 'react-easy-crop';
|
||||
import { ChatApi } from '../../infrastructure/chatApi';
|
||||
import { UserApi } from '../../../users/infrastructure/userApi';
|
||||
import { useAuthStore } from '../../../../modules/auth/application/authStore';
|
||||
import { useAuthStore } from '../../../auth/application/authStore';
|
||||
import { useChatStore } from '../../application/chatStore';
|
||||
import { useLang } from '../../../../lib/i18n';
|
||||
import { Chat, UserPresence, Message } from '../../../../lib/types';
|
||||
import Avatar from '../../../../components/Avatar';
|
||||
import ConfirmModal from '../../../../components/ConfirmModal';
|
||||
import ImageLightbox from '../../../../components/ImageLightbox';
|
||||
import { getMediaUrl } from '../../../../lib/utils';
|
||||
import { getCroppedImg } from '../../../../lib/imageCrop';
|
||||
import { useLang } from '../../../../core/infrastructure/i18n';
|
||||
import { Chat, UserPresence, Message } from '../../../../core/domain/types';
|
||||
import Avatar from '../../../../core/presentation/components/ui/Avatar';
|
||||
import ConfirmModal from '../../../../core/presentation/components/ui/ConfirmModal';
|
||||
import ImageLightbox from '../../../../core/presentation/components/ui/ImageLightbox';
|
||||
import { getMediaUrl } from '../../../../core/utils/utils';
|
||||
import { getCroppedImg } from '../../../../core/infrastructure/imageCrop';
|
||||
|
||||
interface GroupSettingsProps {
|
||||
chat: Chat;
|
||||
|
||||
@@ -20,14 +20,14 @@ import {
|
||||
Clock,
|
||||
Forward,
|
||||
} from 'lucide-react';
|
||||
import { useAuthStore } from '../../../../modules/auth/application/authStore';
|
||||
import { useAuthStore } from '../../../auth/application/authStore';
|
||||
import { useChatStore } from '../../application/chatStore';
|
||||
import { getSocket } from '../../../../lib/socket';
|
||||
import { useLang } from '../../../../lib/i18n';
|
||||
import { extractWaveform, getMediaUrl } from '../../../../lib/utils';
|
||||
import type { Message, MediaItem, Reaction, ChatMember } from '../../../../lib/types';
|
||||
import ImageLightbox from '../../../../components/ImageLightbox';
|
||||
import LinkPreview from '../../../../components/LinkPreview';
|
||||
import { getSocket } from '../../../../core/infrastructure/socket';
|
||||
import { useLang } from '../../../../core/infrastructure/i18n';
|
||||
import { extractWaveform, getMediaUrl } from '../../../../core/utils/utils';
|
||||
import type { Message, MediaItem, Reaction, ChatMember } from '../../../../core/domain/types';
|
||||
import ImageLightbox from '../../../../core/presentation/components/ui/ImageLightbox';
|
||||
import LinkPreview from './LinkPreview';
|
||||
|
||||
interface MessageBubbleProps {
|
||||
message: Message;
|
||||
|
||||
@@ -18,13 +18,13 @@ import {
|
||||
Check,
|
||||
} from 'lucide-react';
|
||||
import { useChatStore } from '../../application/chatStore';
|
||||
import { useAuthStore } from '../../../../modules/auth/application/authStore';
|
||||
import { useAuthStore } from '../../../auth/application/authStore';
|
||||
import { ChatApi } from '../../infrastructure/chatApi';
|
||||
import { getSocket } from '../../../../lib/socket';
|
||||
import { useLang } from '../../../../lib/i18n';
|
||||
import { AUDIO_EXTENSIONS, MAX_FILE_SIZE } from '../../../../lib/types';
|
||||
import { useNotificationStore } from '../../../../stores/notificationStore';
|
||||
import EmojiPicker from '../../../../components/EmojiPicker';
|
||||
import { getSocket } from '../../../../core/infrastructure/socket';
|
||||
import { useLang } from '../../../../core/infrastructure/i18n';
|
||||
import { AUDIO_EXTENSIONS, MAX_FILE_SIZE } from '../../../../core/domain/types';
|
||||
import { useNotificationStore } from '../../../../core/application/stores/notificationStore';
|
||||
import EmojiPicker from './EmojiPicker';
|
||||
|
||||
interface Attachment {
|
||||
file: File;
|
||||
|
||||
@@ -5,9 +5,9 @@ import { ChatApi } from '../../infrastructure/chatApi';
|
||||
import { UserApi } from '../../../users/infrastructure/userApi';
|
||||
import { FriendApi } from '../../../friends/infrastructure/friendApi';
|
||||
import { useChatStore } from '../../application/chatStore';
|
||||
import { useAuthStore } from '../../../../modules/auth/application/authStore';
|
||||
import { useLang } from '../../../../lib/i18n';
|
||||
import type { UserPresence, FriendWithId } from '../../../../lib/types';
|
||||
import { useAuthStore } from '../../../auth/application/authStore';
|
||||
import { useLang } from '../../../../core/infrastructure/i18n';
|
||||
import type { UserPresence, FriendWithId } from '../../../../core/domain/types';
|
||||
|
||||
interface NewChatModalProps {
|
||||
onClose: () => void;
|
||||
@@ -57,7 +57,7 @@ export default function NewChatModal({ onClose }: NewChatModalProps) {
|
||||
try {
|
||||
const chat = await ChatApi.createPersonalChat(selectedUser.id);
|
||||
addChat(chat);
|
||||
import('../../../../lib/socket').then(({ getSocket }) => getSocket()?.emit('join_chat', chat.id));
|
||||
import('../../../../core/infrastructure/socket').then(({ getSocket }) => getSocket()?.emit('join_chat', chat.id));
|
||||
setActiveChat(chat.id);
|
||||
loadMessages(chat.id);
|
||||
onClose();
|
||||
@@ -83,7 +83,7 @@ export default function NewChatModal({ onClose }: NewChatModalProps) {
|
||||
selectedUsers.map((u) => u.id)
|
||||
);
|
||||
addChat(chat);
|
||||
import('../../../../lib/socket').then(({ getSocket }) => getSocket()?.emit('join_chat', chat.id));
|
||||
import('../../../../core/infrastructure/socket').then(({ getSocket }) => getSocket()?.emit('join_chat', chat.id));
|
||||
setActiveChat(chat.id);
|
||||
loadMessages(chat.id);
|
||||
onClose();
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { motion } from 'framer-motion';
|
||||
import { useLang } from '../lib/i18n';
|
||||
import { useLang } from '../../../../core/infrastructure/i18n';
|
||||
|
||||
export default function TypingIndicator() {
|
||||
const { t } = useLang();
|
||||
@@ -1,8 +1,8 @@
|
||||
import { create } from 'zustand';
|
||||
import { UserApi } from '../../users/infrastructure/userApi';
|
||||
import { FriendApi } from '../infrastructure/friendApi';
|
||||
import type { FriendWithId, FriendRequest, UserPresence } from '../../../lib/types';
|
||||
import { getSocket } from '../../../lib/socket';
|
||||
import type { FriendWithId, FriendRequest, UserPresence } from '../../../core/domain/types';
|
||||
import { getSocket } from '../../../core/infrastructure/socket';
|
||||
|
||||
interface FriendState {
|
||||
friends: FriendWithId[];
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { httpClient } from '../../../lib/httpClient';
|
||||
import type { FriendshipStatus, FriendRequest, FriendWithId } from '../../../lib/types';
|
||||
import { httpClient } from '../../../core/infrastructure/httpClient';
|
||||
import type { FriendshipStatus, FriendRequest, FriendWithId } from '../../../core/domain/types';
|
||||
|
||||
export class FriendApi {
|
||||
static async getFriends() {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { create } from 'zustand';
|
||||
import { StoryGroup } from '../lib/types';
|
||||
import type { StoryGroup } from '../../../core/domain/types';
|
||||
|
||||
interface StoryState {
|
||||
storyGroups: StoryGroup[];
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { httpClient } from '../../../lib/httpClient';
|
||||
import type { StoryGroup } from '../../../lib/types';
|
||||
import { httpClient } from '../../../core/infrastructure/httpClient';
|
||||
import type { StoryGroup } from '../../../core/domain/types';
|
||||
|
||||
export class StoryApi {
|
||||
static async getStories() {
|
||||
|
||||
@@ -4,11 +4,11 @@ import { X, ChevronLeft, ChevronRight, Eye, Trash2, Plus, ChevronUp, Volume2, Vo
|
||||
import { useAuthStore } from '../../../auth/application/authStore';
|
||||
import { StoryApi } from '../../infrastructure/storyApi';
|
||||
import { ChatApi } from '../../../chats/infrastructure/chatApi';
|
||||
import { getSocket } from '../../../../lib/socket';
|
||||
import { useLang } from '../../../../lib/i18n';
|
||||
import Avatar from '../../../../components/Avatar';
|
||||
import { StoryGroup } from '../../../../lib/types';
|
||||
import { getMediaUrl } from '../../../../lib/utils';
|
||||
import { getSocket } from '../../../../core/infrastructure/socket';
|
||||
import { useLang } from '../../../../core/infrastructure/i18n';
|
||||
import Avatar from '../../../../core/presentation/components/ui/Avatar';
|
||||
import { StoryGroup } from '../../../../core/domain/types';
|
||||
import { getMediaUrl } from '../../../../core/utils/utils';
|
||||
|
||||
const API_URL = import.meta.env.VITE_API_URL || '';
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { httpClient } from '../../../lib/httpClient';
|
||||
import type { User, UserPresence } from '../../../lib/types';
|
||||
import { httpClient } from '../../../core/infrastructure/httpClient';
|
||||
import type { User, UserPresence } from '../../../core/domain/types';
|
||||
|
||||
export class UserApi {
|
||||
static async searchUsers(query: string) {
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import { useState, useRef } from 'react';
|
||||
import { motion, AnimatePresence } from 'framer-motion';
|
||||
import { X, Upload, Check, Loader2, MessageSquare, AlertCircle } from 'lucide-react';
|
||||
import { AppApi } from '../lib/appApi';
|
||||
import { useLang } from '../lib/i18n';
|
||||
import type { User as UserType, FriendWithId } from '../lib/types';
|
||||
import { useAuthStore } from '../modules/auth/application/authStore';
|
||||
import { AppApi } from '../../../../core/infrastructure/appApi';
|
||||
import { useLang } from '../../../../core/infrastructure/i18n';
|
||||
import type { User as UserType, FriendWithId } from '../../../../core/domain/types';
|
||||
import { useAuthStore } from '../../../auth/application/authStore';
|
||||
|
||||
interface TelegramImportModalProps {
|
||||
isOpen: boolean;
|
||||
@@ -7,18 +7,18 @@ import { ChatApi } from '../../../chats/infrastructure/chatApi';
|
||||
import { FriendApi } from '../../../friends/infrastructure/friendApi';
|
||||
import { StoryApi } from '../../../stories/infrastructure/storyApi';
|
||||
import { useAuthStore } from '../../../auth/application/authStore';
|
||||
import { useLang } from '../../../../lib/i18n';
|
||||
import { User, Message, FriendshipStatus, StoryGroup } from '../../../../lib/types';
|
||||
import ConfirmModal from '../../../../components/ConfirmModal';
|
||||
import ImageLightbox from '../../../../components/ImageLightbox';
|
||||
import StoryViewer from '../../../../modules/stories/presentation/components/StoryViewer';
|
||||
import { getSocket } from '../../../../lib/socket';
|
||||
import { useStoryStore } from '../../../../modules/stories/application/storyStore';
|
||||
import { getMediaUrl } from '../../../../lib/utils';
|
||||
import { getCroppedImg } from '../../../../lib/imageCrop';
|
||||
import DatePicker from '../../../../components/DatePicker';
|
||||
import { useLang } from '../../../../core/infrastructure/i18n';
|
||||
import { User, Message, FriendshipStatus, StoryGroup } from '../../../../core/domain/types';
|
||||
import ConfirmModal from '../../../../core/presentation/components/ui/ConfirmModal';
|
||||
import ImageLightbox from '../../../../core/presentation/components/ui/ImageLightbox';
|
||||
import StoryViewer from '../../../stories/presentation/components/StoryViewer';
|
||||
import { getSocket } from '../../../../core/infrastructure/socket';
|
||||
import { useStoryStore } from '../../../stories/application/storyStore';
|
||||
import { getMediaUrl } from '../../../../core/utils/utils';
|
||||
import { getCroppedImg } from '../../../../core/infrastructure/imageCrop';
|
||||
import DatePicker from '../../../../core/presentation/components/ui/DatePicker';
|
||||
import { useChatStore } from '../../../chats/application/chatStore';
|
||||
import { toggleMuteChat, isChatMuted } from '../../../../lib/sounds';
|
||||
import { toggleMuteChat, isChatMuted } from '../../../../core/utils/sounds';
|
||||
|
||||
interface UserProfileProps {
|
||||
userId: string;
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user