Skip to content

Commit

Permalink
resolve comments
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremy-babylonlabs committed Sep 11, 2024
1 parent 6e32ae1 commit 272fe3d
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/app/api/getDelegationPoints.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ export const getDelegationPointsByStakingTxHashHexes = async (

const response = await apiWrapper(
"GET",
"/v1/points/staking-tx/delegations",
"/v1/points/delegations",
"Error getting delegation points by staking transaction hashes",
currentParams,
);
Expand Down
4 changes: 1 addition & 3 deletions src/app/components/FAQ/data/questions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,7 @@ export const questions = (
},
{
title: "What are the points?",
content: `<p>You agree not to engage in any manipulative, fraudulent, dishonest, or abusive activities in connection with points or any distribution of digital assets by us or our affiliates. This includes, but is not limited to, creating multiple accounts to claim additional points or digital assets, using bots or scripts to automate claiming, or participating in any schemes that artificially inflate the number or perceived value of points or digital assets. We or our affiliates may terminate any or all of your points due to such activities, or for breaching any license granted by us, and may disclose privately and publicly why such action was taken.</p>
<br />
<p>You agree not to engage in any manipulative, fraudulent, dishonest, or abusive activities in connection with points or any distribution of digital assets by us or our affiliates. This includes, but is not limited to, creating multiple accounts to claim additional points or digital assets, using bots or scripts to automate claiming, or participating in any schemes that artificially inflate the number or perceived value of points or digital assets. We or our affiliates may terminate any or all of your points due to such activities, or for breaching any license granted by us, and may disclose privately and publicly why such action was taken.</p>`,
content: `<p>We use points to track staking activity. Points are not blockchain tokens. Points do not, and may never, convert to, accrue to, be used as a basis to calculate, or become tokens, other digital assets, or distributions thereof. Points are virtual calculations with no monetary value. Points do not constitute any currency or property of any type and are not redeemable, refundable, or transferable.</p>`,
},
];
if (shouldDisplayTestingMsg()) {
Expand Down
10 changes: 8 additions & 2 deletions src/app/components/Points/DelegationPoints.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React from "react";
import { useMediaQuery } from "usehooks-ts";

import { useDelegationsPoints } from "@/app/context/api/DelegationsPointsProvider";

Expand All @@ -10,6 +11,7 @@ export const DelegationPoints: React.FC<DelegationPointsProps> = ({
stakingTxHash,
}) => {
const { delegationPoints, isLoading } = useDelegationsPoints();
const isMobile = useMediaQuery("(max-width:1023px)");

const points = delegationPoints.get(stakingTxHash);

Expand All @@ -23,8 +25,12 @@ export const DelegationPoints: React.FC<DelegationPointsProps> = ({

return (
<div className="flex items-center justify-end gap-1">
<p className="whitespace-nowrap font-semibold">
{points !== undefined ? points : 0}
<p className="whitespace-nowrap">
{isMobile
? `Points: ${points !== undefined ? points : 0}`
: points !== undefined
? points
: 0}
</p>
</div>
);
Expand Down
1 change: 1 addition & 0 deletions src/app/components/Points/StakerPoints.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ export const StakerPoints: React.FC<StakerPointsProps> = ({
queryFn: () => getStakersPoints([publicKeyNoCoord]),
enabled: !!publicKeyNoCoord,
refetchInterval: 60000, // Refresh every minute
refetchOnWindowFocus: false,
});

if (isLoading) {
Expand Down
2 changes: 1 addition & 1 deletion src/app/components/Summary/Summary.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ export const Summary: React.FC<SummaryProps> = ({
<span
className="cursor-pointer text-xs"
data-tooltip-id={"tooltip-total-points"}
data-tooltip-content={`The points measure your staking activities based on your BTC public key. They are not associated with any tokens or other digital assets, and have no monetary value. Please check FAQ for further info.`}
data-tooltip-content={`The points measure your staking activities based on your BTC public key. Please check FAQ for further info.`}
>
<AiOutlineInfoCircle />
</span>
Expand Down
2 changes: 2 additions & 0 deletions src/app/context/api/DelegationsPointsProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ export const DelegationsPointsProvider: React.FC<
queryKey: ["delegationPoints", publicKeyNoCoord, delegationsAPI],
queryFn: fetchAllPoints,
enabled: isWalletConnected && delegationsAPI.length > 0,
refetchInterval: 60000, // Refetch every 60 seconds
refetchOnWindowFocus: false,
});

useEffect(() => {
Expand Down

0 comments on commit 272fe3d

Please sign in to comment.