Skip to content

Commit fcc7b26

Browse files
abheektripathyAaron Cook
and
Aaron Cook
authored
fix: Safe version/upgrade button improvements (safe-global#1627)
* fixes-1530 * reviewed-changes * Update src/components/settings/ContractVersion/index.tsx Co-authored-by: Aaron Cook <[email protected]> * Update src/components/settings/ContractVersion/index.tsx Co-authored-by: Aaron Cook <[email protected]> * Update src/components/settings/ContractVersion/index.tsx Co-authored-by: Aaron Cook <[email protected]> * fixing style to sx * fix: change icon + tooltip location --------- Co-authored-by: Aaron Cook <[email protected]>
1 parent 4974671 commit fcc7b26

File tree

1 file changed

+33
-2
lines changed
  • src/components/settings/ContractVersion

1 file changed

+33
-2
lines changed

src/components/settings/ContractVersion/index.tsx

Lines changed: 33 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,17 @@
11
import { useMemo } from 'react'
2-
import { Typography } from '@mui/material'
2+
import { SvgIcon, Typography } from '@mui/material'
33
import { ImplementationVersionState } from '@safe-global/safe-gateway-typescript-sdk'
44
import { LATEST_SAFE_VERSION } from '@/config/constants'
55
import { sameAddress } from '@/utils/addresses'
66
import type { MasterCopy } from '@/hooks/useMasterCopies'
77
import { MasterCopyDeployer, useMasterCopies } from '@/hooks/useMasterCopies'
88
import useSafeInfo from '@/hooks/useSafeInfo'
9+
import CheckCircleIcon from '@mui/icons-material/CheckCircle'
10+
import InfoIcon from '@/public/images/notifications/info.svg'
911

1012
import UpdateSafeDialog from './UpdateSafeDialog'
1113
import ExternalLink from '@/components/common/ExternalLink'
14+
import Tooltip from '@mui/material/Tooltip'
1215

1316
export const ContractVersion = ({ isGranted }: { isGranted: boolean }) => {
1417
const [masterCopies] = useMasterCopies()
@@ -22,7 +25,6 @@ export const ContractVersion = ({ isGranted }: { isGranted: boolean }) => {
2225
const needsUpdate = safe.implementationVersionState === ImplementationVersionState.OUTDATED
2326
const latestMasterContractVersion = LATEST_SAFE_VERSION
2427
const showUpdateDialog = safeMasterCopy?.deployer === MasterCopyDeployer.GNOSIS && needsUpdate
25-
2628
const getSafeVersionUpdate = () => {
2729
return showUpdateDialog ? ` (there's a newer version: ${latestMasterContractVersion})` : ''
2830
}
@@ -42,6 +44,35 @@ export const ContractVersion = ({ isGranted }: { isGranted: boolean }) => {
4244
Unsupported contract
4345
</Typography>
4446
)}
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>
4576

4677
{showUpdateDialog && isGranted && <UpdateSafeDialog />}
4778
</div>

0 commit comments

Comments
 (0)