Skip to content

Commit

Permalink
Fixing inconsistent labels if each graph time stamp are different
Browse files Browse the repository at this point in the history
Juan Gallicchio committed Sep 18, 2024
1 parent d13be5c commit af3b18b
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/library/Graphs/PayoutBar.tsx
Original file line number Diff line number Diff line change
@@ -85,9 +85,17 @@ export const PayoutBar = ({ days, height }: PayoutBarProps) => {
? colors.transparent[mode]
: colors.secondary[mode];

const allTimestamps = [
...new Set([
...graphPayouts.map((item: AnySubscan) => item.block_timestamp),
...graphPoolClaims.map((item: AnySubscan) => item.block_timestamp),
...graphUnclaimedPayouts.map((item: AnySubscan) => item.block_timestamp),
]),
].sort();

const data = {
labels: graphPayouts.map((item: AnySubscan) => {
const dateObj = format(fromUnixTime(item.block_timestamp), 'do MMM', {
labels: allTimestamps.map((timestamp) => {
const dateObj = format(fromUnixTime(timestamp), 'do MMM', {
locale: locales[i18n.resolvedLanguage ?? DefaultLocale],
});
return `${dateObj}`;

0 comments on commit af3b18b

Please sign in to comment.