1
1
import React , { useMemo } from "react" ;
2
2
import styled , { css } from "styled-components" ;
3
3
4
+ import { Link } from "react-router-dom" ;
5
+
4
6
import LawBalanceIcon from "svgs/icons/law-balance.svg" ;
5
7
8
+ import { useScrollTop } from "hooks/useScrollTop" ;
6
9
import { useCourtTree } from "hooks/queries/useCourtTree" ;
7
10
8
11
import { landscapeStyle } from "styles/landscapeStyle" ;
@@ -12,7 +15,7 @@ import { getCourtsPath } from "pages/Courts/CourtDetails";
12
15
13
16
import CardLabel from "../CardLabels" ;
14
17
15
- import { FieldItem , IDisputeInfo } from "." ;
18
+ import { FieldItem , IDisputeInfo } from "./index " ;
16
19
17
20
const Container = styled . div `
18
21
display : flex;
@@ -59,6 +62,19 @@ const StyledField = styled(Field)`
59
62
margin-left: 8px;
60
63
overflow: hidden;
61
64
text-overflow: ellipsis;
65
+ text-wrap: auto;
66
+ }
67
+ }
68
+ ` ;
69
+
70
+ const StyledLink = styled ( Link ) `
71
+ :hover {
72
+ label {
73
+ &.value {
74
+ cursor: pointer;
75
+ color: ${ ( { theme } ) => theme . primaryBlue } ;
76
+ text-decoration: underline;
77
+ }
62
78
}
63
79
}
64
80
` ;
@@ -74,6 +90,7 @@ const DisputeInfoCard: React.FC<IDisputeInfoCard> = ({
74
90
disputeID,
75
91
round,
76
92
} ) => {
93
+ const scrollTop = useScrollTop ( ) ;
77
94
const { data } = useCourtTree ( ) ;
78
95
const courtPath = getCourtsPath ( data ?. court , courtId ) ;
79
96
const items = useMemo (
@@ -86,7 +103,9 @@ const DisputeInfoCard: React.FC<IDisputeInfoCard> = ({
86
103
< Container >
87
104
{ court && courtId && isOverview && (
88
105
< CourtBranchFieldContainer >
89
- < StyledField icon = { LawBalanceIcon } name = "Court Branch" value = { courtBranchValue } { ...{ isOverview } } />
106
+ < StyledLink to = { `/courts/${ courtId } ` } onClick = { ( ) => scrollTop ( ) } >
107
+ < StyledField icon = { LawBalanceIcon } name = "Court Branch" value = { courtBranchValue } { ...{ isOverview } } />
108
+ </ StyledLink >
90
109
</ CourtBranchFieldContainer >
91
110
) }
92
111
< RestOfFieldsContainer { ...{ isOverview } } >
0 commit comments