diff --git a/CHANGELOG.md b/CHANGELOG.md index ee4f299..b336c7a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,4 @@ + ## v0.1.9 - Added `"use client"` banner to build outputs @@ -11,10 +12,22 @@ - Added `show` prop to `Popup`, that allows you to specify whether the popup should be shown or hidden. +## v0.1.7-beta.0 + +- Add `` component + +**Note:** This component is currently experimental. + ## v0.1.6 - Added `asGuest?: boolean` prop to `Chatbox`, `Inbox` and `Popup`. +## v0.1.6-beta.0 + +- Add `` component + +**Note:** This component is currently experimental. + ## v0.1.5 - Output ES2015. diff --git a/README.md b/README.md index 959d6fb..333d5e8 100644 --- a/README.md +++ b/README.md @@ -110,7 +110,7 @@ function ChatComponent() { export default ChatComponent; ``` -For more details and explanation, see our [getting started guide](/Getting_Started/Frameworks/React/). +For more details and explanation, see our [getting started guide](https://talkjs.com/docs/Getting_Started/Frameworks/React/). ## Contributing diff --git a/example/App.tsx b/example/App.tsx index 377577a..e8a366a 100644 --- a/example/App.tsx +++ b/example/App.tsx @@ -1,8 +1,15 @@ import "./App.css"; -import { Session, Chatbox, useUnreads } from "../lib/main"; +import { Session, Chatbox, HtmlPanel, useUnreads } from "../lib/main"; import Talk from "talkjs"; -import { ChangeEvent, useCallback, useMemo, useRef, useState, ReactElement } from "react"; +import { + ChangeEvent, + useCallback, + useMemo, + useRef, + useState, + ReactElement, +} from "react"; const convIds = ["talk-react-94872948u429843", "talk-react-194872948u429843"]; const users = [ @@ -53,11 +60,6 @@ function App() { setConvId(convIds[nextConv]); }, [convId]); - const createUser = useCallback(() => { - console.log("createUser"); - return new Talk.User(me); - }, [me]); - const createConv = useCallback( (session: Talk.Session) => { console.log("createConv"); @@ -104,6 +106,11 @@ function App() { setDn(JSON.parse(event.target!.value)); }, []); + const [panelHeight, setPanelHeight] = useState(100); + const [panelVisible, setPanelVisible] = useState(true); + + const [renderPanel, setPanel] = useState(false); + if (typeof import.meta.env.VITE_APP_ID !== "string") { return (
@@ -129,7 +136,7 @@ function App() { <> new Talk.User(me)} onBrowserPermissionNeeded={onPerm} onUnreadsChange={onUnreads} sessionRef={sessionRef} @@ -150,9 +157,34 @@ function App() { loadingComponent={LOADING....} {...(blur ? { onBlur } : {})} style={{ width: 500, height: 600 }} - /> + > + {renderPanel && ( + + I am an HTML panel. + + + + )} + + +