File tree 4 files changed +30
-26
lines changed
4 files changed +30
-26
lines changed Original file line number Diff line number Diff line change 1
1
import React from "react" ;
2
2
import styled from "styled-components" ;
3
3
4
- import { useLocation , useNavigate } from "react-router-dom" ;
4
+ import { Link , useLocation } from "react-router-dom" ;
5
5
6
6
import ArrowIcon from "svgs/icons/arrow.svg" ;
7
7
@@ -53,14 +53,15 @@ const CasesDisplay: React.FC<ICasesDisplay> = ({
53
53
className,
54
54
totalPages,
55
55
} ) => {
56
- const navigate = useNavigate ( ) ;
57
56
const location = useLocation ( ) ;
58
57
return (
59
58
< div { ...{ className } } >
60
59
< TitleContainer className = "title" >
61
60
< StyledTitle > { title } </ StyledTitle >
62
61
{ location . pathname . startsWith ( "/cases/display/1/desc/all" ) ? (
63
- < StyledButton onClick = { ( ) => navigate ( `/resolver` ) } text = "Create a case" Icon = { ArrowIcon } />
62
+ < Link to = { "/resolver" } >
63
+ < StyledButton text = "Create a case" Icon = { ArrowIcon } />
64
+ </ Link >
64
65
) : null }
65
66
</ TitleContainer >
66
67
< Search />
Original file line number Diff line number Diff line change 1
1
import React from "react" ;
2
2
import styled from "styled-components" ;
3
3
4
- import { useNavigate } from "react-router-dom" ;
4
+ import { Link } from "react-router-dom" ;
5
5
6
6
import { Card } from "@kleros/ui-components-library" ;
7
7
@@ -54,15 +54,16 @@ interface IDisputeCardView {
54
54
}
55
55
56
56
const DisputeCardView : React . FC < IDisputeCardView > = ( { isLoading, ...props } ) => {
57
- const navigate = useNavigate ( ) ;
58
57
return (
59
- < StyledCard hover onClick = { ( ) => navigate ( `/cases/${ props ?. disputeID ?. toString ( ) } ` ) } >
60
- < PeriodBanner id = { parseInt ( props ?. disputeID ) } period = { props ?. period } />
61
- < CardContainer >
62
- { isLoading ? < StyledCaseCardTitleSkeleton /> : < TruncatedTitle text = { props ?. title } maxLength = { 100 } /> }
63
- < DisputeInfo { ...props } />
64
- </ CardContainer >
65
- </ StyledCard >
58
+ < Link to = { `/cases/${ props ?. disputeID ?. toString ( ) } ` } >
59
+ < StyledCard hover >
60
+ < PeriodBanner id = { parseInt ( props ?. disputeID ) } period = { props ?. period } />
61
+ < CardContainer >
62
+ { isLoading ? < StyledCaseCardTitleSkeleton /> : < TruncatedTitle text = { props ?. title } maxLength = { 100 } /> }
63
+ < DisputeInfo { ...props } />
64
+ </ CardContainer >
65
+ </ StyledCard >
66
+ </ Link >
66
67
) ;
67
68
} ;
68
69
Original file line number Diff line number Diff line change 1
1
import React from "react" ;
2
2
import styled from "styled-components" ;
3
3
4
- import { useNavigate } from "react-router-dom" ;
4
+ import { Link } from "react-router-dom" ;
5
5
import { useAccount } from "wagmi" ;
6
6
7
7
import { Card } from "@kleros/ui-components-library" ;
@@ -56,17 +56,18 @@ interface IDisputeListView {
56
56
}
57
57
const DisputeListView : React . FC < IDisputeListView > = ( props ) => {
58
58
const { isDisconnected } = useAccount ( ) ;
59
- const navigate = useNavigate ( ) ;
60
59
return (
61
- < StyledListItem hover onClick = { ( ) => navigate ( `/cases/${ props ?. disputeID ?. toString ( ) } ` ) } >
62
- < PeriodBanner isCard = { false } id = { parseInt ( props ?. disputeID ?? "0" ) } period = { props . period } />
63
- < ListContainer >
64
- < TitleContainer isLabel = { ! isDisconnected } >
65
- < TruncatedTitle text = { props ?. title } maxLength = { 50 } />
66
- </ TitleContainer >
67
- < DisputeInfo { ...props } />
68
- </ ListContainer >
69
- </ StyledListItem >
60
+ < Link to = { `/cases/${ props ?. disputeID ?. toString ( ) } ` } >
61
+ < StyledListItem hover >
62
+ < PeriodBanner isCard = { false } id = { parseInt ( props ?. disputeID ?? "0" ) } period = { props . period } />
63
+ < ListContainer >
64
+ < TitleContainer isLabel = { ! isDisconnected } >
65
+ < TruncatedTitle text = { props ?. title } maxLength = { 50 } />
66
+ </ TitleContainer >
67
+ < DisputeInfo { ...props } />
68
+ </ ListContainer >
69
+ </ StyledListItem >
70
+ </ Link >
70
71
) ;
71
72
} ;
72
73
Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ import styled from "styled-components";
3
3
4
4
import { responsiveSize } from "styles/responsiveSize" ;
5
5
6
- import { useNavigate } from "react-router-dom" ;
6
+ import { Link } from "react-router-dom" ;
7
7
8
8
import { Button } from "@kleros/ui-components-library" ;
9
9
@@ -22,11 +22,12 @@ const StyledH1 = styled.h1`
22
22
` ;
23
23
24
24
const Header : React . FC = ( ) => {
25
- const navigate = useNavigate ( ) ;
26
25
return (
27
26
< StyledHeader >
28
27
< StyledH1 > Court Overview</ StyledH1 >
29
- < Button small Icon = { Bookmark } text = "Create a Case" onClick = { ( ) => navigate ( "/resolver" ) } />
28
+ < Link to = { "/resolver" } >
29
+ < Button small Icon = { Bookmark } text = "Create a Case" />
30
+ </ Link >
30
31
</ StyledHeader >
31
32
) ;
32
33
} ;
You can’t perform that action at this time.
0 commit comments