3
3
* License: MS-RSL – see LICENSE.md for details
4
4
*/
5
5
6
- import { Button , Divider , Input , Select , Tooltip } from "antd" ;
6
+ import { Button , Divider , Input , Select , Space , Tooltip } from "antd" ;
7
7
import { debounce } from "lodash" ;
8
8
import { useDebounce } from "use-debounce" ;
9
9
import {
@@ -39,7 +39,14 @@ import { INPUT_HEIGHT, markChatAsReadIfUnseen } from "./utils";
39
39
import VideoChatButton from "./video/launch-button" ;
40
40
import Filter from "./filter" ;
41
41
42
- const FILTER_RECENT_NONE = { value : 0 , label : "All" } as const ;
42
+ const FILTER_RECENT_NONE = {
43
+ value : 0 ,
44
+ label : (
45
+ < >
46
+ < Icon name = "clock" /> All
47
+ </ >
48
+ ) ,
49
+ } as const ;
43
50
44
51
const PREVIEW_STYLE : React . CSSProperties = {
45
52
background : "#f5f5f5" ,
@@ -60,7 +67,6 @@ const GRID_STYLE: React.CSSProperties = {
60
67
} as const ;
61
68
62
69
const CHAT_LOG_STYLE : React . CSSProperties = {
63
- margin : "5px 0" ,
64
70
padding : "0" ,
65
71
background : "white" ,
66
72
flex : "1 0 auto" ,
@@ -340,8 +346,8 @@ export const ChatRoom: React.FC<Props> = ({ project_id, path, is_visible }) => {
340
346
< Tooltip
341
347
title = {
342
348
value === 0
343
- ? `All messages.`
344
- : `Only messages sent in the past ${ label } .`
349
+ ? undefined
350
+ : `Only threads with messages sent in the past ${ label } .`
345
351
}
346
352
>
347
353
{ label }
@@ -390,69 +396,56 @@ export const ChatRoom: React.FC<Props> = ({ project_id, path, is_visible }) => {
390
396
391
397
function render_button_row ( ) {
392
398
return (
393
- < Row style = { { marginLeft : 0 , marginRight : 0 } } >
394
- < Col xs = { 9 } md = { 9 } style = { { padding : "2px" } } >
395
- < ButtonGroup >
396
- { render_save_button ( ) }
397
- { render_timetravel_button ( ) }
398
- { render_compute_server_button ( ) }
399
- </ ButtonGroup >
400
- < ButtonGroup style = { { marginLeft : "5px" } } >
401
- { render_video_chat_button ( ) }
402
- { render_bottom_button ( ) }
403
- </ ButtonGroup >
404
- < ButtonGroup style = { { marginLeft : "5px" } } >
405
- { render_decrease_font_size ( ) }
406
- { render_increase_font_size ( ) }
407
- </ ButtonGroup >
408
- { render_export_button ( ) }
409
- { actions . syncdb != null && (
410
- < VisibleMDLG >
411
- < ButtonGroup style = { { marginLeft : "5px" } } >
412
- < Button onClick = { ( ) => actions . syncdb ?. undo ( ) } title = "Undo" >
413
- < Icon name = "undo" />
414
- </ Button >
415
- < Button onClick = { ( ) => actions . syncdb ?. redo ( ) } title = "Redo" >
416
- < Icon name = "redo" />
417
- </ Button >
418
- </ ButtonGroup >
419
- </ VisibleMDLG >
420
- ) }
421
- { actions . help != null && (
422
- < Button
423
- onClick = { ( ) => actions . help ( ) }
424
- style = { { marginLeft : "5px" } }
425
- title = "Documentation"
426
- >
427
- < Icon name = "question-circle" />
428
- </ Button >
429
- ) }
430
- </ Col >
431
- < Col
432
- xs = { 3 }
433
- md = { 3 }
399
+ < Space style = { { width : "100%" , marginTop : "3px" } } wrap >
400
+ < ButtonGroup >
401
+ { render_save_button ( ) }
402
+ { render_timetravel_button ( ) }
403
+ { render_compute_server_button ( ) }
404
+ </ ButtonGroup >
405
+ < ButtonGroup style = { { marginLeft : "5px" } } >
406
+ { render_video_chat_button ( ) }
407
+ { render_bottom_button ( ) }
408
+ </ ButtonGroup >
409
+ < ButtonGroup style = { { marginLeft : "5px" } } >
410
+ { render_decrease_font_size ( ) }
411
+ { render_increase_font_size ( ) }
412
+ </ ButtonGroup >
413
+ { render_export_button ( ) }
414
+ { actions . syncdb != null && (
415
+ < VisibleMDLG >
416
+ < ButtonGroup style = { { marginLeft : "5px" } } >
417
+ < Button onClick = { ( ) => actions . syncdb ?. undo ( ) } title = "Undo" >
418
+ < Icon name = "undo" />
419
+ </ Button >
420
+ < Button onClick = { ( ) => actions . syncdb ?. redo ( ) } title = "Redo" >
421
+ < Icon name = "redo" />
422
+ </ Button >
423
+ </ ButtonGroup >
424
+ </ VisibleMDLG >
425
+ ) }
426
+ { actions . help != null && (
427
+ < Button
428
+ onClick = { ( ) => actions . help ( ) }
429
+ style = { { marginLeft : "5px" } }
430
+ title = "Documentation"
431
+ >
432
+ < Icon name = "question-circle" />
433
+ </ Button >
434
+ ) }
435
+
436
+ < Filter
437
+ actions = { actions }
438
+ search = { search }
434
439
style = { {
435
- padding : "2px" ,
436
- display : "flex" ,
437
- verticalAlign : "center" ,
438
- gap : "5px" ,
440
+ margin : 0 ,
441
+ width : "100%" ,
442
+ ...( messages . size >= 2
443
+ ? undefined
444
+ : { visibility : "hidden" , height : 0 } ) ,
439
445
} }
440
- >
441
- { renderFilterRecent ( ) }
442
- < Filter
443
- actions = { actions }
444
- search = { search }
445
- style = { {
446
- margin : 0 ,
447
- width : "100%" ,
448
- marginBottom : "5px" ,
449
- ...( messages . size >= 2
450
- ? undefined
451
- : { visibility : "hidden" , height : 0 } ) ,
452
- } }
453
- />
454
- </ Col >
455
- </ Row >
446
+ />
447
+ { renderFilterRecent ( ) }
448
+ </ Space >
456
449
) ;
457
450
}
458
451
0 commit comments