1
1
import { useMemo } from 'react'
2
- import { Typography } from '@mui/material'
2
+ import { SvgIcon , Typography } from '@mui/material'
3
3
import { ImplementationVersionState } from '@safe-global/safe-gateway-typescript-sdk'
4
4
import { LATEST_SAFE_VERSION } from '@/config/constants'
5
5
import { sameAddress } from '@/utils/addresses'
6
6
import type { MasterCopy } from '@/hooks/useMasterCopies'
7
7
import { MasterCopyDeployer , useMasterCopies } from '@/hooks/useMasterCopies'
8
8
import useSafeInfo from '@/hooks/useSafeInfo'
9
+ import CheckCircleIcon from '@mui/icons-material/CheckCircle'
10
+ import InfoIcon from '@/public/images/notifications/info.svg'
9
11
10
12
import UpdateSafeDialog from './UpdateSafeDialog'
11
13
import ExternalLink from '@/components/common/ExternalLink'
14
+ import Tooltip from '@mui/material/Tooltip'
12
15
13
16
export const ContractVersion = ( { isGranted } : { isGranted : boolean } ) => {
14
17
const [ masterCopies ] = useMasterCopies ( )
@@ -22,7 +25,6 @@ export const ContractVersion = ({ isGranted }: { isGranted: boolean }) => {
22
25
const needsUpdate = safe . implementationVersionState === ImplementationVersionState . OUTDATED
23
26
const latestMasterContractVersion = LATEST_SAFE_VERSION
24
27
const showUpdateDialog = safeMasterCopy ?. deployer === MasterCopyDeployer . GNOSIS && needsUpdate
25
-
26
28
const getSafeVersionUpdate = ( ) => {
27
29
return showUpdateDialog ? ` (there's a newer version: ${ latestMasterContractVersion } )` : ''
28
30
}
@@ -42,6 +44,35 @@ export const ContractVersion = ({ isGranted }: { isGranted: boolean }) => {
42
44
Unsupported contract
43
45
</ Typography >
44
46
) }
47
+ < div style = { { marginTop : 15 } } >
48
+ { needsUpdate ? (
49
+ < Typography display = "flex" alignItems = "center" >
50
+ Why should I upgrade?
51
+ < Tooltip
52
+ title = "Update now to take advantage of new features and the highest security standards available.
53
+ You will need to confirm this update just like any other transaction."
54
+ placement = "right-start"
55
+ >
56
+ < span >
57
+ < SvgIcon
58
+ component = { InfoIcon }
59
+ inheritViewBox
60
+ fontSize = "small"
61
+ color = "border"
62
+ sx = { {
63
+ verticalAlign : 'middle' ,
64
+ ml : 0.5 ,
65
+ } }
66
+ />
67
+ </ span >
68
+ </ Tooltip >
69
+ </ Typography >
70
+ ) : (
71
+ < Typography display = "flex" alignItems = "center" >
72
+ < CheckCircleIcon color = "primary" sx = { { mr : 0.5 } } /> Latest version
73
+ </ Typography >
74
+ ) }
75
+ </ div >
45
76
46
77
{ showUpdateDialog && isGranted && < UpdateSafeDialog /> }
47
78
</ div >
0 commit comments