From 25c2759baaf5a08200fb024b638d77d848fbb7b9 Mon Sep 17 00:00:00 2001 From: Pavel Prichodko <14926950+prichodko@users.noreply.github.com> Date: Wed, 13 Apr 2022 14:25:15 +0200 Subject: [PATCH] feat(react): use correct types in chat context --- packages/status-react/src/contexts/chat-context.tsx | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/packages/status-react/src/contexts/chat-context.tsx b/packages/status-react/src/contexts/chat-context.tsx index 99d057b7..932ee1a2 100644 --- a/packages/status-react/src/contexts/chat-context.tsx +++ b/packages/status-react/src/contexts/chat-context.tsx @@ -1,5 +1,6 @@ import React, { createContext, useContext, useMemo, useReducer } from 'react' +import type { Message } from '../protocol/use-messages' import type { Dispatch, Reducer } from 'react' type Context = { @@ -9,12 +10,6 @@ type Context = { const ChatContext = createContext(undefined) -// TODO: Take from generated protobuf -export interface Message { - type: 'text' | 'image' | 'image-text' - text?: string -} - interface State { message?: Message } @@ -51,7 +46,7 @@ export const ChatProvider = (props: Props) => { return {children} } -export const useChatState = () => { +export const useChatContext = () => { const context = useContext(ChatContext) if (!context) {