Skip to content

Commit 317e53b

Browse files
committed
feat: add scroll top for when entering a case in mobile
1 parent e255ff2 commit 317e53b

File tree

1 file changed

+7
-1
lines changed
  • web/src/pages/Cases/CaseDetails/Overview

1 file changed

+7
-1
lines changed

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

+7-1
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1-
import React, { useMemo } from "react";
1+
import React, { useEffect, useMemo } from "react";
22
import styled from "styled-components";
33

44
import { useParams } from "react-router-dom";
55
import { formatEther } from "viem";
66

77
import { usePopulatedDisputeData } from "hooks/queries/usePopulatedDisputeData";
88
import { useVotingHistory } from "hooks/queries/useVotingHistory";
9+
import { useScrollTop } from "hooks/useScrollTop";
910
import { getLocalRounds } from "utils/getLocalRounds";
1011

1112
import { useCourtPolicy } from "queries/useCourtPolicy";
@@ -40,12 +41,17 @@ const Overview: React.FC<IOverview> = ({ arbitrable, courtID, currentPeriodIndex
4041
const { data: dispute } = useDisputeDetailsQuery(id);
4142
const { data: courtPolicy } = useCourtPolicy(courtID);
4243
const { data: votingHistory } = useVotingHistory(id);
44+
const scrollTop = useScrollTop();
4345
const localRounds = getLocalRounds(votingHistory?.dispute?.disputeKitDispute);
4446
const courtName = courtPolicy?.name;
4547
const court = dispute?.dispute?.court;
4648
const rewards = useMemo(() => (court ? `≥ ${formatEther(court.feeForJuror)} ETH` : undefined), [court]);
4749
const category = disputeDetails?.category;
4850

51+
useEffect(() => {
52+
scrollTop();
53+
}, [scrollTop]);
54+
4955
return (
5056
<>
5157
<Container>

0 commit comments

Comments
 (0)