Skip to content

Commit 2eb51e6

Browse files
LianaHusAniket-Engg
authored andcommitted
verification plugin ui update
1 parent f190093 commit 2eb51e6

File tree

3 files changed

+43
-14
lines changed

3 files changed

+43
-14
lines changed

apps/contract-verification/src/app/components/AccordionReceipt.tsx

Lines changed: 39 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,11 @@ export const AccordionReceipt: React.FC<AccordionReceiptProps> = ({ contract, in
3333
</button>
3434

3535
<div className="small w-100 text-uppercase overflow-hidden text-nowrap">
36-
<CustomTooltip placement="bottom" tooltipClasses=" text-break" tooltipText={`Contract: ${contract.contractName}, Address: ${contract.address}, Chain: ${chainName}, Proxy: ${contract.proxyAddress}`}>
36+
<CustomTooltip
37+
placement="bottom"
38+
tooltipClasses=" text-break"
39+
tooltipText={`Contract: ${contract.contractName}, Address: ${contract.address}, Chain: ${chainName}, Proxy: ${contract.proxyAddress}`}
40+
>
3741
<span>
3842
{contract.contractName} at {shortenAddress(contract.address)} {contract.proxyAddress ? 'with proxy' : ''}
3943
</span>
@@ -88,16 +92,40 @@ const ReceiptsBody = ({ receipts }: { receipts: VerificationReceipt[] }) => {
8892
return (
8993
<ul className="list-group">
9094
{receipts.map((receipt) => (
91-
<li key={`${receipt.contractId}-${receipt.verifierInfo.name}${receipt.isProxyReceipt ? '-proxy' : ''}-${receipt.receiptId}`} className="list-group-item d-flex flex-row align-items-center">
92-
<CustomTooltip placement="top" tooltipClasses=" text-break" tooltipText={`API: ${receipt.verifierInfo.apiUrl}`}>
93-
<span className="font-weight-bold medium">{receipt.verifierInfo.name}</span>
94-
</CustomTooltip>
95-
96-
<CustomTooltip placement="top" tooltipClasses=" text-break" tooltipTextClasses="text-capitalize" tooltipText={`Status: ${receipt.status}${receipt.message ? `, Message: ${receipt.message}` : ''}`}>
97-
<span className="ml-2">{['verified', 'partially verified', 'already verified'].includes(receipt.status) ? <i className="fas fa-check"></i> : receipt.status === 'fully verified' ? <i className="fas fa-check-double"></i> : receipt.status === 'failed' ? <i className="fas fa-xmark"></i> : ['pending', 'awaiting implementation verification'].includes(receipt.status) ? <i className="fas fa-spinner fa-spin"></i> : <i className="fas fa-question"></i>}</span>
98-
</CustomTooltip>
99-
100-
<div className="ml-2">{!!receipt.lookupUrl && receipt.verifierInfo.name === 'Blockscout' ? <CopyToClipboard tip="Copy code URL" content={receipt.lookupUrl} direction="top" /> : !!receipt.lookupUrl && <a href={receipt.lookupUrl} target="_blank" className="fa fas fa-arrow-up-right-from-square"></a>}</div>
95+
<li
96+
key={`${receipt.contractId}-${receipt.verifierInfo.name}${receipt.isProxyReceipt ? '-proxy' : ''}-${receipt.receiptId}`}
97+
className="list-group-item d-flex flex-row align-items-center"
98+
>
99+
<CustomTooltip
100+
placement="top"
101+
tooltipClasses=" text-break"
102+
tooltipTextClasses="text-capitalize"
103+
tooltipText={`Status: ${receipt.status}${receipt.message ? `, Message: ${receipt.message}` : ''}`}
104+
>
105+
<span className="mr-2">
106+
{['verified', 'partially verified', 'already verified'].includes(receipt.status) ?
107+
<i className="fas fa-check text-success px-1"></i> :
108+
receipt.status === 'fully verified' ?
109+
<i className="fas fa-check-double text-success px-1"></i> :
110+
receipt.status === 'failed' ?
111+
<i className="fas fa-xmark text-warning px-1"></i> :
112+
['pending', 'awaiting implementation verification'].includes(receipt.status) ?
113+
<i className="fas fa-spinner fa-spin"></i> :
114+
<i className="fas fa-question"></i>
115+
}
116+
</span>
117+
</CustomTooltip>
118+
<div className="d-flex flex-row w-100 justify-content-between">
119+
<CustomTooltip placement="top" tooltipClasses=" text-break" tooltipText={`API: ${receipt.verifierInfo.apiUrl}`}>
120+
<span className="font-weight-bold pr-2">{receipt.verifierInfo.name}</span>
121+
</CustomTooltip>
122+
<div className="ml-1">
123+
{!!receipt.lookupUrl && receipt.verifierInfo.name === 'Blockscout' ?
124+
<CopyToClipboard classList="pr-0 py-0" tip="Copy code URL" content={receipt.lookupUrl} direction="top" /> :
125+
!!receipt.lookupUrl && <a href={receipt.lookupUrl} target="_blank" className="fa fas fa-arrow-up-right-from-square"></a>
126+
}
127+
</div>
128+
</div>
101129
</li>
102130
))}
103131
</ul>

apps/contract-verification/src/app/views/VerifyView.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ export const VerifyView = () => {
232232
<label
233233
htmlFor={`verifier-${verifierId}`}
234234
className={`m-0 form-check-label custom-control-label large font-weight-bold${!disabledVerifier ? '' : ' text-secondary'}`}
235-
style={{ fontSize: '1rem', lineHeight: '1.5', color: 'var(--text)' }}
235+
style={{ fontSize: '1rem', color: 'var(--text)' }}
236236
>
237237
{verifierId}
238238
</label>

libs/remix-ui/clipboard/src/lib/copy-to-clipboard/copy-to-clipboard.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,10 @@ interface ICopyToClipboard {
1515
children?: JSX.Element
1616
getContent?: () => any
1717
callback?: () => void
18+
classList?: string
1819
}
1920
export const CopyToClipboard = (props: ICopyToClipboard) => {
20-
const { tip = 'Copy', icon = 'fa-copy', direction = 'right', getContent, children, callback, ...otherProps } = props
21+
const { tip = 'Copy', icon = 'fa-copy', classList = ' ml-1 p-2', direction = 'right', getContent, children, callback, ...otherProps } = props
2122
let { content } = props
2223
const [message, setMessage] = useState(tip)
2324

@@ -54,7 +55,7 @@ export const CopyToClipboard = (props: ICopyToClipboard) => {
5455
setTimeout(() => setMessage(tip), 500)
5556
}
5657

57-
const childJSX = children || <i className={`far ${icon} ml-1 p-2`} aria-hidden="true" {...otherProps}></i>
58+
const childJSX = children || <i className={`far ${icon} ${classList}`} aria-hidden="true" {...otherProps}></i>
5859

5960
return (
6061
<a href="#" onClick={handleClick} onMouseLeave={reset}>

0 commit comments

Comments
 (0)