17
17
import Tippy from '@tippyjs/react'
18
18
import { useEffect } from 'react'
19
19
import { useLocation } from 'react-router-dom'
20
- import { ClipboardButton , GenericEmptyState , extractImage , useKeyDown , useSuperAdmin } from '../../../Common'
20
+ import { ClipboardButton , GenericEmptyState , Tooltip , extractImage , useKeyDown , useSuperAdmin } from '../../../Common'
21
21
import { EMPTY_STATE_STATUS } from '../../constants'
22
22
import { ReactComponent as DropDownIcon } from '../../../Assets/Icon/ic-chevron-down.svg'
23
23
import { GitChangesType , LogResizeButtonType , ScrollerType } from './types'
@@ -28,7 +28,7 @@ import { ReactComponent as ZoomOut } from '../../../Assets/Icon/ic-exit-fullscre
28
28
import './cicdHistory.scss'
29
29
30
30
export const LogResizeButton = ( {
31
- shortcutCombo = 'f' ,
31
+ shortcutCombo = [ 'F' ] ,
32
32
onlyOnLogs = true ,
33
33
disableKeybindings = false ,
34
34
fullScreenView,
@@ -57,22 +57,31 @@ export const LogResizeButton = ({
57
57
}
58
58
} , [ keys ] )
59
59
60
+ const renderFullscreenTooltipContent = ( ) => (
61
+ < div className = "flexbox dc__gap-8 px-8 py-4" >
62
+ < span className = "lh-18 fs-12 fw-4 cn-0" > { fullScreenView ? 'Exit fullscreen' : 'Enter fullscreen' } </ span >
63
+ < div className = "flexbox dc__gap-4" >
64
+ { shortcutCombo . map ( ( key ) => (
65
+ < span key = { key } className = "shortcut-keys__chip dc__capitalize lh-16 fs-11 fw-5 flex" >
66
+ { key }
67
+ </ span >
68
+ ) ) }
69
+ </ div >
70
+ </ div >
71
+ )
72
+
60
73
return (
61
74
( pathname . includes ( '/logs' ) || ! onlyOnLogs ) && (
62
- < Tippy
63
- placement = "top "
64
- arrow = { false }
65
- className = "default-tt"
66
- content = { fullScreenView ? `Exit fullscreen ( ${ shortcutCombo } )` : `Enter fullscreen ( ${ shortcutCombo } )` }
75
+ < Tooltip
76
+ placement = "left "
77
+ className = "shortcut-keys__tippy"
78
+ content = { renderFullscreenTooltipContent ( ) }
79
+ alwaysShowTippyOnHover
67
80
>
68
- < div >
69
- { fullScreenView ? (
70
- < ZoomOut className = "zoom zoom--out pointer dc__zi-4" onClick = { toggleFullScreen } />
71
- ) : (
72
- < ZoomIn className = "zoom zoom--in pointer dc__zi-4" onClick = { toggleFullScreen } />
73
- ) }
81
+ < div className = { `zoom ${ fullScreenView ? 'zoom--out' : 'zoom--in' } pointer dc__zi-4 flex` } >
82
+ { fullScreenView ? < ZoomOut onClick = { toggleFullScreen } /> : < ZoomIn onClick = { toggleFullScreen } /> }
74
83
</ div >
75
- </ Tippy >
84
+ </ Tooltip >
76
85
)
77
86
)
78
87
}
0 commit comments