File tree Expand file tree Collapse file tree 6 files changed +36
-1
lines changed Expand file tree Collapse file tree 6 files changed +36
-1
lines changed Original file line number Diff line number Diff line change @@ -421,6 +421,7 @@ export enum GitProviderType {
421
421
BITBUCKET = 'bitbucket' ,
422
422
AZURE = 'azure' ,
423
423
GITEA = 'gitea' ,
424
+ GIT = 'git' ,
424
425
}
425
426
426
427
/**
Original file line number Diff line number Diff line change @@ -36,6 +36,7 @@ import {
36
36
SourceTypeMap ,
37
37
createGitCommitUrl ,
38
38
DropdownIndicator ,
39
+ GitProviderType ,
39
40
} from '../../../Common'
40
41
import { ReactComponent as ICArrowBackward } from '../../../Assets/Icon/ic-arrow-backward.svg'
41
42
import { ReactComponent as ICDocker } from '../../../Assets/Icon/ic-docker.svg'
@@ -46,6 +47,7 @@ import { statusColor as colorMap } from '../../constants'
46
47
import { DeploymentStatus } from '../StatusComponent'
47
48
import { Icon } from '../Icon'
48
49
import { getTriggerStatusIcon } from './utils'
50
+ import { GitProviderIcon } from '../GitProviderIcon'
49
51
50
52
const SummaryTooltipCard = React . memo (
51
53
( {
@@ -91,7 +93,7 @@ const SummaryTooltipCard = React.memo(
91
93
</ div >
92
94
) : (
93
95
< >
94
- < Icon name = "ic-git" size = { 24 } color = { null } />
96
+ < GitProviderIcon gitProvider = { GitProviderType . GIT } size = { 24 } />
95
97
< div className = "flex left column" >
96
98
< a
97
99
href = { createGitCommitUrl ( gitMaterialUrl , gitDetail . Commit ) }
Original file line number Diff line number Diff line change
1
+ import { GitProviderType } from '@Common/Constants'
2
+
3
+ import { Icon , IconName } from '../Icon'
4
+ import { GitProviderIconProps } from './types'
5
+
6
+ const gitProviderIconMap : Record < GitProviderType , IconName > = {
7
+ [ GitProviderType . GIT ] : 'ic-git' ,
8
+ [ GitProviderType . GITHUB ] : 'ic-github' ,
9
+ [ GitProviderType . GITLAB ] : 'ic-gitlab' ,
10
+ [ GitProviderType . BITBUCKET ] : 'ic-bitbucket' ,
11
+ [ GitProviderType . GITEA ] : 'ic-git' ,
12
+ [ GitProviderType . AZURE ] : 'ic-azure' ,
13
+ }
14
+
15
+ export const GitProviderIcon = ( { gitProvider, size = 20 } : GitProviderIconProps ) => (
16
+ < Icon name = { gitProviderIconMap [ gitProvider ] || 'ic-git' } size = { size } color = { null } />
17
+ )
Original file line number Diff line number Diff line change
1
+ export * from './GitProviderIcon'
2
+ export * from './types'
Original file line number Diff line number Diff line change
1
+ import { GitProviderType } from '@Common/Constants'
2
+
3
+ import { IconsProps } from '../Icon'
4
+
5
+ export interface GitProviderIconProps {
6
+ gitProvider : GitProviderType
7
+ /**
8
+ * The size of the icon in pixels.
9
+ * @default 20
10
+ */
11
+ size ?: IconsProps [ 'size' ]
12
+ }
Original file line number Diff line number Diff line change @@ -79,3 +79,4 @@ export * from './UnsavedChangesDialog'
79
79
export * from './Icon'
80
80
export * from './StatusComponent'
81
81
export * from './RegistryIcon'
82
+ export * from './GitProviderIcon'
You can’t perform that action at this time.
0 commit comments