Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
F
frontend
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
vicotor
frontend
Commits
b50a0405
Commit
b50a0405
authored
Dec 13, 2022
by
Yuri Mikhin
Committed by
Yuri Mikhin
Dec 13, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove 'visible' property from charts.
parent
8a5c74ae
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
3 additions
and
17 deletions
+3
-17
stats.ts
types/client/stats.ts
+0
-1
ChartsWidgetsList.tsx
ui/stats/ChartsWidgetsList.tsx
+1
-3
charts-scheme.ts
ui/stats/constants/charts-scheme.ts
+0
-8
useStats.tsx
ui/stats/useStats.tsx
+2
-5
No files found.
types/client/stats.ts
View file @
b50a0405
...
...
@@ -19,7 +19,6 @@ export enum StatsIntervalId {
}
export
type
StatsChart
=
{
visible
?:
boolean
;
id
:
string
;
title
:
string
;
description
:
string
;
...
...
ui/stats/ChartsWidgetsList.tsx
View file @
b50a0405
...
...
@@ -14,7 +14,7 @@ type Props = {
}
const
ChartsWidgetsList
=
({
charts
,
interval
}:
Props
)
=>
{
const
isAnyChartDisplayed
=
charts
.
some
((
section
)
=>
section
.
charts
.
some
(
chart
=>
chart
.
visible
)
);
const
isAnyChartDisplayed
=
charts
.
some
((
section
)
=>
section
.
charts
.
length
>
0
);
return
(
<
Box
>
...
...
@@ -23,7 +23,6 @@ const ChartsWidgetsList = ({ charts, interval }: Props) => {
{
charts
.
map
((
section
)
=>
(
<
ListItem
display=
{
section
.
charts
.
every
((
chart
)
=>
!
chart
.
visible
)
?
'
none
'
:
'
block
'
}
key=
{
section
.
id
}
mb=
{
8
}
_last=
{
{
...
...
@@ -46,7 +45,6 @@ const ChartsWidgetsList = ({ charts, interval }: Props) => {
{
section
.
charts
.
map
((
chart
)
=>
(
<
GridItem
key=
{
chart
.
id
}
display=
{
chart
.
visible
?
'
block
'
:
'
none
'
}
>
<
ChartWidget
id=
{
chart
.
id
}
...
...
ui/stats/constants/charts-scheme.ts
View file @
b50a0405
...
...
@@ -9,13 +9,11 @@ export const statsChartsScheme: Array<StatsSection> = [
id
:
'
new-blocks
'
,
title
:
'
New blocks
'
,
description
:
'
New blocks number per day
'
,
visible
:
true
,
},
{
id
:
'
average-block-size
'
,
title
:
'
Average block size
'
,
description
:
'
Average size of blocks in bytes
'
,
visible
:
true
,
},
],
},
...
...
@@ -27,25 +25,21 @@ export const statsChartsScheme: Array<StatsSection> = [
id
:
'
average-transaction-fee
'
,
title
:
'
Average transaction fee
'
,
description
:
'
The average amount in USD spent per transaction
'
,
visible
:
true
,
},
{
id
:
'
transactions-fees
'
,
title
:
'
Transactions fees
'
,
description
:
'
Amount of tokens paid as fees
'
,
visible
:
true
,
},
{
id
:
'
new-transactions
'
,
title
:
'
Transactions fees
'
,
description
:
'
New transactions number per period
'
,
visible
:
true
,
},
{
id
:
'
transactions-growth
'
,
title
:
'
Transactions growth
'
,
description
:
'
Cumulative transactions number per period
'
,
visible
:
true
,
},
],
},
...
...
@@ -57,13 +51,11 @@ export const statsChartsScheme: Array<StatsSection> = [
id
:
'
active-accounts
'
,
title
:
'
Active accounts
'
,
description
:
'
Active accounts number per period
'
,
visible
:
true
,
},
{
id
:
'
accounts-growth
'
,
title
:
'
Accounts growth
'
,
description
:
'
Cumulative accounts number per period
'
,
visible
:
true
,
},
],
},
...
...
ui/stats/useStats.tsx
View file @
b50a0405
...
...
@@ -25,16 +25,13 @@ export default function useStats() {
const
filterCharts
=
useCallback
((
q
:
string
,
currentSection
:
StatsSectionIds
)
=>
{
const
charts
=
statsChartsScheme
?.
map
((
section
:
StatsSection
)
=>
{
const
charts
=
section
.
charts
.
map
((
chart
:
StatsChart
)
=>
({
...
chart
,
visible
:
isSectionMatches
(
section
,
currentSection
)
&&
isChartNameMatches
(
q
,
chart
),
}));
const
charts
=
section
.
charts
.
filter
((
chart
:
StatsChart
)
=>
isSectionMatches
(
section
,
currentSection
)
&&
isChartNameMatches
(
q
,
chart
));
return
{
...
section
,
charts
,
};
});
})
.
filter
((
section
:
StatsSection
)
=>
section
.
charts
.
length
>
0
)
;
setDisplayedCharts
(
charts
||
[]);
},
[]);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment