Skip to content

Commit

Permalink
Merge pull request #1165 from oasisprotocol/lw/sourcify-delay
Browse files Browse the repository at this point in the history
If user clicks Sourcify show a note there's a delay after verifying
  • Loading branch information
lukaw3d authored Jan 24, 2024
2 parents a5f63e0 + 4d72380 commit dca2aa7
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
1 change: 1 addition & 0 deletions .changelog/1181.trivial.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
If user clicks Sourcify show a note there's a delay after verifying
8 changes: 6 additions & 2 deletions src/app/components/ContractVerificationIcon/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { FC, ReactNode } from 'react'
import { FC, ReactNode, useState } from 'react'
import { Trans, useTranslation } from 'react-i18next'
import Box from '@mui/material/Box'
import CheckCircleIcon from '@mui/icons-material/CheckCircle'
Expand Down Expand Up @@ -35,6 +35,7 @@ const StyledBox = styled(Box, {
const status: VerificationStatus = verified ? 'verified' : 'unverified'
return {
display: 'flex',
flexShrink: 0,
justifyContent: 'center',
height: verificationIconBoxHeight,
fontSize: '12px',
Expand Down Expand Up @@ -76,6 +77,7 @@ export const VerificationIcon: FC<{ address_eth: string; verified: boolean; noLi
noLink = false,
}) => {
const { t } = useTranslation()
const [explainDelay, setExplainDelay] = useState(false)

const status: VerificationStatus = verified ? 'verified' : 'unverified'
const statusLabel: Record<VerificationStatus, string> = {
Expand Down Expand Up @@ -105,10 +107,12 @@ export const VerificationIcon: FC<{ address_eth: string; verified: boolean; noLi
rel="noopener noreferrer"
target="_blank"
sx={{ fontWeight: 400, color: 'inherit', textDecoration: 'underline' }}
onClick={verified ? undefined : () => setExplainDelay(true)}
/>
),
}}
/>
/>{' '}
{explainDelay && t('contract.verification.explainVerificationDelay')}
</Typography>
)}
</>
Expand Down
3 changes: 2 additions & 1 deletion src/locales/en/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,8 @@
"isVerified": "Verified",
"isNotVerified": "Unverified",
"openInSourcify": "Open in <SourcifyLink>Sourcify</SourcifyLink>",
"verifyInSourcify": "Verify through <SourcifyLink>Sourcify</SourcifyLink>"
"verifyInSourcify": "Verify through <SourcifyLink>Sourcify</SourcifyLink>",
"explainVerificationDelay": "If you have just verified a contract, it should take a few minutes to update here."
}
},
"dapps": {
Expand Down

0 comments on commit dca2aa7

Please sign in to comment.