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
ca985c24
Commit
ca985c24
authored
Nov 14, 2022
by
tom
Committed by
isstuev
Nov 16, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix token logo placeholder
parent
7112db56
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
10 deletions
+9
-10
ChainIndicatorChart.tsx
ui/home/indicators/ChainIndicatorChart.tsx
+1
-2
indicators.tsx
ui/home/indicators/utils/indicators.tsx
+7
-7
Home.tsx
ui/pages/Home.tsx
+1
-1
No files found.
ui/home/indicators/ChainIndicatorChart.tsx
View file @
ca985c24
...
@@ -15,7 +15,6 @@ interface Props {
...
@@ -15,7 +15,6 @@ interface Props {
caption
?:
string
;
caption
?:
string
;
}
}
const
COLOR
=
'
#439AE2
'
;
const
CHART_MARGIN
=
{
bottom
:
0
,
left
:
10
,
right
:
10
,
top
:
0
};
const
CHART_MARGIN
=
{
bottom
:
0
,
left
:
10
,
right
:
10
,
top
:
0
};
const
ChainIndicatorChart
=
({
data
}:
Props
)
=>
{
const
ChainIndicatorChart
=
({
data
}:
Props
)
=>
{
...
@@ -37,7 +36,7 @@ const ChainIndicatorChart = ({ data }: Props) => {
...
@@ -37,7 +36,7 @@ const ChainIndicatorChart = ({ data }: Props) => {
<
g
transform=
{
`translate(${ CHART_MARGIN?.left || 0 },${ CHART_MARGIN?.top || 0 })`
}
opacity=
{
width
?
1
:
0
}
>
<
g
transform=
{
`translate(${ CHART_MARGIN?.left || 0 },${ CHART_MARGIN?.top || 0 })`
}
opacity=
{
width
?
1
:
0
}
>
<
ChartArea
<
ChartArea
data=
{
data
[
0
].
items
}
data=
{
data
[
0
].
items
}
color=
{
COLOR
}
color=
{
data
[
0
].
color
}
xScale=
{
xScale
}
xScale=
{
xScale
}
yScale=
{
yScale
}
yScale=
{
yScale
}
/>
/>
...
...
ui/home/indicators/utils/indicators.tsx
View file @
ca985c24
...
@@ -9,7 +9,8 @@ import globeIcon from 'icons/globe.svg';
...
@@ -9,7 +9,8 @@ import globeIcon from 'icons/globe.svg';
import
txIcon
from
'
icons/transactions.svg
'
;
import
txIcon
from
'
icons/transactions.svg
'
;
import
{
shortenNumberWithLetter
}
from
'
lib/formatters
'
;
import
{
shortenNumberWithLetter
}
from
'
lib/formatters
'
;
import
{
sortByDateDesc
}
from
'
ui/shared/chart/utils/sorts
'
;
import
{
sortByDateDesc
}
from
'
ui/shared/chart/utils/sorts
'
;
const
COLOR
=
'
#439AE2
'
;
import
TokenLogo
from
'
ui/shared/TokenLogo
'
;
const
CHART_COLOR
=
'
#439AE2
'
;
const
dailyTxsIndicator
:
TChainIndicator
<
QueryKeys
.
chartsTxs
>
=
{
const
dailyTxsIndicator
:
TChainIndicator
<
QueryKeys
.
chartsTxs
>
=
{
id
:
'
daily_txs
'
,
id
:
'
daily_txs
'
,
...
@@ -25,7 +26,7 @@ const dailyTxsIndicator: TChainIndicator<QueryKeys.chartsTxs> = {
...
@@ -25,7 +26,7 @@ const dailyTxsIndicator: TChainIndicator<QueryKeys.chartsTxs> = {
.
map
((
item
)
=>
({
date
:
new
Date
(
item
.
date
),
value
:
item
.
tx_count
}))
.
map
((
item
)
=>
({
date
:
new
Date
(
item
.
date
),
value
:
item
.
tx_count
}))
.
sort
(
sortByDateDesc
),
.
sort
(
sortByDateDesc
),
name
:
'
Tx/day
'
,
name
:
'
Tx/day
'
,
color
:
COLOR
,
color
:
C
HART_C
OLOR
,
valueFormatter
:
(
x
)
=>
shortenNumberWithLetter
(
x
,
undefined
,
{
maximumFractionDigits
:
2
}),
valueFormatter
:
(
x
)
=>
shortenNumberWithLetter
(
x
,
undefined
,
{
maximumFractionDigits
:
2
}),
}
]),
}
]),
},
},
...
@@ -35,9 +36,8 @@ const coinPriceIndicator: TChainIndicator<QueryKeys.chartsMarket> = {
...
@@ -35,9 +36,8 @@ const coinPriceIndicator: TChainIndicator<QueryKeys.chartsMarket> = {
id
:
'
coin_price
'
,
id
:
'
coin_price
'
,
title
:
`
${
appConfig
.
network
.
currency
.
symbol
}
price`
,
title
:
`
${
appConfig
.
network
.
currency
.
symbol
}
price`
,
value
:
(
stats
)
=>
'
$
'
+
Number
(
stats
.
coin_price
).
toLocaleString
(
undefined
,
{
minimumFractionDigits
:
2
,
maximumFractionDigits
:
6
}),
value
:
(
stats
)
=>
'
$
'
+
Number
(
stats
.
coin_price
).
toLocaleString
(
undefined
,
{
minimumFractionDigits
:
2
,
maximumFractionDigits
:
6
}),
// todo_tom change to TokenLogo after token-transfers branch merge
icon
:
<
TokenLogo
hash=
{
appConfig
.
network
.
nativeTokenAddress
||
''
}
name=
{
appConfig
.
network
.
currency
.
name
}
boxSize=
{
6
}
/>,
icon
:
<
Icon
as=
{
globeIcon
}
boxSize=
{
6
}
bgColor=
"#6A5DCC"
borderRadius=
"base"
color=
"white"
/>,
hint
:
`
${
appConfig
.
network
.
currency
.
symbol
}
token daily price in USD.`
,
hint
:
`
${
appConfig
.
network
.
currency
.
symbol
}
daily price in USD.`
,
api
:
{
api
:
{
queryName
:
QueryKeys
.
chartsMarket
,
queryName
:
QueryKeys
.
chartsMarket
,
path
:
'
/node-api/stats/charts/market
'
,
path
:
'
/node-api/stats/charts/market
'
,
...
@@ -46,7 +46,7 @@ const coinPriceIndicator: TChainIndicator<QueryKeys.chartsMarket> = {
...
@@ -46,7 +46,7 @@ const coinPriceIndicator: TChainIndicator<QueryKeys.chartsMarket> = {
.
map
((
item
)
=>
({
date
:
new
Date
(
item
.
date
),
value
:
Number
(
item
.
closing_price
)
}))
.
map
((
item
)
=>
({
date
:
new
Date
(
item
.
date
),
value
:
Number
(
item
.
closing_price
)
}))
.
sort
(
sortByDateDesc
),
.
sort
(
sortByDateDesc
),
name
:
`
${
appConfig
.
network
.
currency
.
symbol
}
price`
,
name
:
`
${
appConfig
.
network
.
currency
.
symbol
}
price`
,
color
:
COLOR
,
color
:
C
HART_C
OLOR
,
valueFormatter
:
(
x
)
=>
'
$
'
+
x
.
toLocaleString
(
undefined
,
{
minimumFractionDigits
:
2
,
maximumFractionDigits
:
6
}),
valueFormatter
:
(
x
)
=>
'
$
'
+
x
.
toLocaleString
(
undefined
,
{
minimumFractionDigits
:
2
,
maximumFractionDigits
:
6
}),
}
]),
}
]),
},
},
...
@@ -67,7 +67,7 @@ const marketPriceIndicator: TChainIndicator<QueryKeys.chartsMarket> = {
...
@@ -67,7 +67,7 @@ const marketPriceIndicator: TChainIndicator<QueryKeys.chartsMarket> = {
.
map
((
item
)
=>
({
date
:
new
Date
(
item
.
date
),
value
:
Number
(
item
.
closing_price
)
*
Number
(
response
.
available_supply
)
}))
.
map
((
item
)
=>
({
date
:
new
Date
(
item
.
date
),
value
:
Number
(
item
.
closing_price
)
*
Number
(
response
.
available_supply
)
}))
.
sort
(
sortByDateDesc
),
.
sort
(
sortByDateDesc
),
name
:
'
Market cap
'
,
name
:
'
Market cap
'
,
color
:
COLOR
,
color
:
C
HART_C
OLOR
,
valueFormatter
:
(
x
)
=>
'
$
'
+
shortenNumberWithLetter
(
x
,
undefined
,
{
maximumFractionDigits
:
0
}),
valueFormatter
:
(
x
)
=>
'
$
'
+
shortenNumberWithLetter
(
x
,
undefined
,
{
maximumFractionDigits
:
0
}),
}
]),
}
]),
},
},
...
...
ui/pages/Home.tsx
View file @
ca985c24
...
@@ -53,7 +53,6 @@ const Home = () => {
...
@@ -53,7 +53,6 @@ const Home = () => {
<
PageTitle
text=
{
<
PageTitle
text=
{
`Home Page for ${ appConfig.network.name } network`
`Home Page for ${ appConfig.network.name } network`
}
/>
}
/>
<
Button
colorScheme=
"red"
onClick=
{
checkSentry
}
>
Check Sentry
</
Button
>
<
ChainIndicators
/>
<
ChainIndicators
/>
{
/* will be deleted when we move to new CI */
}
{
/* will be deleted when we move to new CI */
}
{
isFormVisible
&&
(
{
isFormVisible
&&
(
...
@@ -72,6 +71,7 @@ const Home = () => {
...
@@ -72,6 +71,7 @@ const Home = () => {
<
Button
onClick=
{
handleSetTokenClick
}
>
Set cookie
</
Button
>
<
Button
onClick=
{
handleSetTokenClick
}
>
Set cookie
</
Button
>
</>
</>
)
}
)
}
<
Button
colorScheme=
"red"
onClick=
{
checkSentry
}
>
Check Sentry
</
Button
>
</
VStack
>
</
VStack
>
</
Page
>
</
Page
>
);
);
...
...
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