Skip to content

Commit

Permalink
fix list view
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremy-babylonlabs committed Sep 25, 2024
1 parent c9c52f3 commit 439eaf3
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
9 changes: 8 additions & 1 deletion src/app/components/Delegations/Delegation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@ import { FaBitcoin } from "react-icons/fa";
import { IoIosWarning } from "react-icons/io";
import { Tooltip } from "react-tooltip";

import { useHealthCheck } from "@/app/hooks/useHealthCheck";
import { DelegationState, StakingTx } from "@/app/types/delegations";
import { GlobalParamsVersion } from "@/app/types/globalParams";
import { shouldDisplayPoints } from "@/config";
import { getNetworkConfig } from "@/config/network.config";
import { satoshiToBtc } from "@/utils/btcConversions";
import { durationTillNow } from "@/utils/formatTime";
Expand Down Expand Up @@ -43,6 +45,9 @@ export const Delegation: React.FC<DelegationProps> = ({
}) => {
const { startTimestamp } = stakingTx;
const [currentTime, setCurrentTime] = useState(Date.now());
const { isApiNormal, isGeoBlocked } = useHealthCheck();
const shouldShowPoints =
isApiNormal && !isGeoBlocked && shouldDisplayPoints();

useEffect(() => {
const timerId = setInterval(() => {
Expand Down Expand Up @@ -124,7 +129,9 @@ export const Delegation: React.FC<DelegationProps> = ({
<p>overflow</p>
</div>
)}
<div className="grid grid-flow-col grid-cols-2 grid-rows-3 items-center gap-2 lg:grid-flow-row lg:grid-cols-6 lg:grid-rows-1">
<div
className={`grid grid-flow-col grid-cols-2 grid-rows-3 items-center gap-2 lg:grid-flow-row ${shouldShowPoints ? "lg:grid-cols-6" : "lg:grid-cols-5"} lg:grid-rows-1`}
>
<div className="flex gap-1 items-center order-1">
<FaBitcoin className="text-primary" />
<p>
Expand Down
4 changes: 3 additions & 1 deletion src/app/components/Delegations/Delegations.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,9 @@ const DelegationsContent: React.FC<DelegationsProps> = ({
</div>
) : (
<>
<div className="hidden grid-cols-6 gap-2 px-4 lg:grid">
<div
className={`hidden ${shouldShowPoints ? "grid-cols-6" : "grid-cols-5"} gap-2 px-4 lg:grid`}
>
<p>Amount</p>
<p>Inception</p>
<p className="text-center">Transaction hash</p>
Expand Down

0 comments on commit 439eaf3

Please sign in to comment.