File tree 2 files changed +6
-8
lines changed
components/DisputePreview
2 files changed +6
-8
lines changed Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ const AliasContainer = styled.div`
13
13
gap: 8px;
14
14
align-items: center;
15
15
` ;
16
+
16
17
const TextContainer = styled . div `
17
18
display: flex;
18
19
> label {
@@ -26,17 +27,14 @@ interface IAlias {
26
27
}
27
28
28
29
const AliasDisplay : React . FC < IAlias > = ( { alias } ) => {
29
- let address : string ;
30
-
31
30
const { data : addressFromENS , isLoading } = useEnsAddress ( {
32
- enabled : ! isAddress ( alias . address ) , //if alias.address is not an Address, we treat it as ENS and try to fetch address from there
31
+ enabled : ! isAddress ( alias . address ) , // if alias.address is not an Address, we treat it as ENS and try to fetch address from there
33
32
name : alias . address ,
34
33
chainId : 1 ,
35
34
} ) ;
36
35
37
- //try fetching ens name, else go with address
38
- if ( addressFromENS ) address = addressFromENS ;
39
- else address = alias . address ;
36
+ // try fetching ens name, else go with address
37
+ const address = addressFromENS ?? alias . address ;
40
38
41
39
return (
42
40
< AliasContainer >
Original file line number Diff line number Diff line change 1
1
import { toast , ToastPosition , Theme } from "react-toastify" ;
2
- import { TransactionReceipt } from "viem" ;
2
+ import { PublicClient , TransactionReceipt } from "viem" ;
3
3
4
4
export const OPTIONS = {
5
5
position : "top-center" as ToastPosition ,
@@ -19,7 +19,7 @@ type WrapWithToastReturnType = {
19
19
20
20
export async function wrapWithToast (
21
21
contractWrite : ( ) => Promise < `0x${string } `> ,
22
- publicClient : any
22
+ publicClient : PublicClient
23
23
) : Promise < WrapWithToastReturnType > {
24
24
toast . info ( "Transaction initiated" , OPTIONS ) ;
25
25
return await contractWrite ( )
You can’t perform that action at this time.
0 commit comments