11import React , { useMemo } from "react" ;
22import styled , { css } from "styled-components" ;
33
4+ import { Link } from "react-router-dom" ;
5+
46import LawBalanceIcon from "svgs/icons/law-balance.svg" ;
57
8+ import { useScrollTop } from "hooks/useScrollTop" ;
69import { useCourtTree } from "hooks/queries/useCourtTree" ;
710
811import { landscapeStyle } from "styles/landscapeStyle" ;
@@ -12,7 +15,7 @@ import { getCourtsPath } from "pages/Courts/CourtDetails";
1215
1316import CardLabel from "../CardLabels" ;
1417
15- import { FieldItem , IDisputeInfo } from "." ;
18+ import { FieldItem , IDisputeInfo } from "./index " ;
1619
1720const Container = styled . div `
1821 display : flex;
@@ -59,6 +62,19 @@ const StyledField = styled(Field)`
5962 margin-left: 8px;
6063 overflow: hidden;
6164 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+ }
6278 }
6379 }
6480` ;
@@ -74,6 +90,7 @@ const DisputeInfoCard: React.FC<IDisputeInfoCard> = ({
7490 disputeID,
7591 round,
7692} ) => {
93+ const scrollTop = useScrollTop ( ) ;
7794 const { data } = useCourtTree ( ) ;
7895 const courtPath = getCourtsPath ( data ?. court , courtId ) ;
7996 const items = useMemo (
@@ -86,7 +103,9 @@ const DisputeInfoCard: React.FC<IDisputeInfoCard> = ({
86103 < Container >
87104 { court && courtId && isOverview && (
88105 < 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 >
90109 </ CourtBranchFieldContainer >
91110 ) }
92111 < RestOfFieldsContainer { ...{ isOverview } } >
0 commit comments