File tree 1 file changed +10
-3
lines changed
static/app/components/search
1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change 1
1
import { Fragment } from 'react' ;
2
2
import styled from '@emotion/styled' ;
3
+ import * as Sentry from '@sentry/react' ;
3
4
4
5
import { DocIntegrationAvatar } from 'sentry/components/core/avatar/docIntegrationAvatar' ;
5
6
import { SentryAppAvatar } from 'sentry/components/core/avatar/sentryAppAvatar' ;
@@ -18,6 +19,8 @@ type Props = {
18
19
matches : Result [ 'matches' ] ;
19
20
} ;
20
21
22
+ const DEFAULT_AVATAR_SIZE = 24 ;
23
+
21
24
function renderResultType ( { resultType, model} : Result [ 'item' ] ) {
22
25
switch ( resultType ) {
23
26
case 'settings' :
@@ -27,12 +30,16 @@ function renderResultType({resultType, model}: Result['item']) {
27
30
case 'route' :
28
31
return < IconLink /> ;
29
32
case 'integration' :
30
- return < StyledPluginIcon pluginId = { model . slug } /> ;
33
+ return < StyledPluginIcon size = { DEFAULT_AVATAR_SIZE } pluginId = { model . slug } /> ;
31
34
case 'sentryApp' :
32
- return < SentryAppAvatar sentryApp = { model } /> ;
35
+ return < SentryAppAvatar size = { DEFAULT_AVATAR_SIZE } sentryApp = { model } /> ;
33
36
case 'docIntegration' :
34
- return < DocIntegrationAvatar docIntegration = { model } /> ;
37
+ return < DocIntegrationAvatar size = { DEFAULT_AVATAR_SIZE } docIntegration = { model } /> ;
35
38
default :
39
+ Sentry . captureMessage (
40
+ `Unknown result type: ${ resultType } . Nothing will be rendered.` ,
41
+ { level : 'warning' }
42
+ ) ;
36
43
return null ;
37
44
}
38
45
}
You can’t perform that action at this time.
0 commit comments