File tree Expand file tree Collapse file tree 4 files changed +22
-29
lines changed Expand file tree Collapse file tree 4 files changed +22
-29
lines changed Original file line number Diff line number Diff line change 1
1
import React from "react" ;
2
2
3
- import { useChainId } from "wagmi" ;
3
+ import { useAccount } from "wagmi" ;
4
4
5
5
import { DEFAULT_CHAIN } from "consts/chains" ;
6
6
@@ -12,7 +12,7 @@ interface IEnsureChain {
12
12
}
13
13
14
14
export const EnsureChain : React . FC < IEnsureChain > = ( { children, className } ) => {
15
- const chainId = useChainId ( ) ;
15
+ const { chainId } = useAccount ( ) ;
16
16
17
17
return chainId === DEFAULT_CHAIN ? children : < ConnectWallet { ...{ className } } /> ;
18
18
} ;
Original file line number Diff line number Diff line change @@ -24,12 +24,6 @@ const FieldContainer = styled.div<FieldContainerProps>`
24
24
flex-shrink: 0;
25
25
}
26
26
27
- .link {
28
- color: ${ ( { theme } ) => theme . primaryBlue } ;
29
- :hover {
30
- cursor: pointer;
31
- }
32
- }
33
27
${ ( { isList } ) =>
34
28
isList &&
35
29
css `
@@ -63,6 +57,12 @@ const FieldContainer = styled.div<FieldContainerProps>`
63
57
` } ;
64
58
` ;
65
59
60
+ const LinkContainer = styled . div `` ;
61
+
62
+ const StyledLink = styled ( Link ) `
63
+ color: ${ ( { theme } ) => theme . primaryBlue } ;
64
+ ` ;
65
+
66
66
type FieldContainerProps = {
67
67
width ?: string ;
68
68
isList ?: boolean ;
@@ -98,15 +98,16 @@ const Field: React.FC<IField> = ({
98
98
< Icon />
99
99
{ ( ! displayAsList || isOverview || isJurorBalance ) && < label > { name } :</ label > }
100
100
{ link ? (
101
- < Link
102
- className = "link value"
103
- to = { link }
104
- onClick = { ( event ) => {
105
- event . stopPropagation ( ) ;
106
- } }
107
- >
108
- { value }
109
- </ Link >
101
+ < LinkContainer className = "value" >
102
+ < StyledLink
103
+ to = { link }
104
+ onClick = { ( event ) => {
105
+ event . stopPropagation ( ) ;
106
+ } }
107
+ >
108
+ { value }
109
+ </ StyledLink >
110
+ </ LinkContainer >
110
111
) : (
111
112
< label className = "value" > { value } </ label >
112
113
) }
Original file line number Diff line number Diff line change 1
1
export function commify ( value : string | number ) : string {
2
2
const comps = String ( value ) . split ( "." ) ;
3
3
4
- if (
5
- comps . length > 2 ||
6
- ! comps [ 0 ] . match ( / ^ - ? [ 0 - 9 ] * $ / ) ||
7
- ( comps [ 1 ] && ! comps [ 1 ] . match ( / ^ [ 0 - 9 ] * $ / ) ) ||
8
- value === "." ||
9
- value === "-."
10
- ) {
11
- return value . toString ( ) ;
4
+ if ( ! String ( value ) . match ( / ^ - ? [ 0 - 9 ] * \. ? [ 0 - 9 ] * $ / ) ) {
5
+ return "0" ;
12
6
}
13
7
14
8
// Make sure we have at least one whole digit (0 if none)
Original file line number Diff line number Diff line change @@ -5,17 +5,15 @@ import { Dispute_Filter } from "src/graphql/graphql";
5
5
export const encodeURIFilter = ( filter : Dispute_Filter ) : string => {
6
6
if ( Object . keys ( filter ) . length === 0 ) {
7
7
return "all" ;
8
- } else {
9
- return encodeURI ( JSON . stringify ( filter ) ) ;
10
8
}
9
+ return encodeURIComponent ( JSON . stringify ( filter ) ) ;
11
10
} ;
12
11
13
12
export const decodeURIFilter = ( filter : string ) : Dispute_Filter => {
14
13
if ( filter === "all" ) {
15
14
return { } ;
16
- } else {
17
- return JSON . parse ( decodeURI ( filter ) ) ;
18
15
}
16
+ return JSON . parse ( decodeURI ( filter ) ) ;
19
17
} ;
20
18
21
19
export const useRootPath = ( ) => {
You can’t perform that action at this time.
0 commit comments