@@ -8,7 +8,6 @@ import { Card, Breadcrumb } from "@kleros/ui-components-library";
88
99import { isProductionDeployment } from "consts/index" ;
1010
11- import { useCourtPolicy } from "queries/useCourtPolicy" ;
1211import { useCourtTree , CourtTreeQuery } from "queries/useCourtTree" ;
1312
1413import { landscapeStyle } from "styles/landscapeStyle" ;
@@ -99,7 +98,6 @@ const StakePanelAndStats = styled.div`
9998
10099const CourtDetails : React . FC = ( ) => {
101100 const { id } = useParams ( ) ;
102- const { data : policy } = useCourtPolicy ( id ) ;
103101 const { data } = useCourtTree ( ) ;
104102 const [ isStakingMiniGuideOpen , toggleStakingMiniGuide ] = useToggle ( false ) ;
105103 const navigate = useNavigate ( ) ;
@@ -112,13 +110,16 @@ const CourtDetails: React.FC = () => {
112110 value : node . id ,
113111 } ) ) ?? [ ] ;
114112
113+ const currentCourt = courtPath ?. [ courtPath . length - 1 ] ;
114+ const courtName = currentCourt ?. name ;
115+
115116 return (
116117 < Container >
117118 < TopSearch />
118119 < StyledCard >
119120 < CourtHeader >
120121 < CourtInfo >
121- { policy ? policy . name : < StyledSkeleton width = { 200 } /> }
122+ { data ? courtName : < StyledSkeleton width = { 200 } /> }
122123 { breadcrumbItems . length > 1 ? (
123124 < StyledBreadcrumb
124125 items = { breadcrumbItems }
@@ -138,7 +139,7 @@ const CourtDetails: React.FC = () => {
138139 </ CourtHeader >
139140 < Divider />
140141 < StakePanelAndStats >
141- < StakePanel courtName = { policy ?. name } />
142+ < StakePanel { ... { courtName } } />
142143 < Stats />
143144 </ StakePanelAndStats >
144145 </ StyledCard >
0 commit comments