@@ -8,6 +8,8 @@ import * as React from 'react';
88import { computed } from 'mobx' ;
99import { observer } from 'mobx-react' ;
1010
11+ import { styled } from '../../../styles' ;
12+
1113import { UNKNOWN_SOURCE } from '../../../model/http/sources' ;
1214import { RTCConnection } from '../../../model/webrtc/rtc-connection' ;
1315import { getSummaryColor } from '../../../model/events/categorization' ;
@@ -37,6 +39,11 @@ interface RTCConnectionCardProps extends ExpandableCardProps {
3739 onCollapseToggled ?: ( ) => void ;
3840} ;
3941
42+ // Approx matches the spacing of collabsible sections:
43+ const ContentLabelPair = styled . div `
44+ padding: 3px 0 12px 0;
45+ ` ;
46+
4047@observer
4148export class RTCConnectionCard extends React . Component < RTCConnectionCardProps > {
4249
@@ -86,44 +93,38 @@ export class RTCConnectionCard extends React.Component<RTCConnectionCardProps> {
8693 </ CollapsibleCardHeading >
8794 </ header >
8895
89- < CollapsibleSection >
90- < CollapsibleSectionSummary >
91- < ContentLabel > Connection type: </ ContentLabel >
92- < ContentValue >
93- {
94- connection . remoteCandidate . type === 'host'
95- ? 'Direct'
96- : connection . remoteCandidate . type === 'relay'
97- ? 'TURN-relayed'
98- : connection . remoteCandidate . type === 'srflx'
99- ? 'STUN-directed'
100- : // === prflx
101- 'Peer-reflexive'
102- } {
103- connection . remoteCandidate . protocol . toUpperCase ( )
104- }
105- </ ContentValue >
106- </ CollapsibleSectionSummary >
107- </ CollapsibleSection >
108-
109- < CollapsibleSection >
110- < CollapsibleSectionSummary >
111- < ContentLabel > From: </ ContentLabel >
112- < ContentMonoValueInline > { connection . clientURL } </ ContentMonoValueInline >
113- </ CollapsibleSectionSummary >
114- </ CollapsibleSection >
115-
116- < CollapsibleSection >
117- < CollapsibleSectionSummary >
118- < ContentLabel > To: </ ContentLabel >
119- < ContentMonoValueInline > { connection . remoteURL } </ ContentMonoValueInline >
120- </ CollapsibleSectionSummary >
121- </ CollapsibleSection >
96+ < ContentLabelPair >
97+ < ContentLabel > Connection type: </ ContentLabel >
98+ < ContentValue >
99+ {
100+ connection . remoteCandidate . type === 'host'
101+ ? 'Direct'
102+ : connection . remoteCandidate . type === 'relay'
103+ ? 'TURN-relayed'
104+ : connection . remoteCandidate . type === 'srflx'
105+ ? 'STUN-directed'
106+ : // === prflx
107+ 'Peer-reflexive'
108+ } {
109+ connection . remoteCandidate . protocol . toUpperCase ( )
110+ }
111+ </ ContentValue >
112+ </ ContentLabelPair >
113+
114+ < ContentLabelPair >
115+ < ContentLabel > From: </ ContentLabel >
116+ < ContentMonoValueInline > { connection . clientURL } </ ContentMonoValueInline >
117+ </ ContentLabelPair >
118+
119+ < ContentLabelPair >
120+ < ContentLabel > To: </ ContentLabel >
121+ < ContentMonoValueInline > { connection . remoteURL } </ ContentMonoValueInline >
122+ </ ContentLabelPair >
122123
123124 { connection . sourceURL && < >
124125 < ContentLabelBlock > Source page: </ ContentLabelBlock >
125126
126- < CollapsibleSection prefixTrigger = { true } >
127+ < CollapsibleSection contentName = 'URL components' prefixTrigger = { true } >
127128 < CollapsibleSectionSummary >
128129 < ContentMonoValueInline >
129130 { connection . sourceURL . toString ( ) }
@@ -139,7 +140,7 @@ export class RTCConnectionCard extends React.Component<RTCConnectionCardProps> {
139140 { connection . source !== UNKNOWN_SOURCE && < >
140141 < ContentLabelBlock > Client: </ ContentLabelBlock >
141142
142- < CollapsibleSection prefixTrigger = { true } >
143+ < CollapsibleSection contentName = 'source details' prefixTrigger = { true } >
143144 < CollapsibleSectionSummary >
144145 < ContentMonoValueInline >
145146 { connection . source . ua }
0 commit comments