@@ -18,26 +18,21 @@ import LogBoxMessage from './LogBoxMessage';
1818import * as LogBoxStyle from './LogBoxStyle' ;
1919import * as React from 'react' ;
2020
21- type Props = Readonly < {
21+ const SHOW_MORE_MESSAGE_LENGTH = 300 ;
22+
23+ component LogBoxInspectorMessageHeader (
2224 collapsed : boolean ,
2325 message : Message ,
2426 level : LogLevel ,
2527 title : string ,
2628 onPress : ( ) = > void ,
27- } > ;
28-
29- const SHOW_MORE_MESSAGE_LENGTH = 300 ;
30-
31- function LogBoxInspectorMessageHeader ( props : Props ) : React . Node {
29+ ) {
3230 function renderShowMore ( ) {
33- if (
34- props . message . content . length < SHOW_MORE_MESSAGE_LENGTH ||
35- ! props . collapsed
36- ) {
31+ if ( message . content . length < SHOW_MORE_MESSAGE_LENGTH || ! collapsed ) {
3732 return null ;
3833 }
3934 return (
40- < Text style = { messageStyles . collapse } onPress = { ( ) => props . onPress ( ) } >
35+ < Text style = { messageStyles . collapse } onPress = { ( ) => onPress ( ) } >
4136 ... See More
4237 </ Text >
4338 ) ;
@@ -47,15 +42,15 @@ function LogBoxInspectorMessageHeader(props: Props): React.Node {
4742 < View style = { messageStyles . body } >
4843 < View style = { messageStyles . heading } >
4944 < Text
50- style = { [ messageStyles . headingText , messageStyles [ props . level ] ] }
45+ style = { [ messageStyles . headingText , messageStyles [ level ] ] }
5146 id = "logbox_message_title_text" >
52- { props . title }
47+ { title }
5348 </ Text >
5449 </ View >
5550 < Text style = { messageStyles . bodyText } id = "logbox_message_contents_text" >
5651 < LogBoxMessage
57- maxLength = { props . collapsed ? SHOW_MORE_MESSAGE_LENGTH : Infinity }
58- message = { props . message }
52+ maxLength = { collapsed ? SHOW_MORE_MESSAGE_LENGTH : Infinity }
53+ message = { message }
5954 style = { messageStyles . messageText }
6055 />
6156 { renderShowMore ( ) }
0 commit comments