Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge main into dev #234

Merged
merged 7 commits into from
Oct 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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([]);
}
}