Skip to content

Commit 9a1825d

Browse files
fix(frontend): fix build & format errors (#1313)
1 parent 0caed08 commit 9a1825d

File tree

5 files changed

+11
-10
lines changed

5 files changed

+11
-10
lines changed

apps/api/src/sql/queries/accounts/stats/near.sql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
SELECT
22
TO_CHAR(TO_TIMESTAMP(date / 1e9), 'YYYY-MM-DD') AS date,
33
account,
4-
amount_out,
5-
amount_in
4+
COALESCE(amount_out, 0)::TEXT AS amount_out,
5+
COALESCE(amount_in, 0)::TEXT AS amount_in
66
FROM
77
account_near_stats
88
WHERE

apps/frontend/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ RUN apk add --no-cache libc6-compat
55
WORKDIR /app
66

77
FROM base AS prepare
8-
RUN yarn global add turbo@1
8+
RUN yarn global add turbo
99
COPY . .
1010
RUN turbo prune frontend --docker
1111

apps/frontend/src/app/[lang]/address/[address]/assets/page.tsx

Whitespace-only changes.

apps/frontend/src/components/address/analytics/balance.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ const tooltipFormatter = function (this: Highcharts.Point) {
4646
const value =
4747
point.series.options.id === 'storage'
4848
? bytesFormat(point.y)
49-
: numberFormat(point.y, { maximumFractionDigits: 2 }) + nearIcon;
49+
: nearIcon + ' ' + numberFormat(point.y, { maximumFractionDigits: 2 });
5050

5151
return `<span class="flex items-center gap-x-1"><span style="color:var(--highcharts-color-${index})">\u25CF</span> ${point.series.name}: <span class="font-bold align-middle">${value}</span></span>`;
5252
});

apps/frontend/src/components/address/analytics/near.tsx

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ import { use, useMemo } from 'react';
99
import { AccountNearStats } from 'nb-schemas';
1010

1111
import { SkeletonSlot } from '@/components/skeleton';
12-
import { dateFormat, numberFormat } from '@/lib/format';
12+
import { dateFormat, numberFormat, toNear } from '@/lib/format';
13+
import { nearIcon } from '@/lib/utils';
1314
import { Skeleton } from '@/ui/skeleton';
1415

1516
import { AnalyticsChart } from './chart';
@@ -38,9 +39,9 @@ const tooltipFormatter = function (this: Highcharts.Point) {
3839
const rows = (this.points as Array<Highcharts.Point>)?.map((point, index) => {
3940
return `<span class="flex items-center gap-x-1"><span style="color:var(--highcharts-color-${index})">\u25CF</span> ${
4041
point.series.name
41-
}: <span class="font-bold align-middle">${numberFormat(
42-
point.y,
43-
)}</span></span>`;
42+
}: <span class="font-bold align-middle">${
43+
nearIcon + ' ' + numberFormat(point.y)
44+
}</span></span>`;
4445
});
4546

4647
return header + (rows?.join('') ?? '');
@@ -57,8 +58,8 @@ export const NearChart = ({ loading, nearPromise }: Props) => {
5758
for (const item of reversed) {
5859
const timestamp = new Date(item.date).getTime();
5960

60-
amountIn.push([timestamp, +item.amount_in]);
61-
amountOut.push([timestamp, +item.amount_out]);
61+
amountIn.push([timestamp, +toNear(item.amount_in)]);
62+
amountOut.push([timestamp, +toNear(item.amount_out)]);
6263
}
6364

6465
return { amountIn, amountOut };

0 commit comments

Comments
 (0)