@@ -83,6 +83,7 @@ type OwnProps = {
8383 readonly marker : Marker ;
8484 readonly threadsKey : ThreadsKey ;
8585 readonly className ?: string ;
86+ readonly showFilterButton ?: boolean ;
8687 // In tooltips it can be awkward for really long and tall things to force
8788 // the layout to be huge. This option when set to true will restrict the
8889 // height of things like stacks, and the width of long things like URLs.
@@ -519,8 +520,13 @@ class MarkerTooltipContents extends React.PureComponent<Props> {
519520 * a short list of rendering strategies, in the order they appear.
520521 */
521522 override render ( ) {
522- const { className, markerIndex, getMarkerLabel, getMarkerSearchTerm } =
523- this . props ;
523+ const {
524+ className,
525+ markerIndex,
526+ getMarkerLabel,
527+ getMarkerSearchTerm,
528+ showFilterButton = true ,
529+ } = this . props ;
524530 const markerLabel = getMarkerLabel ( markerIndex ) ;
525531 const searchTerm = getMarkerSearchTerm ( markerIndex ) ;
526532 return (
@@ -530,19 +536,21 @@ class MarkerTooltipContents extends React.PureComponent<Props> {
530536 { this . _maybeRenderMarkerDuration ( ) }
531537 < div className = "tooltipTitle" >
532538 < span className = "tooltipTitleText" > { markerLabel } </ span >
533- < Localized
534- id = "MarkerTooltip--filter-button-tooltip"
535- vars = { { filter : searchTerm } }
536- attrs = { { title : true , 'aria-label' : true } }
537- >
538- < button
539- className = "tooltipTitleFilterButton"
540- type = "button"
541- title = { `Only show markers matching: “${ searchTerm } ”` }
542- aria-label = { `Only show markers matching: “${ searchTerm } ”` }
543- onClick = { this . _onFilterButtonClick }
544- />
545- </ Localized >
539+ { showFilterButton ? (
540+ < Localized
541+ id = "MarkerTooltip--filter-button-tooltip"
542+ vars = { { filter : searchTerm } }
543+ attrs = { { title : true , 'aria-label' : true } }
544+ >
545+ < button
546+ className = "tooltipTitleFilterButton"
547+ type = "button"
548+ title = { `Only show markers matching: “${ searchTerm } ”` }
549+ aria-label = { `Only show markers matching: “${ searchTerm } ”` }
550+ onClick = { this . _onFilterButtonClick }
551+ />
552+ </ Localized >
553+ ) : null }
546554 </ div >
547555 </ div >
548556 </ div >
0 commit comments