Skip to content

Commit 5d348d6

Browse files
kemurujaybuidl
authored andcommitted
feat(web): improve court policy display
1 parent 14dff15 commit 5d348d6

File tree

2 files changed

+15
-2
lines changed

2 files changed

+15
-2
lines changed

web/src/pages/Cases/CaseDetails/Overview.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ const Overview: React.FC<IOverview> = ({ arbitrable, courtID, currentPeriodIndex
138138
</StyledA>
139139
)}
140140
{courtPolicy && (
141-
<StyledA href={`${IPFS_GATEWAY}${courtPolicyURI?.court?.policy ?? ""}`} target="_blank" rel="noreferrer">
141+
<StyledA href={`#/courts/${court?.id}/purpose?section=description`} target="_blank" rel="noreferrer">
142142
<PolicyIcon />
143143
Court Policy
144144
</StyledA>

web/src/pages/Courts/CourtDetails/Description.tsx

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,21 @@ const Description: React.FC = () => {
6262

6363
const filteredTabs = TABS.filter(({ isVisible }) => isVisible(policy));
6464

65+
const location = useLocation();
66+
const queryParams = new URLSearchParams(location.search);
67+
const scrollToSection = queryParams.get("section");
68+
69+
useEffect(() => {
70+
if (scrollToSection === "description") {
71+
const element = document.getElementById(scrollToSection);
72+
if (element) {
73+
element.scrollIntoView({ behavior: "smooth" });
74+
}
75+
}
76+
}, [scrollToSection]);
77+
6578
return (
66-
<Container>
79+
<Container id="description">
6780
<StyledTabs
6881
currentValue={currentTab}
6982
items={filteredTabs}

0 commit comments

Comments
 (0)