Skip to content

Commit 60a3e6c

Browse files
fix(app): title mismatch issue on near block count chart (#841)
Co-authored-by: yudho <yadudevpro@gmail.com>
1 parent 13a5961 commit 60a3e6c

File tree

7 files changed

+19
-12
lines changed

7 files changed

+19
-12
lines changed

apps/app/public/images/charts/blocks.svg

Lines changed: 1 addition & 1 deletion
Loading

apps/app/public/images/charts/blocks_dark.svg

Lines changed: 1 addition & 1 deletion
Loading

apps/app/src/components/Charts/Chart.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ const Chart = (props: Props) => {
7070
},
7171
{
7272
link: '/charts/blocks',
73-
text: t ? t('charts:blocks.heading') : 'New Blocks',
73+
text: t ? t('charts:blocks.heading') : 'Near Block Count',
7474
image: `/images/charts/blocks.svg`,
7575
image_dark: `/images/charts/blocks_dark.svg`,
7676
exclude: false,
@@ -200,10 +200,10 @@ const Chart = (props: Props) => {
200200
'Near Supply Growth Chart shows a breakdown of daily and the total Near supply.';
201201
break;
202202
case 'blocks':
203-
titleText = 'New Blocks';
203+
titleText = 'Near Block Count';
204204
yLabel = 'Blocks per Day';
205205
description =
206-
'New Blocks Chart shows the historical number of blocks produced daily on Near blockchain.';
206+
'Near Block Count Chart shows the historical number of blocks produced daily on Near blockchain.';
207207
break;
208208
case 'addresses':
209209
titleText = 'Near Unique Accounts Chart';

apps/app/src/components/Charts/TpsChart.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ const TpsChart = (props: Props) => {
6363
},
6464
{
6565
link: '/charts/blocks',
66-
text: t ? t('charts:blocks.heading') : 'New Blocks',
66+
text: t ? t('charts:blocks.heading') : 'Near Block Count',
6767
image: `/images/charts/blocks.svg`,
6868
image_dark: `/images/charts/blocks_dark.svg`,
6969
exclude: false,

apps/app/src/components/Transactions/Details.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -938,17 +938,17 @@ const Details = (props: Props) => {
938938
</div>
939939
</Tooltip>
940940
NEP-245 Tokens Transferred
941-
<div className="px-[0.65em] py-[0.45em] rounded-[1rem] leading-[.50rem] bg-neargray-700 dark:bg-black-200 text-black-500 dark:text-neargray-10 ml-1 font-semibold items-center text-center justify-center">
942-
{`${totalTokenIdsCount}`}
943-
</div>
944941
</div>
945942
{loading ? (
946943
<div className="w-full md:w-3/4">
947944
<Loader wrapperClassName="flex w-full max-w-xs" />
948945
</div>
949946
) : (
950947
<div className="relative w-full md:w-3/4">
951-
<NEPTokenTransactions events={allEvents} />
948+
<NEPTokenTransactions
949+
events={allEvents}
950+
totalTokenIdsCount={totalTokenIdsCount}
951+
/>
952952
</div>
953953
)}
954954
</div>

apps/app/src/components/common/NEPTokenTransactions.tsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,14 @@ import React, { useEffect, useRef, useState } from 'react';
22
import Link from 'next/link';
33
import { parseEventLogs } from '@/utils/near';
44
import FaRight from '../Icons/FaRight';
5-
import { shortenAddress } from '@/utils/libs';
5+
import { localFormat, shortenAddress } from '@/utils/libs';
66
import TokenInfo from './TokenInfo';
77
import { TransactionLog } from '@/utils/types';
88
import ArrowDownDouble from '../Icons/ArrowDownDouble';
99

1010
interface ParsedEventListProps {
1111
events: TransactionLog[];
12+
totalTokenIdsCount?: number;
1213
}
1314

1415
const RenderAllTransfers: React.FC<ParsedEventListProps> = ({ events }) => {
@@ -334,6 +335,7 @@ const RenderNetTransfers: React.FC<ParsedEventListProps> = ({ events }) => {
334335

335336
const NEPTokenTransactions: React.FC<ParsedEventListProps> = ({
336337
events,
338+
totalTokenIdsCount,
337339
}: ParsedEventListProps) => {
338340
const [tabIndex, setTabIndex] = useState(1);
339341

@@ -350,6 +352,11 @@ const NEPTokenTransactions: React.FC<ParsedEventListProps> = ({
350352
onClick={() => onTab(1)}
351353
>
352354
<h2 className="p-1.5">All Transfers</h2>
355+
{totalTokenIdsCount && (
356+
<div className="absolute text-white bg-neargreen text-[10px] h-4 inline-flex items-center font-semibold rounded-full ml-7 -top-2 z-10 px-[0.65em] py-[0.45em]">
357+
{localFormat(totalTokenIdsCount.toString())}
358+
</div>
359+
)}
353360
</button>
354361
<button
355362
className={`pl-1 relative text-xs leading-4 font-medium inline-block cursor-pointer mb-3 mr-3 focus:outline-none rounded-lg ${

apps/bos-components/src/components/Transactions/TpsChart.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ export default function (props: Props) {
7070
},
7171
{
7272
link: '/charts/blocks',
73-
text: t ? t('charts:blocks.heading') : 'New Blocks',
73+
text: t ? t('charts:blocks.heading') : 'Near Block Count',
7474
image: `/images/charts/blocks.svg`,
7575
image_dark: `/images/charts/blocks_dark.svg`,
7676
exclude: false,

0 commit comments

Comments
 (0)