File tree Expand file tree Collapse file tree 2 files changed +27
-14
lines changed
src/webviews/apps/plus/graph Expand file tree Collapse file tree 2 files changed +27
-14
lines changed Original file line number Diff line number Diff line change @@ -99,19 +99,7 @@ import { GlGraphHover } from './hover/graphHover.react';
99
99
import type { GraphMinimapDaySelectedEventDetail } from './minimap/minimap' ;
100
100
import { GlGraphMinimapContainer } from './minimap/minimap-container.react' ;
101
101
import { GlGraphSideBar } from './sidebar/sidebar.react' ;
102
-
103
- function getRemoteIcon ( type : string | number ) {
104
- switch ( type ) {
105
- case 'head' :
106
- return 'vm' ;
107
- case 'remote' :
108
- return 'cloud' ;
109
- case 'tag' :
110
- return 'tag' ;
111
- default :
112
- return '' ;
113
- }
114
- }
102
+ import { RemoteIcon } from './utils/RemoteIcon' ;
115
103
116
104
export interface GraphWrapperProps {
117
105
nonce ?: string ;
@@ -1411,7 +1399,7 @@ export function GraphWrapper({
1411
1399
} }
1412
1400
className = "flex-gap"
1413
1401
>
1414
- < CodeIcon icon = { getRemoteIcon ( ref . type ) } > </ CodeIcon >
1402
+ < RemoteIcon ref = { ref } / >
1415
1403
< span > { ref . name } </ span >
1416
1404
</ MenuItem >
1417
1405
) : (
Original file line number Diff line number Diff line change
1
+ import type { GraphRefOptData } from '@gitkraken/gitkraken-components' ;
2
+ import React from 'react' ;
3
+ import { CodeIcon } from '../../../shared/components/code-icon.react' ;
4
+
5
+ // eslint-disable-next-line @typescript-eslint/naming-convention
6
+ export function RemoteIcon ( { ref } : Readonly < { ref : GraphRefOptData } > ) {
7
+ if ( ref . avatarUrl ) {
8
+ return < img alt = { ref . name } style = { { width : 14 , aspectRatio : 1 } } src = { ref . avatarUrl } /> ;
9
+ }
10
+ let icon = '' ;
11
+ switch ( ref . type ) {
12
+ case 'head' :
13
+ icon = 'vm' ;
14
+ break ;
15
+ case 'remote' :
16
+ icon = 'cloud' ;
17
+ break ;
18
+ case 'tag' :
19
+ icon = 'tag' ;
20
+ break ;
21
+ default :
22
+ break ;
23
+ }
24
+ return < CodeIcon size = { 14 } icon = { icon } /> ;
25
+ }
You can’t perform that action at this time.
0 commit comments