Skip to content

Commit

Permalink
Merge main into dev (#234)
Browse files Browse the repository at this point in the history
  • Loading branch information
jrwbabylonlab authored Oct 17, 2024
2 parents d4c69c8 + e6bfc42 commit bd1f652
Show file tree
Hide file tree
Showing 7 changed files with 49 additions and 27 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "simple-staking",
"version": "0.3.5",
"version": "0.3.9",
"private": true,
"scripts": {
"dev": "next dev",
Expand Down
14 changes: 3 additions & 11 deletions src/app/components/Points/DelegationPoints.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import React from "react";
import { NumericFormat } from "react-number-format";

import { useDelegationsPoints } from "@/app/context/api/DelegationsPointsProvider";
import { useHealthCheck } from "@/app/hooks/useHealthCheck";
import { shouldDisplayPoints } from "@/config";

import { Points } from "./Points";

interface DelegationPointsProps {
stakingTxHash: string;
className?: string;
Expand Down Expand Up @@ -37,16 +38,7 @@ export const DelegationPoints: React.FC<DelegationPointsProps> = ({
<div className="flex items-center justify-end gap-1">
<p className="whitespace-nowrap">
<span className="lg:hidden">Points: </span>
{points !== undefined ? (
<NumericFormat
value={points.toFixed(3)}
displayType="text"
thousandSeparator=","
decimalSeparator="."
/>
) : (
"n.a."
)}
<Points points={points} />
</p>
</div>
</div>
Expand Down
37 changes: 37 additions & 0 deletions src/app/components/Points/Points.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import React from "react";
import { NumericFormat } from "react-number-format";
import { Tooltip } from "react-tooltip";

interface PointsProps {
points: number | undefined;
}

export const Points: React.FC<PointsProps> = ({ points }) => {
if (points === undefined || points === 0) {
return <>n.a.</>;
}

if (points < 0.001 && points > 0) {
return (
<>
<span
className="cursor-pointer text-xs"
data-tooltip-id={`tooltip-points-${points}`}
data-tooltip-content={points.toFixed(8)}
>
&lt;0.001
</span>
<Tooltip id={`tooltip-points-${points}`} className="tooltip-wrap" />
</>
);
}

return (
<NumericFormat
value={points.toFixed(3)}
displayType="text"
thousandSeparator=","
decimalSeparator="."
/>
);
};
14 changes: 3 additions & 11 deletions src/app/components/Points/StakerPoints.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import { useQuery } from "@tanstack/react-query";
import React from "react";
import { NumericFormat } from "react-number-format";

import { getStakersPoints } from "@/app/api/getPoints";

import { Points } from "./Points";

interface StakerPointsProps {
publicKeyNoCoord: string;
}
Expand Down Expand Up @@ -33,16 +34,7 @@ export const StakerPoints: React.FC<StakerPointsProps> = ({
return (
<div className="flex items-center justify-end gap-1">
<p className="whitespace-nowrap font-semibold">
{points !== undefined ? (
<NumericFormat
value={points.toFixed(3)}
displayType="text"
thousandSeparator=","
decimalSeparator="."
/>
) : (
"n.a."
)}
<Points points={points} />
</p>
</div>
);
Expand Down
2 changes: 1 addition & 1 deletion src/utils/wallet/list.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ export const walletList: IntegratedWallet[] = [
provider: cactusLinkProvider,
linkToDocs:
"https://chromewebstore.google.com/detail/cactus-link/chiilpgkfmcopocdffapngjcbggdehmj?pli=1",
supportedNetworks: [Network.SIGNET],
supportedNetworks: [Network.MAINNET, Network.SIGNET],
},
{
name: "Keystone",
Expand Down
3 changes: 2 additions & 1 deletion src/utils/wallet/providers/cactuslink_wallet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,7 @@ export class CactusLinkWallet extends WalletProvider {
};

getInscriptions(): Promise<InscriptionIdentifier[]> {
throw new Error("Method not implemented.");
// Temporary solution to ignore inscriptions filtering for Cactus Link Wallet
return Promise.resolve([]);
}
}

0 comments on commit bd1f652

Please sign in to comment.