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 11import React from "react" ;
22
3- import { useChainId } from "wagmi" ;
3+ import { useAccount } from "wagmi" ;
44
55import { DEFAULT_CHAIN } from "consts/chains" ;
66
@@ -12,7 +12,7 @@ interface IEnsureChain {
1212}
1313
1414export const EnsureChain : React . FC < IEnsureChain > = ( { children, className } ) => {
15- const chainId = useChainId ( ) ;
15+ const { chainId } = useAccount ( ) ;
1616
1717 return chainId === DEFAULT_CHAIN ? children : < ConnectWallet { ...{ className } } /> ;
1818} ;
Original file line number Diff line number Diff line change @@ -24,12 +24,6 @@ const FieldContainer = styled.div<FieldContainerProps>`
2424 flex-shrink: 0;
2525 }
2626
27- .link {
28- color: ${ ( { theme } ) => theme . primaryBlue } ;
29- :hover {
30- cursor: pointer;
31- }
32- }
3327 ${ ( { isList } ) =>
3428 isList &&
3529 css `
@@ -63,6 +57,12 @@ const FieldContainer = styled.div<FieldContainerProps>`
6357 ` } ;
6458` ;
6559
60+ const LinkContainer = styled . div `` ;
61+
62+ const StyledLink = styled ( Link ) `
63+ color: ${ ( { theme } ) => theme . primaryBlue } ;
64+ ` ;
65+
6666type FieldContainerProps = {
6767 width ?: string ;
6868 isList ?: boolean ;
@@ -98,15 +98,16 @@ const Field: React.FC<IField> = ({
9898 < Icon />
9999 { ( ! displayAsList || isOverview || isJurorBalance ) && < label > { name } :</ label > }
100100 { 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 >
110111 ) : (
111112 < label className = "value" > { value } </ label >
112113 ) }
Original file line number Diff line number Diff line change 11export function commify ( value : string | number ) : string {
22 const comps = String ( value ) . split ( "." ) ;
33
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" ;
126 }
137
148 // 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";
55export const encodeURIFilter = ( filter : Dispute_Filter ) : string => {
66 if ( Object . keys ( filter ) . length === 0 ) {
77 return "all" ;
8- } else {
9- return encodeURI ( JSON . stringify ( filter ) ) ;
108 }
9+ return encodeURIComponent ( JSON . stringify ( filter ) ) ;
1110} ;
1211
1312export const decodeURIFilter = ( filter : string ) : Dispute_Filter => {
1413 if ( filter === "all" ) {
1514 return { } ;
16- } else {
17- return JSON . parse ( decodeURI ( filter ) ) ;
1815 }
16+ return JSON . parse ( decodeURI ( filter ) ) ;
1917} ;
2018
2119export const useRootPath = ( ) => {
You can’t perform that action at this time.
0 commit comments