File tree Expand file tree Collapse file tree 2 files changed +7
-4
lines changed
app/src/app/pages/Sandbox/Editor/Workspace/Chat Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ const Messages = styled.div`
2222 flex: 1;
2323` ;
2424
25- export const Chat = ( ) => {
25+ export const Chat : React . FC = ( ) => {
2626 const [ value , setValue ] = useState ( '' ) ;
2727 const [ height , setHeight ] = useState ( '' ) ;
2828 const { state, actions } = useOvermind ( ) ;
@@ -34,7 +34,7 @@ export const Chat = () => {
3434 }
3535 useEffect ( scrollDown ) ;
3636
37- const handleKeyDown = e => {
37+ const handleKeyDown = ( e : KeyboardEvent ) => {
3838 if ( e . keyCode === ENTER && ! e . shiftKey ) {
3939 e . preventDefault ( ) ;
4040 e . stopPropagation ( ) ;
@@ -47,7 +47,7 @@ export const Chat = () => {
4747 }
4848 } ;
4949
50- const handleChange = e => {
50+ const handleChange = ( e : React . ChangeEvent < HTMLInputElement > ) => {
5151 setValue ( e . target . value ) ;
5252 } ;
5353
Original file line number Diff line number Diff line change @@ -193,6 +193,8 @@ export type LiveUser = {
193193 avatarUrl : string ;
194194} ;
195195
196+ export type ChatUserGetter = ( id : string ) => string ;
197+
196198export type RoomInfo = {
197199 startTime : number ;
198200 ownerIds : string [ ] ;
@@ -211,7 +213,8 @@ export type RoomInfo = {
211213 // We keep a separate map of user_id -> username for the case when
212214 // a user disconnects. We still need to keep track of the name.
213215 users : {
214- [ id : string ] : string ;
216+ [ id : string ] : string | ChatUserGetter ;
217+ get : ChatUserGetter ;
215218 } ;
216219 } ;
217220} ;
You can’t perform that action at this time.
0 commit comments