diff --git a/package-lock.json b/package-lock.json index b18608e..7e08187 100644 --- a/package-lock.json +++ b/package-lock.json @@ -8,10 +8,10 @@ "name": "sample-chat-app", "version": "0.0.0", "dependencies": { - "@likeminds.community/likeminds-chat-reactjs": "^1.7.1", + "@likeminds.community/likeminds-chat-reactjs": "^1.0.0", "react": "^18.3.1", "react-dom": "^18.3.1", - "react-router-dom": "^6.22.3" + "react-router-dom": "^6.0.0" }, "devDependencies": { "@eslint/js": "^9.33.0", @@ -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/package.json b/package.json index 84e3967..4b67e96 100644 --- a/package.json +++ b/package.json @@ -10,10 +10,10 @@ "preview": "vite preview" }, "dependencies": { - "@likeminds.community/likeminds-chat-reactjs": "^1.7.1", + "@likeminds.community/likeminds-chat-reactjs": "^1.0.0", "react": "^18.3.1", "react-dom": "^18.3.1", - "react-router-dom": "^6.22.3" + "react-router-dom": "^6.0.0" }, "devDependencies": { "@eslint/js": "^9.33.0", diff --git a/src/App.css b/src/App.css index b9d355d..e69de29 100644 --- a/src/App.css +++ b/src/App.css @@ -1,42 +0,0 @@ -#root { - max-width: 1280px; - margin: 0 auto; - padding: 2rem; - text-align: center; -} - -.logo { - height: 6em; - padding: 1.5em; - will-change: filter; - transition: filter 300ms; -} -.logo:hover { - filter: drop-shadow(0 0 2em #646cffaa); -} -.logo.react:hover { - filter: drop-shadow(0 0 2em #61dafbaa); -} - -@keyframes logo-spin { - from { - transform: rotate(0deg); - } - to { - transform: rotate(360deg); - } -} - -@media (prefers-reduced-motion: no-preference) { - a:nth-of-type(2) .logo { - animation: logo-spin infinite 20s linear; - } -} - -.card { - padding: 2em; -} - -.read-the-docs { - color: #888; -} diff --git a/src/App.tsx b/src/App.tsx index 3d7ded3..2bf8676 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 { Routes, Route } from 'react-router-dom'; function App() { - const [count, setCount] = useState(0) + const [userDetails] = useState<{ + apiKey?: string; + uuid?: string; + username?: string; + }>({ + apiKey: 'aca40392-f386-4c58-b9dd-7f59a50de207', + uuid: '81f15acc-e32b-42a7-9f6c-6f1a21260f03', + username: 'TestUser', + }); + + const lmChatClient = initiateLMClient(); return ( - <> -
- - Vite logo - - - React logo - -
-

Vite + React

-
- -

- Edit src/App.tsx and save to test HMR -

-
-

- Click on the Vite and React logos to learn more -

- - ) + + + + + } + /> + + ); } -export default App +export default App; diff --git a/src/index.css b/src/index.css index 08a3ac9..a50548c 100644 --- a/src/index.css +++ b/src/index.css @@ -1,68 +1,8 @@ -:root { - font-family: system-ui, Avenir, Helvetica, Arial, sans-serif; - line-height: 1.5; - font-weight: 400; - - color-scheme: light dark; - color: rgba(255, 255, 255, 0.87); - background-color: #242424; - - font-synthesis: none; - text-rendering: optimizeLegibility; - -webkit-font-smoothing: antialiased; - -moz-osx-font-smoothing: grayscale; -} - -a { - font-weight: 500; - color: #646cff; - text-decoration: inherit; -} -a:hover { - color: #535bf2; -} - -body { - margin: 0; - display: flex; - place-items: center; - min-width: 320px; - min-height: 100vh; -} - -h1 { - font-size: 3.2em; - line-height: 1.1; -} - -button { - border-radius: 8px; - border: 1px solid transparent; - padding: 0.6em 1.2em; - font-size: 1em; - font-weight: 500; - font-family: inherit; - background-color: #1a1a1a; - cursor: pointer; - transition: border-color 0.25s; -} -button:hover { - border-color: #646cff; -} -button:focus, -button:focus-visible { - outline: 4px auto -webkit-focus-ring-color; -} - -@media (prefers-color-scheme: light) { - :root { - color: #213547; - background-color: #ffffff; - } - a:hover { - color: #747bff; - } - button { - background-color: #f9f9f9; - } +html, body, #root { + height: 100% !important; + width: 100% !important; + margin: 0 !important; + padding: 0 !important; + overflow: hidden !important; /* Prevents scrollbars on html/body */ + box-sizing: border-box !important; /* Ensures consistent box model */ } diff --git a/src/main.tsx b/src/main.tsx index 69071d2..a69c2c2 100644 --- a/src/main.tsx +++ b/src/main.tsx @@ -1,8 +1,9 @@ import React from 'react'; import ReactDOM from 'react-dom/client'; +import { BrowserRouter } from 'react-router-dom'; import App from './App.tsx'; import './index.css'; -import { BrowserRouter } from 'react-router-dom'; +import './App.css'; ReactDOM.createRoot(document.getElementById('root')!).render(