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';
9999import type { GraphMinimapDaySelectedEventDetail } from './minimap/minimap' ;
100100import { GlGraphMinimapContainer } from './minimap/minimap-container.react' ;
101101import { 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' ;
115103
116104export interface GraphWrapperProps {
117105 nonce ?: string ;
@@ -1411,7 +1399,7 @@ export function GraphWrapper({
14111399 } }
14121400 className = "flex-gap"
14131401 >
1414- < CodeIcon icon = { getRemoteIcon ( ref . type ) } > </ CodeIcon >
1402+ < RemoteIcon ref = { ref } / >
14151403 < span > { ref . name } </ span >
14161404 </ MenuItem >
14171405 ) : (
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