diff --git a/package-lock.json b/package-lock.json index b18608e..c7c2a33 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4190,18 +4190,6 @@ } } }, - "node_modules/@likeminds.community/likeminds-chat-reactjs/node_modules/@types/react": { - "version": "18.3.23", - "resolved": "https://registry.npmjs.org/@types/react/-/react-18.3.23.tgz", - "integrity": "sha512-/LDXMQh55EzZQ0uVAZmKKhfENivEvWz6E+EYzh+/MCjMhNsotd+ZHhBGIjFDTi6+fz0OhQQQLbTgdQIxxCsC0w==", - "license": "MIT", - "optional": true, - "peer": true, - "dependencies": { - "@types/prop-types": "*", - "csstype": "^3.0.2" - } - }, "node_modules/@likeminds.community/likeminds-chat-reactjs/node_modules/react-is": { "version": "18.3.1", "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.3.1.tgz", @@ -7400,13 +7388,6 @@ "dev": true, "license": "ISC" }, - "node_modules/jquery": { - "version": "3.7.1", - "resolved": "https://registry.npmjs.org/jquery/-/jquery-3.7.1.tgz", - "integrity": "sha512-m4avr8yL8kmFN8psrbFFFmB/If14iN5o9nw/NgnnM+kybDJpRsAynV2BsfpTYrTRysYUdADVD7CkUUizgkpLfg==", - "license": "MIT", - "peer": true - }, "node_modules/js-cookie": { "version": "2.2.1", "resolved": "https://registry.npmjs.org/js-cookie/-/js-cookie-2.2.1.tgz", @@ -9291,21 +9272,6 @@ "dev": true, "license": "ISC" }, - "node_modules/yaml": { - "version": "2.8.1", - "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.8.1.tgz", - "integrity": "sha512-lcYcMxX2PO9XMGvAJkJ3OsNMw+/7FKes7/hgerGUYWIoWu5j/+YQqcZr5JnPZWzOsEBgMbSbiSTn/dv/69Mkpw==", - "dev": true, - "license": "ISC", - "optional": true, - "peer": true, - "bin": { - "yaml": "bin.mjs" - }, - "engines": { - "node": ">= 14.6" - } - }, "node_modules/yargs": { "version": "17.7.2", "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz", diff --git a/src/App.css b/src/App.css index b9d355d..0f1c954 100644 --- a/src/App.css +++ b/src/App.css @@ -1,42 +1,110 @@ -#root { - max-width: 1280px; - margin: 0 auto; - padding: 2rem; - text-align: center; +/* Main container for the chat application */ +.lm-chat-container { + width: 100vw !important; + height: 100vh !important; + display: flex !important; + justify-content: center !important; + align-items: center !important; + background-color: #f0f2f5 !important; /* Light grey background for the overall app */ } -.logo { - height: 6em; - padding: 1.5em; - will-change: filter; - transition: filter 300ms; +/* Custom styling for various header components to ensure consistency */ + +/* Main chatroom header */ +.lm-channel-header { + background-color: #4a90e2 !important; /* Example blue background */ + color: #ffffff !important; + box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1) !important; +} + +/* Adjust text color for elements within the main chatroom header */ +.lm-channel-header .lm-channel-title { + color: #ffffff !important; } -.logo:hover { - filter: drop-shadow(0 0 2em #646cffaa); + +.lm-channel-header .lm-channel-desc { + color: #e0e0e0 !important; } -.logo.react:hover { - filter: drop-shadow(0 0 2em #61dafbaa); + +.lm-channel-header .lm-channel-icon { + color: #ffffff !important; +} + +/* Search conversation header (appears when search is active in a chatroom) */ +.lm-conversation-search { + background-color: #4a90e2 !important; /* Match main header background */ + color: #ffffff !important; + box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1) !important; +} + +/* Adjust text color for elements within the search conversation header */ +.lm-conversation-search .lm-conversation-search-input-field { + color: #ffffff !important; + background-color: rgba(255, 255, 255, 0.2) !important; + border: 1px solid rgba(255, 255, 255, 0.3) !important; +} + +.lm-conversation-search .lm-conversation-search-input-field::placeholder { + color: #e0e0e0 !important; +} + +.lm-conversation-search .lm-conversation-search-go-back-icon { + color: #ffffff !important; +} + +/* Channel list header (left panel header) */ +.lm-channel-list-header { + background-color: #3a7bd5 !important; /* Slightly darker blue for channel list header */ + color: #ffffff !important; + box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1) !important; +} + +/* Adjust text color for elements within the channel list header */ +.lm-channel-list-header .title { + color: #ffffff !important; +} + +.lm-channel-list-header .icon { + color: #ffffff !important; +} + +/* Chatroom search header (appears when searching in the channel list) */ +.lm-chatroom-search { + background-color: #3a7bd5 !important; /* Match channel list header background */ + color: #ffffff !important; + box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1) !important; +} + +/* Adjust text color for elements within the chatroom search header */ +.lm-chatroom-search .lm-chatroom-search-input-field { + color: #ffffff !important; + background-color: rgba(255, 255, 255, 0.2) !important; + border: 1px solid rgba(255, 255, 255, 0.3) !important; +} + +.lm-chatroom-search .lm-chatroom-search-input-field::placeholder { + color: #e0e0e0 !important; } -@keyframes logo-spin { - from { - transform: rotate(0deg); - } - to { - transform: rotate(360deg); - } +.lm-chatroom-search .lm-chatroom-search-go-back-icon { + color: #ffffff !important; } -@media (prefers-reduced-motion: no-preference) { - a:nth-of-type(2) .logo { - animation: logo-spin infinite 20s linear; - } +/* General chat box styling */ +.lm-chat-box { + background-color: #ffffff !important; + border-radius: 8px !important; + overflow: hidden !important; + box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1) !important; } -.card { - padding: 2em; +/* Ensure the main channel block takes full height and width */ +.lm-channel-block { + width: 100% !important; + height: 100% !important; } -.read-the-docs { - color: #888; +/* Adjust the right panel to take available width */ +.lm-right-panel { + flex: 1 !important; } diff --git a/src/App.tsx b/src/App.tsx index 3d7ded3..e7e3e86 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -1,35 +1,41 @@ -import { useState } from 'react' -import reactLogo from './assets/react.svg' -import viteLogo from '/vite.svg' -import './App.css' +import { useState } from "react"; +import { + LMClientOverlayProvider, + LMChannel, + initiateLMClient, + LMChatTheme, +} from "@likeminds.community/likeminds-chat-reactjs"; +import "./App.css"; // Ensure this import is present for custom styles -function App() { - const [count, setCount] = useState(0) +// Initialize the LikeMinds Chat Client outside the component to avoid re-initialization +const lmChatClient = initiateLMClient(); + +function ChatApp() { + // Replace with your actual API Key, UUID, and Username + // For production, consider fetching these securely from your backend + const [userDetails] = useState<{ + apiKey?: string; + uuid?: string; + username?: string; + }>( + { + apiKey: "aca40392-f386-4c58-b9dd-7f59a50de207", // <<< IMPORTANT: Replace with your actual API Key + uuid: "16d8bc72-6b1a-4773-9832-3237e1ca5597", // <<< IMPORTANT: Replace with your actual User UUID + username: "TestUser", // <<< IMPORTANT: Replace with your actual Username + } + ); return ( - <> -
-
- Edit src/App.tsx and save to test HMR
-
- Click on the Vite and React logos to learn more -
- > - ) +