♻️(frontend) remove deprecated chat options
Changes introduced by LiveKit which deprecated some chat's options. As we duplicated their code, let's just removed them. They are not useful, and not in use anywhere.
This commit is contained in:
committed by
aleb_the_flash
parent
2f3e64b389
commit
1a52221ef2
@@ -30,21 +30,11 @@ export interface ChatProps
|
||||
* ```
|
||||
* @public
|
||||
*/
|
||||
export function Chat({
|
||||
messageFormatter,
|
||||
messageDecoder,
|
||||
messageEncoder,
|
||||
channelTopic,
|
||||
...props
|
||||
}: ChatProps) {
|
||||
export function Chat({ messageFormatter, ...props }: ChatProps) {
|
||||
const inputRef = React.useRef<HTMLTextAreaElement>(null)
|
||||
const ulRef = React.useRef<HTMLUListElement>(null)
|
||||
|
||||
const chatOptions: ChatOptions = React.useMemo(() => {
|
||||
return { messageDecoder, messageEncoder, channelTopic }
|
||||
}, [messageDecoder, messageEncoder, channelTopic])
|
||||
|
||||
const { send, chatMessages, isSending } = useChat(chatOptions)
|
||||
const { send, chatMessages, isSending } = useChat()
|
||||
|
||||
const layoutContext = useMaybeLayoutContext()
|
||||
const lastReadMsgAt = React.useRef<ChatMessage['timestamp']>(0)
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
import type {
|
||||
MessageDecoder,
|
||||
MessageEncoder,
|
||||
TrackReferenceOrPlaceholder,
|
||||
WidgetState,
|
||||
} from '@livekit/components-core'
|
||||
@@ -55,8 +53,6 @@ const LayoutWrapper = styled(
|
||||
export interface VideoConferenceProps
|
||||
extends React.HTMLAttributes<HTMLDivElement> {
|
||||
chatMessageFormatter?: MessageFormatter
|
||||
chatMessageEncoder?: MessageEncoder
|
||||
chatMessageDecoder?: MessageDecoder
|
||||
/** @alpha */
|
||||
SettingsComponent?: React.ComponentType
|
||||
}
|
||||
@@ -81,8 +77,6 @@ export interface VideoConferenceProps
|
||||
*/
|
||||
export function VideoConference({
|
||||
chatMessageFormatter,
|
||||
chatMessageDecoder,
|
||||
chatMessageEncoder,
|
||||
...props
|
||||
}: VideoConferenceProps) {
|
||||
const [widgetState, setWidgetState] = React.useState<WidgetState>({
|
||||
@@ -220,8 +214,6 @@ export function VideoConference({
|
||||
<Chat
|
||||
style={{ display: widgetState.showChat ? 'grid' : 'none' }}
|
||||
messageFormatter={chatMessageFormatter}
|
||||
messageEncoder={chatMessageEncoder}
|
||||
messageDecoder={chatMessageDecoder}
|
||||
/>
|
||||
{sidePanel && <SidePanel />}
|
||||
</LayoutWrapper>
|
||||
|
||||
Reference in New Issue
Block a user