diff --git a/frontend/src/App.tsx b/frontend/src/App.tsx index 2e07646..696ed8c 100644 --- a/frontend/src/App.tsx +++ b/frontend/src/App.tsx @@ -9,8 +9,8 @@ import ChatPage from "./pages/chat/ChatPage"; import DownloadAppPage from "./pages/download-app/DownloadAppPage"; import NotFoundPage from "./pages/not-found/NotFoundPage"; import ProtectedRoute from "./pages/ProtectedRoute"; -import { isElectron } from "./pages/chat/electron/electron"; -import { MINIMUM_WIDTH } from "./pages/chat/core/config"; +import { isElectron } from "./core/electron/electron"; +import { MINIMUM_WIDTH } from "./core/config"; import useWindowSize from "./pages/chat/ui/hooks/useWindowSize"; export default function App() { diff --git a/frontend/src/api/authApi.ts b/frontend/src/core/api/authApi.ts similarity index 94% rename from frontend/src/api/authApi.ts rename to frontend/src/core/api/authApi.ts index d95d6bd..a104e4f 100644 --- a/frontend/src/api/authApi.ts +++ b/frontend/src/core/api/authApi.ts @@ -1,8 +1,8 @@ -import type { Headers, UploadPublicKeyRequest, BackupBlob } from "../pages/chat/core/types"; -import { generateX25519KeyPair } from "../utils/crypto/asymmetric"; -import { encodeBlob, encryptBackupWithPassword, decryptBackupWithPassword, decodeBlob } from "../utils/crypto/backup"; -import { b64, ub64 } from "../utils/utils"; -import { API_BASE_URL } from "../pages/chat/core/config"; +import type { Headers, UploadPublicKeyRequest, BackupBlob } from "../types"; +import { generateX25519KeyPair } from "../../utils/crypto/asymmetric"; +import { encodeBlob, encryptBackupWithPassword, decryptBackupWithPassword, decodeBlob } from "../../utils/crypto/backup"; +import { b64, ub64 } from "../../utils/utils"; +import { API_BASE_URL } from "../config"; /** * Generates authentication headers for API requests diff --git a/frontend/src/api/dmApi.ts b/frontend/src/core/api/dmApi.ts similarity index 94% rename from frontend/src/api/dmApi.ts rename to frontend/src/core/api/dmApi.ts index e1d906e..59efea4 100644 --- a/frontend/src/api/dmApi.ts +++ b/frontend/src/core/api/dmApi.ts @@ -1,12 +1,12 @@ -import { API_BASE_URL } from "../pages/chat/core/config"; +import { API_BASE_URL } from "../config"; import { getAuthHeaders } from "./authApi"; -import { ecdhSharedSecret, deriveWrappingKey } from "../utils/crypto/asymmetric"; -import { importAesGcmKey, aesGcmEncrypt, aesGcmDecrypt } from "../utils/crypto/symmetric"; -import { randomBytes } from "../utils/crypto/kdf"; +import { ecdhSharedSecret, deriveWrappingKey } from "../../utils/crypto/asymmetric"; +import { importAesGcmKey, aesGcmEncrypt, aesGcmDecrypt } from "../../utils/crypto/symmetric"; +import { randomBytes } from "../../utils/crypto/kdf"; import { getCurrentKeys } from "./authApi"; -import { request } from "../pages/chat/core/websocket"; -import type { SendDMRequest, DmEnvelope, User, DMEditRequest, DmEncryptedJSON, BaseDmEnvelope } from "../pages/chat/core/types"; -import { b64, ub64 } from "../utils/utils"; +import { request } from "../websocket"; +import type { SendDMRequest, DmEnvelope, User, DMEditRequest, DmEncryptedJSON, BaseDmEnvelope } from "../types"; +import { b64, ub64 } from "../../utils/utils"; export async function decryptDm(envelope: DmEnvelope, senderPublicKeyB64: string): Promise { const keys = getCurrentKeys(); diff --git a/frontend/src/api/profileApi.ts b/frontend/src/core/api/profileApi.ts similarity index 96% rename from frontend/src/api/profileApi.ts rename to frontend/src/core/api/profileApi.ts index 85c382b..9755bdd 100644 --- a/frontend/src/api/profileApi.ts +++ b/frontend/src/core/api/profileApi.ts @@ -1,6 +1,6 @@ import { getAuthHeaders } from "./authApi"; -import { API_BASE_URL } from "../pages/chat/core/config"; -import type { UserProfile } from "../pages/chat/core/types"; +import { API_BASE_URL } from "../config"; +import type { UserProfile } from "../types"; export interface ProfileData { profile_picture?: string; diff --git a/frontend/src/pages/chat/core/config.ts b/frontend/src/core/config.ts similarity index 100% rename from frontend/src/pages/chat/core/config.ts rename to frontend/src/core/config.ts diff --git a/frontend/src/pages/chat/electron/electron.scss b/frontend/src/core/electron/electron.scss similarity index 94% rename from frontend/src/pages/chat/electron/electron.scss rename to frontend/src/core/electron/electron.scss index 3d5f8e9..9f45831 100644 --- a/frontend/src/pages/chat/electron/electron.scss +++ b/frontend/src/core/electron/electron.scss @@ -1,4 +1,4 @@ -@use "../../../css/common/material" as *; +@use "../../css/material" as *; #electron-title-bar { display: none; diff --git a/frontend/src/pages/chat/electron/electron.ts b/frontend/src/core/electron/electron.ts similarity index 100% rename from frontend/src/pages/chat/electron/electron.ts rename to frontend/src/core/electron/electron.ts diff --git a/frontend/src/pages/chat/core/init.ts b/frontend/src/core/init.ts similarity index 100% rename from frontend/src/pages/chat/core/init.ts rename to frontend/src/core/init.ts diff --git a/frontend/src/pages/chat/push-notifications.ts b/frontend/src/core/push-notifications/push-notifications.ts similarity index 97% rename from frontend/src/pages/chat/push-notifications.ts rename to frontend/src/core/push-notifications/push-notifications.ts index c5f7689..e3edd2b 100644 --- a/frontend/src/pages/chat/push-notifications.ts +++ b/frontend/src/core/push-notifications/push-notifications.ts @@ -1,8 +1,8 @@ -import { API_BASE_URL } from "./core/config"; -import { isElectron } from "./electron/electron"; -import { websocket } from "./core/websocket"; -import type { NewMessageWebSocketMessage, WebSocketMessage } from "./core/types"; -import serviceWorker from "../../../service-worker?worker&url"; +import { API_BASE_URL } from "../config"; +import { isElectron } from "../electron/electron"; +import { websocket } from "../websocket"; +import type { NewMessageWebSocketMessage, WebSocketMessage } from "../types"; +import serviceWorker from "./service-worker?worker&url"; export interface PushSubscriptionData { endpoint: string; diff --git a/frontend/src/service-worker.ts b/frontend/src/core/push-notifications/service-worker.ts similarity index 100% rename from frontend/src/service-worker.ts rename to frontend/src/core/push-notifications/service-worker.ts diff --git a/frontend/src/pages/chat/core/types.d.ts b/frontend/src/core/types.d.ts similarity index 100% rename from frontend/src/pages/chat/core/types.d.ts rename to frontend/src/core/types.d.ts diff --git a/frontend/src/pages/chat/core/websocket.ts b/frontend/src/core/websocket.ts similarity index 98% rename from frontend/src/pages/chat/core/websocket.ts rename to frontend/src/core/websocket.ts index b08f771..c881cf3 100644 --- a/frontend/src/pages/chat/core/websocket.ts +++ b/frontend/src/core/websocket.ts @@ -7,7 +7,7 @@ import { API_WS_BASE_URL } from "./config"; import type { WebSocketMessage } from "./types"; -import { delay } from "../../../utils/utils"; +import { delay } from "../utils/utils"; /** * Creates a new WebSocket connection to the chat server diff --git a/frontend/src/css/common/_animations.scss b/frontend/src/css/_animations.scss similarity index 100% rename from frontend/src/css/common/_animations.scss rename to frontend/src/css/_animations.scss diff --git a/frontend/src/css/common/_colors.scss b/frontend/src/css/_colors.scss similarity index 100% rename from frontend/src/css/common/_colors.scss rename to frontend/src/css/_colors.scss diff --git a/frontend/src/css/common/_components.scss b/frontend/src/css/_components.scss similarity index 50% rename from frontend/src/css/common/_components.scss rename to frontend/src/css/_components.scss index 4567775..03bb64c 100644 --- a/frontend/src/css/common/_components.scss +++ b/frontend/src/css/_components.scss @@ -30,77 +30,6 @@ button, input { font: inherit; } -.context-menu { - position: relative; - background-color: $color-dark-surface-container; - border-radius: 8px; - box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3); - padding: 0.5rem 0; - z-index: 1000; - display: block; - min-width: 150px; - max-width: 200px; - white-space: nowrap; - user-select: none; - - .context-menu-item { - display: flex; - align-items: center; - gap: 0.5rem; - padding: 0.75rem 1rem; - cursor: pointer; - color: $color-dark-on-surface; - transition: background-color 0.2s ease; - font-size: 0.9rem; - white-space: nowrap; - overflow: hidden; - text-overflow: ellipsis; - - &:hover { - background-color: rgba(255, 255, 255, 0.1); - } - - .material-symbols { - font-size: 1.1rem; - flex-shrink: 0; - } - } - - &.pos-top-left { - transform-origin: top right; - } - &.pos-top-right { - transform-origin: top left; - } - &.pos-bottom-left { - transform-origin: bottom right; - } - &.pos-bottom-right { - transform-origin: bottom left; - } - - &.open { - animation: context-menu-open 0.25s ease; - } - - &.faded { - opacity: 0; - transition: opacity 0.3s ease-out; - } - - @keyframes context-menu-open { - 0% { - opacity: 0; - transform: scale(0.5); - } - - 100% { - opacity: 1; - transform: scale(1); - } - } -} - // Dialog content styles .dialog-content { h3 { diff --git a/frontend/src/css/common/_material.scss b/frontend/src/css/_material.scss similarity index 100% rename from frontend/src/css/common/_material.scss rename to frontend/src/css/_material.scss diff --git a/frontend/src/css/lib/fonts/material-symbols.scss b/frontend/src/css/fonts/material-symbols.scss similarity index 100% rename from frontend/src/css/lib/fonts/material-symbols.scss rename to frontend/src/css/fonts/material-symbols.scss diff --git a/frontend/src/css/lib/fonts/material-symbols.woff2 b/frontend/src/css/fonts/material-symbols.woff2 similarity index 100% rename from frontend/src/css/lib/fonts/material-symbols.woff2 rename to frontend/src/css/fonts/material-symbols.woff2 diff --git a/frontend/src/css/lib/fonts/montserrat.scss b/frontend/src/css/fonts/montserrat.scss similarity index 100% rename from frontend/src/css/lib/fonts/montserrat.scss rename to frontend/src/css/fonts/montserrat.scss diff --git a/frontend/src/css/lib/fonts/montserrat/JTUSjIg1_i6t8kCHKm459W1hyyTh89ZNpQ.woff2 b/frontend/src/css/fonts/montserrat/JTUSjIg1_i6t8kCHKm459W1hyyTh89ZNpQ.woff2 similarity index 100% rename from frontend/src/css/lib/fonts/montserrat/JTUSjIg1_i6t8kCHKm459W1hyyTh89ZNpQ.woff2 rename to frontend/src/css/fonts/montserrat/JTUSjIg1_i6t8kCHKm459W1hyyTh89ZNpQ.woff2 diff --git a/frontend/src/css/lib/fonts/montserrat/JTUSjIg1_i6t8kCHKm459WRhyyTh89ZNpQ.woff2 b/frontend/src/css/fonts/montserrat/JTUSjIg1_i6t8kCHKm459WRhyyTh89ZNpQ.woff2 similarity index 100% rename from frontend/src/css/lib/fonts/montserrat/JTUSjIg1_i6t8kCHKm459WRhyyTh89ZNpQ.woff2 rename to frontend/src/css/fonts/montserrat/JTUSjIg1_i6t8kCHKm459WRhyyTh89ZNpQ.woff2 diff --git a/frontend/src/css/lib/fonts/montserrat/JTUSjIg1_i6t8kCHKm459WZhyyTh89ZNpQ.woff2 b/frontend/src/css/fonts/montserrat/JTUSjIg1_i6t8kCHKm459WZhyyTh89ZNpQ.woff2 similarity index 100% rename from frontend/src/css/lib/fonts/montserrat/JTUSjIg1_i6t8kCHKm459WZhyyTh89ZNpQ.woff2 rename to frontend/src/css/fonts/montserrat/JTUSjIg1_i6t8kCHKm459WZhyyTh89ZNpQ.woff2 diff --git a/frontend/src/css/lib/fonts/montserrat/JTUSjIg1_i6t8kCHKm459WdhyyTh89ZNpQ.woff2 b/frontend/src/css/fonts/montserrat/JTUSjIg1_i6t8kCHKm459WdhyyTh89ZNpQ.woff2 similarity index 100% rename from frontend/src/css/lib/fonts/montserrat/JTUSjIg1_i6t8kCHKm459WdhyyTh89ZNpQ.woff2 rename to frontend/src/css/fonts/montserrat/JTUSjIg1_i6t8kCHKm459WdhyyTh89ZNpQ.woff2 diff --git a/frontend/src/css/lib/fonts/montserrat/JTUSjIg1_i6t8kCHKm459WlhyyTh89Y.woff2 b/frontend/src/css/fonts/montserrat/JTUSjIg1_i6t8kCHKm459WlhyyTh89Y.woff2 similarity index 100% rename from frontend/src/css/lib/fonts/montserrat/JTUSjIg1_i6t8kCHKm459WlhyyTh89Y.woff2 rename to frontend/src/css/fonts/montserrat/JTUSjIg1_i6t8kCHKm459WlhyyTh89Y.woff2 diff --git a/frontend/src/css/style.scss b/frontend/src/css/style.scss index b490119..9ab39fe 100644 --- a/frontend/src/css/style.scss +++ b/frontend/src/css/style.scss @@ -1,10 +1,10 @@ -@use "common/animations"; -@use "common/components"; -@use "common/colors" as *; -@use "common/material" as *; +@use "animations"; +@use "components"; +@use "colors" as *; +@use "material" as *; -@use "lib/fonts/montserrat"; -@use "lib/fonts/material-symbols"; +@use "fonts/montserrat"; +@use "fonts/material-symbols"; * { diff --git a/frontend/src/main.tsx b/frontend/src/main.tsx index 9269967..d89d1e8 100644 --- a/frontend/src/main.tsx +++ b/frontend/src/main.tsx @@ -9,8 +9,8 @@ import './css/style.scss'; import "mdui/mdui.css"; import "./utils/material"; -import "./pages/chat/core/init"; -import "./pages/chat/electron/electron"; +import "./core/init"; +import "./core/electron/electron"; import { createRoot } from 'react-dom/client'; import App from './App'; import { StrictMode } from 'react'; diff --git a/frontend/src/pages/auth/LoginPage.tsx b/frontend/src/pages/auth/LoginPage.tsx index 0a36ecd..be27b3a 100644 --- a/frontend/src/pages/auth/LoginPage.tsx +++ b/frontend/src/pages/auth/LoginPage.tsx @@ -1,15 +1,15 @@ import { useImmer } from "use-immer"; import { AlertsContainer, type Alert, type AlertType } from "../chat/ui/components/Alerts"; import { AuthContainer, AuthHeader } from "../chat/ui/components/Auth"; -import type { ErrorResponse, LoginRequest, LoginResponse } from "../chat/core/types"; -import { ensureKeysOnLogin } from "../../api/authApi"; -import { API_BASE_URL } from "../chat/core/config"; +import type { ErrorResponse, LoginRequest, LoginResponse } from "../../core/types"; +import { ensureKeysOnLogin } from "../../core/api/authApi"; +import { API_BASE_URL } from "../../core/config"; import { useRef } from "react"; import type { TextField } from "mdui/components/text-field"; import { useAppState } from "../chat/ui/state"; import { MaterialTextField } from "../chat/ui/components/core/TextField"; -import { initialize, isSupported, startElectronReceiver, subscribe } from "../chat/push-notifications"; -import { isElectron } from "../chat/electron/electron"; +import { initialize, isSupported, startElectronReceiver, subscribe } from "../../core/push-notifications/push-notifications"; +import { isElectron } from "../../core/electron/electron"; import { useNavigate } from "react-router-dom"; import "./auth.scss"; diff --git a/frontend/src/pages/auth/RegisterPage.tsx b/frontend/src/pages/auth/RegisterPage.tsx index ec2b906..1bddf1e 100644 --- a/frontend/src/pages/auth/RegisterPage.tsx +++ b/frontend/src/pages/auth/RegisterPage.tsx @@ -3,11 +3,11 @@ import { AuthContainer, AuthHeader } from "../chat/ui/components/Auth"; import { AlertsContainer, type Alert, type AlertType } from "../chat/ui/components/Alerts"; import { useRef } from "react"; import { TextField } from "mdui/components/text-field"; -import type { ErrorResponse, RegisterRequest, LoginResponse } from "../chat/core/types"; -import { API_BASE_URL } from "../chat/core/config"; +import type { ErrorResponse, RegisterRequest, LoginResponse } from "../../core/types"; +import { API_BASE_URL } from "../../core/config"; import { useAppState } from "../chat/ui/state"; import { MaterialTextField } from "../chat/ui/components/core/TextField"; -import { ensureKeysOnLogin } from "../../api/authApi"; +import { ensureKeysOnLogin } from "../../core/api/authApi"; import { useNavigate } from "react-router-dom"; import "./auth.scss"; diff --git a/frontend/src/pages/auth/auth.scss b/frontend/src/pages/auth/auth.scss index aea00ca..2427d3c 100644 --- a/frontend/src/pages/auth/auth.scss +++ b/frontend/src/pages/auth/auth.scss @@ -1,5 +1,5 @@ -@use "../../css/common/colors" as *; -@use "../../css/common/material" as *; +@use "../../css/colors" as *; +@use "../../css/material" as *; .auth-container { display: flex; diff --git a/frontend/src/pages/chat/css/_animations.scss b/frontend/src/pages/chat/css/_animations.scss index 14b01c6..d837774 100644 --- a/frontend/src/pages/chat/css/_animations.scss +++ b/frontend/src/pages/chat/css/_animations.scss @@ -1,5 +1,5 @@ -@use "../../../css/common/colors" as *; -@use "../../../css/common/material" as *; +@use "../../../css/colors" as *; +@use "../../../css/material" as *; @use "sass:color"; // Animation for reactions appearing/disappearing diff --git a/frontend/src/pages/chat/css/_chat-input.scss b/frontend/src/pages/chat/css/_chat-input.scss index bea62bf..9ac5779 100644 --- a/frontend/src/pages/chat/css/_chat-input.scss +++ b/frontend/src/pages/chat/css/_chat-input.scss @@ -1,5 +1,5 @@ -@use "../../../css/common/colors" as *; -@use "../../../css/common/material" as *; +@use "../../../css/colors" as *; +@use "../../../css/material" as *; @use "sass:color"; .chat-input-wrapper { diff --git a/frontend/src/pages/chat/css/_context-menu.scss b/frontend/src/pages/chat/css/_context-menu.scss index 60b4bba..1720e46 100644 --- a/frontend/src/pages/chat/css/_context-menu.scss +++ b/frontend/src/pages/chat/css/_context-menu.scss @@ -1,5 +1,5 @@ -@use "../../../css/common/colors" as *; -@use "../../../css/common/material" as *; +@use "../../../css/colors" as *; +@use "../../../css/material" as *; @use "sass:color"; // Reaction bar styles (standalone) diff --git a/frontend/src/pages/chat/css/_layout.scss b/frontend/src/pages/chat/css/_layout.scss index 720a0d4..b64bea8 100644 --- a/frontend/src/pages/chat/css/_layout.scss +++ b/frontend/src/pages/chat/css/_layout.scss @@ -1,5 +1,5 @@ -@use "../../../css/common/colors" as *; -@use "../../../css/common/material" as *; +@use "../../../css/colors" as *; +@use "../../../css/material" as *; @use "sass:color"; #chat-interface { diff --git a/frontend/src/pages/chat/css/_left-panel.scss b/frontend/src/pages/chat/css/_left-panel.scss index d2f59cb..1c47a74 100644 --- a/frontend/src/pages/chat/css/_left-panel.scss +++ b/frontend/src/pages/chat/css/_left-panel.scss @@ -1,5 +1,5 @@ -@use "../../../css/common/colors" as *; -@use "../../../css/common/material" as *; +@use "../../../css/colors" as *; +@use "../../../css/material" as *; @use "sass:color"; .header { diff --git a/frontend/src/pages/chat/css/_message-reactions.scss b/frontend/src/pages/chat/css/_message-reactions.scss index 5e67b9a..7225cc2 100644 --- a/frontend/src/pages/chat/css/_message-reactions.scss +++ b/frontend/src/pages/chat/css/_message-reactions.scss @@ -1,5 +1,5 @@ -@use "../../../css/common/colors" as *; -@use "../../../css/common/material" as *; +@use "../../../css/colors" as *; +@use "../../../css/material" as *; @use "sass:color"; // Reaction styles diff --git a/frontend/src/pages/chat/css/_message.scss b/frontend/src/pages/chat/css/_message.scss index 7bb0ecc..79556fa 100644 --- a/frontend/src/pages/chat/css/_message.scss +++ b/frontend/src/pages/chat/css/_message.scss @@ -1,5 +1,5 @@ -@use "../../../css/common/colors" as *; -@use "../../../css/common/material" as *; +@use "../../../css/colors" as *; +@use "../../../css/material" as *; @use "sass:color"; .quote.contextual-content > .quote-inner { diff --git a/frontend/src/pages/chat/css/_profile-dialog.scss b/frontend/src/pages/chat/css/_profile-dialog.scss index 594ed54..b5315c9 100644 --- a/frontend/src/pages/chat/css/_profile-dialog.scss +++ b/frontend/src/pages/chat/css/_profile-dialog.scss @@ -1,5 +1,5 @@ -@use "../../../css/common/colors" as *; -@use "../../../css/common/material" as *; +@use "../../../css/colors" as *; +@use "../../../css/material" as *; @use "sass:color"; // Profile styles diff --git a/frontend/src/pages/chat/css/_right-panel.scss b/frontend/src/pages/chat/css/_right-panel.scss index 23a5503..f6ff746 100644 --- a/frontend/src/pages/chat/css/_right-panel.scss +++ b/frontend/src/pages/chat/css/_right-panel.scss @@ -1,5 +1,5 @@ -@use "../../../css/common/colors" as *; -@use "../../../css/common/material" as *; +@use "../../../css/colors" as *; +@use "../../../css/material" as *; @use "sass:color"; .chat-main { diff --git a/frontend/src/pages/chat/css/_settings-dialog.scss b/frontend/src/pages/chat/css/_settings-dialog.scss index a05cf50..fca04b6 100644 --- a/frontend/src/pages/chat/css/_settings-dialog.scss +++ b/frontend/src/pages/chat/css/_settings-dialog.scss @@ -1,5 +1,5 @@ -@use "../../../css/common/colors" as *; -@use "../../../css/common/material" as *; +@use "../../../css/colors" as *; +@use "../../../css/material" as *; @use "sass:color"; // Settings styles diff --git a/frontend/src/pages/chat/ui/components/Electron.tsx b/frontend/src/pages/chat/ui/components/Electron.tsx index 1052454..296d9d1 100644 --- a/frontend/src/pages/chat/ui/components/Electron.tsx +++ b/frontend/src/pages/chat/ui/components/Electron.tsx @@ -1,5 +1,5 @@ -import { PRODUCT_NAME } from "../../core/config"; -import { isElectron } from "../../electron/electron"; +import { PRODUCT_NAME } from "../../../../core/config"; +import { isElectron } from "../../../../core/electron/electron"; export function ElectronTitleBar() { return isElectron && ( diff --git a/frontend/src/pages/chat/ui/components/chat/ChatHeader.tsx b/frontend/src/pages/chat/ui/components/chat/ChatHeader.tsx index 2c47b88..0569871 100644 --- a/frontend/src/pages/chat/ui/components/chat/ChatHeader.tsx +++ b/frontend/src/pages/chat/ui/components/chat/ChatHeader.tsx @@ -1,4 +1,4 @@ -import { PRODUCT_NAME } from "../../../core/config"; +import { PRODUCT_NAME } from "../../../../../core/config"; import useProfile from "../../hooks/useProfile"; import defaultAvatar from "../../../resources/images/default-avatar.png"; import { useState } from "react"; diff --git a/frontend/src/pages/chat/ui/components/chat/ChatInputWrapper.tsx b/frontend/src/pages/chat/ui/components/chat/ChatInputWrapper.tsx index 89df0f9..7f2d42f 100644 --- a/frontend/src/pages/chat/ui/components/chat/ChatInputWrapper.tsx +++ b/frontend/src/pages/chat/ui/components/chat/ChatInputWrapper.tsx @@ -1,7 +1,7 @@ import { useState, useEffect, useRef } from "react"; import { MaterialDialog } from "../core/Dialog"; import { RichTextArea } from "../core/RichTextArea"; -import type { Message } from "../../../core/types"; +import type { Message } from "../../../../../core/types"; import Quote from "../core/Quote"; import AnimatedHeight from "../core/animations/AnimatedHeight"; import { useImmer } from "use-immer"; diff --git a/frontend/src/pages/chat/ui/components/chat/ChatMessages.tsx b/frontend/src/pages/chat/ui/components/chat/ChatMessages.tsx index 60df171..a5cf808 100644 --- a/frontend/src/pages/chat/ui/components/chat/ChatMessages.tsx +++ b/frontend/src/pages/chat/ui/components/chat/ChatMessages.tsx @@ -1,15 +1,15 @@ import { Message } from "./Message"; import { useAppState } from "../../state"; -import type { Message as MessageType } from "../../../core/types"; -import type { UserProfile } from "../../../core/types"; +import type { Message as MessageType } from "../../../../../core/types"; +import type { UserProfile } from "../../../../../core/types"; import { UserProfileDialog } from "./UserProfileDialog"; import { MessageContextMenu, type ContextMenuState } from "./MessageContextMenu"; -import { fetchUserProfile } from "../../../../../api/profileApi"; +import { fetchUserProfile } from "../../../../../core/api/profileApi"; import { useEffect, useState, type ReactNode } from "react"; import { delay } from "../../../../../utils/utils"; import { MaterialDialog } from "../core/Dialog"; -import { request } from "../../../core/websocket"; -import type { AddReactionRequest, AddDmReactionRequest } from "../../../core/types"; +import { request } from "../../../../../core/websocket"; +import type { AddReactionRequest, AddDmReactionRequest } from "../../../../../core/types"; interface ChatMessagesProps { messages?: MessageType[]; diff --git a/frontend/src/pages/chat/ui/components/chat/DMUsersList.tsx b/frontend/src/pages/chat/ui/components/chat/DMUsersList.tsx index 7d20b78..89e820c 100644 --- a/frontend/src/pages/chat/ui/components/chat/DMUsersList.tsx +++ b/frontend/src/pages/chat/ui/components/chat/DMUsersList.tsx @@ -1,7 +1,7 @@ import { useEffect } from "react"; import { useDM, type DMUser } from "../../hooks/useDM"; import { useAppState } from "../../state"; -import { fetchUserPublicKey } from "../../../../../api/dmApi"; +import { fetchUserPublicKey } from "../../../../../core/api/dmApi"; import defaultAvatar from "../../../../../images/default-avatar.png"; export function DMUsersList() { diff --git a/frontend/src/pages/chat/ui/components/chat/EmojiMenu.tsx b/frontend/src/pages/chat/ui/components/chat/EmojiMenu.tsx index c701c4c..a7c0b8d 100644 --- a/frontend/src/pages/chat/ui/components/chat/EmojiMenu.tsx +++ b/frontend/src/pages/chat/ui/components/chat/EmojiMenu.tsx @@ -1,6 +1,6 @@ import { useState, useEffect, useRef, useCallback } from "react"; import { EMOJI_CATEGORIES, getRecentEmojis, addRecentEmoji } from "./emojiData"; -import type { Size2D } from "../../../core/types"; +import type { Size2D } from "../../../../../core/types"; interface BaseEmojiMenuProps { isOpen: boolean; diff --git a/frontend/src/pages/chat/ui/components/chat/LeftPanel.tsx b/frontend/src/pages/chat/ui/components/chat/LeftPanel.tsx index 6c30c39..9d15d35 100644 --- a/frontend/src/pages/chat/ui/components/chat/LeftPanel.tsx +++ b/frontend/src/pages/chat/ui/components/chat/LeftPanel.tsx @@ -1,4 +1,4 @@ -import { PRODUCT_NAME } from "../../../core/config"; +import { PRODUCT_NAME } from "../../../../../core/config"; import { useAppState } from "../../state"; import defaultAvatar from "../../../../../images/default-avatar.png"; import { useState, type FormEvent } from "react"; diff --git a/frontend/src/pages/chat/ui/components/chat/Message.tsx b/frontend/src/pages/chat/ui/components/chat/Message.tsx index 05fe6d0..058f85a 100644 --- a/frontend/src/pages/chat/ui/components/chat/Message.tsx +++ b/frontend/src/pages/chat/ui/components/chat/Message.tsx @@ -1,14 +1,14 @@ import { formatTime, id } from "../../../../../utils/utils"; -import type { Attachment, Message as MessageType } from "../../../core/types"; +import type { Attachment, Message as MessageType } from "../../../../../core/types"; import defaultAvatar from "../../../../../images/default-avatar.png"; import Quote from "../core/Quote"; import { parse } from "marked"; import DOMPurify from "dompurify"; import { useEffect, useState, useRef } from "react"; -import { getCurrentKeys } from "../../../../../api/authApi"; +import { getCurrentKeys } from "../../../../../core/api/authApi"; import { ecdhSharedSecret, deriveWrappingKey } from "../../../../../utils/crypto/asymmetric"; import { importAesGcmKey, aesGcmDecrypt } from "../../../../../utils/crypto/symmetric"; -import { getAuthHeaders } from "../../../../../api/authApi"; +import { getAuthHeaders } from "../../../../../core/api/authApi"; import { useAppState } from "../../state"; import { ub64 } from "../../../../../utils/utils"; import { useImmer } from "use-immer"; diff --git a/frontend/src/pages/chat/ui/components/chat/MessageContextMenu.tsx b/frontend/src/pages/chat/ui/components/chat/MessageContextMenu.tsx index 6ccf740..6db8a5e 100644 --- a/frontend/src/pages/chat/ui/components/chat/MessageContextMenu.tsx +++ b/frontend/src/pages/chat/ui/components/chat/MessageContextMenu.tsx @@ -1,5 +1,5 @@ import { useState, useEffect, useRef } from "react"; -import type { Message, Size2D } from "../../../core/types"; +import type { Message, Size2D } from "../../../../../core/types"; import { EmojiMenu } from "./EmojiMenu"; interface MessageContextMenuProps { diff --git a/frontend/src/pages/chat/ui/components/chat/MessagePanelRenderer.tsx b/frontend/src/pages/chat/ui/components/chat/MessagePanelRenderer.tsx index 96795af..8b6d8de 100644 --- a/frontend/src/pages/chat/ui/components/chat/MessagePanelRenderer.tsx +++ b/frontend/src/pages/chat/ui/components/chat/MessagePanelRenderer.tsx @@ -3,8 +3,8 @@ import { useAppState } from "../../state"; import { MessagePanel, type MessagePanelState } from "../../panels/MessagePanel"; import { ChatMessages } from "./ChatMessages"; import { ChatInputWrapper } from "./ChatInputWrapper"; -import { setGlobalMessageHandler } from "../../../core/websocket"; -import type { Message, WebSocketMessage } from "../../../core/types"; +import { setGlobalMessageHandler } from "../../../../../core/websocket"; +import type { Message, WebSocketMessage } from "../../../../../core/types"; import defaultAvatar from "../../../../../images/default-avatar.png"; import AnimatedOpacity from "../core/animations/AnimatedOpacity"; import type { DMPanel } from "../../panels/DMPanel"; diff --git a/frontend/src/pages/chat/ui/components/chat/MessageReactions.tsx b/frontend/src/pages/chat/ui/components/chat/MessageReactions.tsx index 808a82e..d811d1a 100644 --- a/frontend/src/pages/chat/ui/components/chat/MessageReactions.tsx +++ b/frontend/src/pages/chat/ui/components/chat/MessageReactions.tsx @@ -1,6 +1,6 @@ import { useAppState } from "../../state"; import { useState, useEffect } from "react"; -import type { Reaction } from "../../../core/types"; +import type { Reaction } from "../../../../../core/types"; interface MessageReactionsProps { reactions?: Reaction[]; diff --git a/frontend/src/pages/chat/ui/components/chat/ReplyMessageDialog.tsx b/frontend/src/pages/chat/ui/components/chat/ReplyMessageDialog.tsx index f270d1a..1207f28 100644 --- a/frontend/src/pages/chat/ui/components/chat/ReplyMessageDialog.tsx +++ b/frontend/src/pages/chat/ui/components/chat/ReplyMessageDialog.tsx @@ -1,5 +1,5 @@ import { useState, useEffect } from "react"; -import type { Message } from "../../../core/types"; +import type { Message } from "../../../../../core/types"; import { MaterialDialog } from "../core/Dialog"; import { MaterialTextField } from "../core/TextField"; diff --git a/frontend/src/pages/chat/ui/components/chat/UserProfileDialog.tsx b/frontend/src/pages/chat/ui/components/chat/UserProfileDialog.tsx index 1861f7c..ef3eeeb 100644 --- a/frontend/src/pages/chat/ui/components/chat/UserProfileDialog.tsx +++ b/frontend/src/pages/chat/ui/components/chat/UserProfileDialog.tsx @@ -1,5 +1,5 @@ -import type { DialogProps } from "../../../core/types"; -import type { UserProfile } from "../../../core/types"; +import type { DialogProps } from "../../../../../core/types"; +import type { UserProfile } from "../../../../../core/types"; import { MaterialDialog } from "../core/Dialog"; import { formatTime } from "../../../../../utils/utils"; import defaultAvatar from "../../../../../images/default-avatar.png"; diff --git a/frontend/src/pages/chat/ui/components/profile/ImageCropper.tsx b/frontend/src/pages/chat/ui/components/profile/ImageCropper.tsx index 58baedc..805b290 100644 --- a/frontend/src/pages/chat/ui/components/profile/ImageCropper.tsx +++ b/frontend/src/pages/chat/ui/components/profile/ImageCropper.tsx @@ -1,5 +1,5 @@ import { useEffect, useRef, useState } from "react"; -import type { Size2D, Rect } from "../../../core/types"; +import type { Size2D, Rect } from "../../../../../core/types"; interface ImageCropperProps { onCrop: (croppedImageData: string) => void; diff --git a/frontend/src/pages/chat/ui/components/profile/ProfileDialog.tsx b/frontend/src/pages/chat/ui/components/profile/ProfileDialog.tsx index 8a2b359..3d9f558 100644 --- a/frontend/src/pages/chat/ui/components/profile/ProfileDialog.tsx +++ b/frontend/src/pages/chat/ui/components/profile/ProfileDialog.tsx @@ -1,7 +1,7 @@ import { useState, useEffect, useRef, type FormEvent } from "react"; import defaultAvatar from "../../../../../images/default-avatar.png"; import type { TextField } from "mdui/components/text-field"; -import type { DialogProps } from "../../../core/types"; +import type { DialogProps } from "../../../../../core/types"; import { MaterialDialog } from "../core/Dialog"; import useProfile from "../../hooks/useProfile"; import { ImageCropper } from "./ImageCropper"; diff --git a/frontend/src/pages/chat/ui/components/settings/SettingsDialog.tsx b/frontend/src/pages/chat/ui/components/settings/SettingsDialog.tsx index 7cf21eb..dddd301 100644 --- a/frontend/src/pages/chat/ui/components/settings/SettingsDialog.tsx +++ b/frontend/src/pages/chat/ui/components/settings/SettingsDialog.tsx @@ -1,12 +1,12 @@ import { useState, useEffect } from "react"; -import { PRODUCT_NAME, API_BASE_URL } from "../../../core/config"; -import type { DialogProps } from "../../../core/types"; +import { PRODUCT_NAME, API_BASE_URL } from "../../../../../core/config"; +import type { DialogProps } from "../../../../../core/types"; import { MaterialDialog } from "../core/Dialog"; -import { initialize, isSupported, startElectronReceiver, stopElectronReceiver, subscribe, unsubscribe } from "../../../push-notifications"; -import { isElectron } from "../../../electron/electron"; +import { initialize, isSupported, startElectronReceiver, stopElectronReceiver, subscribe, unsubscribe } from "../../../../../core/push-notifications/push-notifications"; +import { isElectron } from "../../../../../core/electron/electron"; import { useAppState } from "../../state"; import type { Switch } from "mdui/components/switch"; -import { getAuthHeaders } from "../../../../../api/authApi"; +import { getAuthHeaders } from "../../../../../core/api/authApi"; export function SettingsDialog({ isOpen, onOpenChange }: DialogProps) { const [activePanel, setActivePanel] = useState("notifications-settings"); diff --git a/frontend/src/pages/chat/ui/hooks/useDM.ts b/frontend/src/pages/chat/ui/hooks/useDM.ts index 53ae1bd..713073b 100644 --- a/frontend/src/pages/chat/ui/hooks/useDM.ts +++ b/frontend/src/pages/chat/ui/hooks/useDM.ts @@ -6,9 +6,9 @@ import { fetchDMHistory, decryptDm, sendDMViaWebSocket -} from "../../../../api/dmApi"; -import type { User, Message, DmEncryptedJSON } from "../../core/types"; -import { websocket } from "../../core/websocket"; +} from "../../../../core/api/dmApi"; +import type { User, Message, DmEncryptedJSON } from "../../../../core/types"; +import { websocket } from "../../../../core/websocket"; export interface DMUser extends User { lastMessage?: string; diff --git a/frontend/src/pages/chat/ui/hooks/useProfile.ts b/frontend/src/pages/chat/ui/hooks/useProfile.ts index de890e6..329f753 100644 --- a/frontend/src/pages/chat/ui/hooks/useProfile.ts +++ b/frontend/src/pages/chat/ui/hooks/useProfile.ts @@ -1,6 +1,6 @@ import { useState, useCallback, useEffect } from "react"; import { useAppState } from "../state"; -import { loadProfile, updateProfile, uploadProfilePicture, type ProfileData } from "../../../../api/profileApi"; +import { loadProfile, updateProfile, uploadProfilePicture, type ProfileData } from "../../../../core/api/profileApi"; import { showSuccess, showError } from "../../../../utils/notification"; export default function useProfile() { diff --git a/frontend/src/pages/chat/ui/panels/DMPanel.ts b/frontend/src/pages/chat/ui/panels/DMPanel.ts index eb6e8c0..8dc8871 100644 --- a/frontend/src/pages/chat/ui/panels/DMPanel.ts +++ b/frontend/src/pages/chat/ui/panels/DMPanel.ts @@ -6,8 +6,8 @@ import { sendDmWithFiles, editDmEnvelope, deleteDmEnvelope -} from "../../../../api/dmApi"; -import type { DmEncryptedJSON, DmEnvelope, DMWebSocketMessage, EncryptedMessageJson, Message } from "../../core/types"; +} from "../../../../core/api/dmApi"; +import type { DmEncryptedJSON, DmEnvelope, DMWebSocketMessage, EncryptedMessageJson, Message } from "../../../../core/types"; import type { UserState } from "../state"; export interface DMPanelData { diff --git a/frontend/src/pages/chat/ui/panels/MessagePanel.ts b/frontend/src/pages/chat/ui/panels/MessagePanel.ts index 53d4872..f8b44cc 100644 --- a/frontend/src/pages/chat/ui/panels/MessagePanel.ts +++ b/frontend/src/pages/chat/ui/panels/MessagePanel.ts @@ -1,4 +1,4 @@ -import type { Message, WebSocketMessage } from "../../core/types"; +import type { Message, WebSocketMessage } from "../../../../core/types"; import type { UserState } from "../state"; export interface MessagePanelState { diff --git a/frontend/src/pages/chat/ui/panels/PublicChatPanel.ts b/frontend/src/pages/chat/ui/panels/PublicChatPanel.ts index 38372cf..a1bf903 100644 --- a/frontend/src/pages/chat/ui/panels/PublicChatPanel.ts +++ b/frontend/src/pages/chat/ui/panels/PublicChatPanel.ts @@ -1,8 +1,8 @@ import { MessagePanel } from "./MessagePanel"; -import { API_BASE_URL } from "../../core/config"; -import { getAuthHeaders } from "../../../../api/authApi"; -import { request } from "../../core/websocket"; -import type { ChatWebSocketMessage, Message, SendMessageRequest, ReactionUpdateWebSocketMessage } from "../../core/types"; +import { API_BASE_URL } from "../../../../core/config"; +import { getAuthHeaders } from "../../../../core/api/authApi"; +import { request } from "../../../../core/websocket"; +import type { ChatWebSocketMessage, Message, SendMessageRequest, ReactionUpdateWebSocketMessage } from "../../../../core/types"; import type { UserState } from "../state"; export class PublicChatPanel extends MessagePanel { diff --git a/frontend/src/pages/chat/ui/screen/ChatScreen.tsx b/frontend/src/pages/chat/ui/screen/ChatScreen.tsx deleted file mode 100644 index 04b2707..0000000 --- a/frontend/src/pages/chat/ui/screen/ChatScreen.tsx +++ /dev/null @@ -1,13 +0,0 @@ -import { LeftPanel } from "../components/chat/LeftPanel"; -import { RightPanel } from "../components/chat/RightPanel"; - -export default function ChatScreen() { - return ( -
-
- - -
-
- ); -} \ No newline at end of file diff --git a/frontend/src/pages/chat/ui/screen/DownloadAppScreen.tsx b/frontend/src/pages/chat/ui/screen/DownloadAppScreen.tsx deleted file mode 100644 index 8b4e5e5..0000000 --- a/frontend/src/pages/chat/ui/screen/DownloadAppScreen.tsx +++ /dev/null @@ -1,25 +0,0 @@ -export default function DownloadAppScreen() { - return ( -
-
-

Чтобы пользоваться мессенджером, скачайте приложение

-

- Этот сайт не предназначен для работы на маленьких экранах, поэтому - вам нужно скачать приложение мессенджера. -

- - - Скачать на GitHub - - -

- Если возникнут сложности или есть вопросы, нажмите кнопку! -

- - - Написать в поддержку - -
-
- ) -} \ No newline at end of file diff --git a/frontend/src/pages/chat/ui/screen/LoginScreen.tsx b/frontend/src/pages/chat/ui/screen/LoginScreen.tsx deleted file mode 100644 index 85adff9..0000000 --- a/frontend/src/pages/chat/ui/screen/LoginScreen.tsx +++ /dev/null @@ -1,142 +0,0 @@ -import { useImmer } from "use-immer"; -import { AlertsContainer, type Alert, type AlertType } from "../components/Alerts"; -import { AuthContainer, AuthHeader } from "../components/Auth"; -import type { ErrorResponse, LoginRequest, LoginResponse } from "../../core/types"; -import { ensureKeysOnLogin } from "../../../../api/authApi"; -import { API_BASE_URL } from "../../core/config"; -import { useRef } from "react"; -import type { TextField } from "mdui/components/text-field"; -import { useAppState } from "../state"; -import { useNavigate } from "react-router-dom"; -import { MaterialTextField } from "../components/core/TextField"; -import { initialize, isSupported, startElectronReceiver, subscribe } from "../../push-notifications"; -import { isElectron } from "../../electron/electron"; - -export default function LoginScreen() { - const [alerts, updateAlerts] = useImmer([]); - const setUser = useAppState(state => state.setUser); - const navigate = useNavigate(); - - function showAlert(type: AlertType, message: string) { - updateAlerts((alerts) => { alerts.push({type: type, message: message}) }); - } - - const usernameElement = useRef(null); - const passwordElement = useRef(null); - - return ( - - -
- - -
{ - e.preventDefault(); - - const username = usernameElement.current!.value.trim(); - const password = passwordElement.current!.value.trim(); - - if (!username || !password) { - showAlert("danger", "Пожалуйста, заполните все поля"); - return; - } - - try { - const request: LoginRequest = { - username: username, - password: password - } - - const response = await fetch(`${API_BASE_URL}/login`, { - method: 'POST', - headers: { - 'Content-Type': 'application/json', - }, - body: JSON.stringify(request) - }); - - if (response.ok) { - const data: LoginResponse = await response.json(); - // Store the JWT token first - setUser(data.token, data.user); - - // Setup keys with the token we just received - try { - await ensureKeysOnLogin(password, data.token); - } catch (e) { - console.error("Key setup failed:", e); - } - - navigate("/chat"); - - // Initialize notifications - try { - if (isSupported()) { - const initialized = await initialize(); - if (initialized) { - await subscribe(data.token); - - // For Electron, start the notification receiver - if (isElectron) { - await startElectronReceiver(); - } - - console.log("Notifications enabled"); - } else { - console.log("Notification permission denied"); - } - } else { - console.log("Notifications not supported"); - } - } catch (e) { - console.error("Notification setup failed:", e); - } - } else { - const data: ErrorResponse = await response.json(); - showAlert("danger", data.message || "Неверное имя пользователя или пароль"); - } - } catch (error) { - showAlert("danger", "Ошибка соединения с сервером"); - } - }}> - - - - - Войти - - - -
-
- ) -} \ No newline at end of file diff --git a/frontend/src/pages/chat/ui/screen/RegisterScreen.tsx b/frontend/src/pages/chat/ui/screen/RegisterScreen.tsx deleted file mode 100644 index 9fd2a6a..0000000 --- a/frontend/src/pages/chat/ui/screen/RegisterScreen.tsx +++ /dev/null @@ -1,148 +0,0 @@ -import { useImmer } from "use-immer"; -// import { showLogin } from "../../navigation"; -import { AuthContainer, AuthHeader } from "../components/Auth"; -import { AlertsContainer, type Alert, type AlertType } from "../components/Alerts"; -import { useRef } from "react"; -import { TextField } from "mdui/components/text-field"; -import type { ErrorResponse, RegisterRequest, LoginResponse } from "../../core/types"; -import { API_BASE_URL } from "../../core/config"; -import { useAppState } from "../state"; -import { useNavigate } from "react-router-dom"; -import { MaterialTextField } from "../components/core/TextField"; -import { ensureKeysOnLogin } from "../../../../api/authApi"; - -export default function RegisterScreen() { - const [alerts, updateAlerts] = useImmer([]); - const setUser = useAppState(state => state.setUser); - const navigate = useNavigate(); - - function showAlert(type: AlertType, message: string) { - updateAlerts((alerts) => { alerts.push({type: type, message: message}) }); - } - - const usernameElement = useRef(null); - const passwordElement = useRef(null); - const confirmPasswordElement = useRef(null); - - return ( - - -
- - -
{ - e.preventDefault(); - - const username = usernameElement.current!.value.trim(); - const password = passwordElement.current!.value.trim(); - const confirmPassword = confirmPasswordElement.current!.value.trim(); - - if (!username || !password || !confirmPassword) { - showAlert("danger", "Пожалуйста, заполните все поля"); - return; - } - - if (password !== confirmPassword) { - showAlert("danger", "Пароли не совпадают"); - return; - } - - if (username.length < 3 || username.length > 20) { - showAlert("danger", "Имя пользователя должно быть от 3 до 20 символов"); - return; - } - - if (password.length < 5 || password.length > 50) { - showAlert("danger", "Пароль должен быть от 5 до 50 символов"); - return; - } - - try { - const request: RegisterRequest = { - username: username, - password: password, - confirm_password: confirmPassword - } - - const response = await fetch(`${API_BASE_URL}/register`, { - method: 'POST', - headers: { - 'Content-Type': 'application/json', - }, - body: JSON.stringify(request) - }); - - if (response.ok) { - const data: LoginResponse = await response.json(); - // Store the JWT token first - setUser(data.token, data.user); - - // Setup keys with the token we just received - try { - await ensureKeysOnLogin(password, data.token); - } catch (e) { - console.error("Key setup failed:", e); - } - - navigate("/chat"); - } else { - const data: ErrorResponse = await response.json(); - showAlert("danger", data.message || "Ошибка при регистрации"); - } - } catch (error) { - showAlert("danger", "Ошибка соединения с сервером"); - } - }}> - - - - - Зарегистрироваться - - -
-

- Уже есть аккаунт? - navigate("/login")}> - Войдите - -

-
-
-
- ) -} \ No newline at end of file diff --git a/frontend/src/pages/chat/ui/state.ts b/frontend/src/pages/chat/ui/state.ts index 2b011af..ded50fe 100644 --- a/frontend/src/pages/chat/ui/state.ts +++ b/frontend/src/pages/chat/ui/state.ts @@ -1,14 +1,14 @@ import { create } from "zustand"; -import type { Message, User } from "../core/types"; -import { request } from "../core/websocket"; +import type { Message, User } from "../../../core/types"; +import { request } from "../../../core/websocket"; import { MessagePanel } from "./panels/MessagePanel"; import { PublicChatPanel } from "./panels/PublicChatPanel"; import { DMPanel, type DMPanelData } from "./panels/DMPanel"; -import { getAuthHeaders } from "../../../api/authApi"; -import { restoreKeys } from "../../../api/authApi"; -import { API_BASE_URL } from "../core/config"; -import { initialize, subscribe, startElectronReceiver, isSupported } from "../push-notifications"; -import { isElectron } from "../electron/electron"; +import { getAuthHeaders } from "../../../core/api/authApi"; +import { restoreKeys } from "../../../core/api/authApi"; +import { API_BASE_URL } from "../../../core/config"; +import { initialize, subscribe, startElectronReceiver, isSupported } from "../../../core/push-notifications/push-notifications"; +import { isElectron } from "../../../core/electron/electron"; export type ChatTabs = "chats" | "channels" | "contacts" | "dms" diff --git a/frontend/src/pages/home/HomePage.tsx b/frontend/src/pages/home/HomePage.tsx index 19578ba..f6311f2 100644 --- a/frontend/src/pages/home/HomePage.tsx +++ b/frontend/src/pages/home/HomePage.tsx @@ -1,6 +1,6 @@ import { Navigate, useNavigate } from "react-router-dom"; import { useAppState } from "../chat/ui/state"; -import { isElectron } from "../chat/electron/electron"; +import { isElectron } from "../../core/electron/electron"; import "./home.scss"; function GitHubLink({ children }: { children: React.ReactNode }) { diff --git a/frontend/src/pages/home/home.scss b/frontend/src/pages/home/home.scss index 1dcb789..9cd545a 100644 --- a/frontend/src/pages/home/home.scss +++ b/frontend/src/pages/home/home.scss @@ -1,4 +1,4 @@ -@use "../../css/common/material" as *; +@use "../../css/material" as *; .homepage { min-height: 100vh;