Skip to content

Commit

Permalink
fix: fix Runes details
Browse files Browse the repository at this point in the history
  • Loading branch information
slient-coder committed May 6, 2024
1 parent 07a478b commit c06cc3b
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 6 deletions.
21 changes: 18 additions & 3 deletions src/ui/pages/Runes/RunesTokenScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { useTools } from '@/ui/components/ActionComponent';
import { BRC20Ticker } from '@/ui/components/BRC20Ticker';
import InscriptionPreview from '@/ui/components/InscriptionPreview';
import { useCurrentAccount } from '@/ui/state/accounts/hooks';
import { useOrdinalsWebsite, useUnisatWebsite } from '@/ui/state/settings/hooks';
import { useBlockstreamUrl, useOrdinalsWebsite, useUnisatWebsite } from '@/ui/state/settings/hooks';
import { colors } from '@/ui/theme/colors';
import { fontSizes } from '@/ui/theme/font';
import { copyToClipboard, useLocationState, useWallet } from '@/ui/utils';
Expand Down Expand Up @@ -93,6 +93,8 @@ export default function RunesTokenScreen() {
const tools = useTools();

const ordinalsWebsite = useOrdinalsWebsite();

const mempoolWebsite = useBlockstreamUrl();
if (loading) {
return (
<Layout>
Expand Down Expand Up @@ -158,7 +160,14 @@ export default function RunesTokenScreen() {
</Row>
</Column>

<Text text={tokenSummary.runeInfo.spacedRune} preset="title-bold"></Text>
<Text
text={tokenSummary.runeInfo.spacedRune}
preset="title-bold"
onClick={() => {
copyToClipboard(tokenSummary.runeInfo.spacedRune).then(() => {
tools.toastSuccess('Copied');
});
}}></Text>
{tokenSummary.runeLogo ? (
<Row>
<InscriptionPreview data={tokenSummary.runeLogo} preset="small" asLogo />
Expand Down Expand Up @@ -191,10 +200,16 @@ export default function RunesTokenScreen() {

<Section title="symbol" value={tokenSummary.runeInfo.symbol} />

<Section title="holders" value={tokenSummary.runeInfo.holders} />
<Section title="holders" value={tokenSummary.runeInfo.holders} />

<Section title="transactions" value={tokenSummary.runeInfo.transactions} />

<Section
title="etching"
value={tokenSummary.runeInfo.etching}
link={`${mempoolWebsite}/tx/${tokenSummary.runeInfo.etching}`}
/>

{tokenSummary.runeInfo.parent ? (
<Section
title="parent"
Expand Down
6 changes: 3 additions & 3 deletions src/ui/pages/Runes/SendRunesScreen.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Decimal } from 'decimal.js';
import { BigNumber } from 'bignumber.js';
import { useEffect, useMemo, useState } from 'react';
import { useLocation } from 'react-router-dom';

Expand Down Expand Up @@ -68,13 +68,13 @@ export default function SendRunesScreen() {
tools.showLoading(true);
fetchAssetUtxosRunes(runeInfo.runeid)
.then((utxos) => {
let balance = new Decimal(0);
let balance = new BigNumber(0);
for (let i = 0; i < utxos.length; i++) {
const utxo = utxos[i];
if (utxo.runes) {
utxo.runes.forEach((rune) => {
if (rune.runeid === runeInfo.runeid) {
balance = balance.plus(new Decimal(rune.amount));
balance = balance.plus(new BigNumber(rune.amount));
}
});
}
Expand Down

0 comments on commit c06cc3b

Please sign in to comment.