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
fdc97ad3
Commit
fdc97ad3
authored
Nov 25, 2022
by
tom
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
homepage chart fixes
parent
4708f0d1
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
24 additions
and
10 deletions
+24
-10
ChainIndicatorChartContainer.tsx
ui/home/indicators/ChainIndicatorChartContainer.tsx
+3
-2
ChainIndicatorItem.tsx
ui/home/indicators/ChainIndicatorItem.tsx
+1
-1
ChainIndicators.tsx
ui/home/indicators/ChainIndicators.tsx
+12
-3
ContentLoader.tsx
ui/shared/ContentLoader.tsx
+8
-4
No files found.
ui/home/indicators/ChainIndicatorChartContainer.tsx
View file @
fdc97ad3
import
{
Flex
,
Spinner
}
from
'
@chakra-ui/react
'
;
import
{
Flex
}
from
'
@chakra-ui/react
'
;
import
type
{
UseQueryResult
}
from
'
@tanstack/react-query
'
;
import
type
{
UseQueryResult
}
from
'
@tanstack/react-query
'
;
import
React
from
'
react
'
;
import
React
from
'
react
'
;
import
type
{
ChainIndicatorChartData
}
from
'
./types
'
;
import
type
{
ChainIndicatorChartData
}
from
'
./types
'
;
import
ContentLoader
from
'
ui/shared/ContentLoader
'
;
import
DataFetchAlert
from
'
ui/shared/DataFetchAlert
'
;
import
DataFetchAlert
from
'
ui/shared/DataFetchAlert
'
;
import
ChainIndicatorChart
from
'
./ChainIndicatorChart
'
;
import
ChainIndicatorChart
from
'
./ChainIndicatorChart
'
;
...
@@ -14,7 +15,7 @@ const ChainIndicatorChartContainer = ({ data, isError, isLoading }: Props) => {
...
@@ -14,7 +15,7 @@ const ChainIndicatorChartContainer = ({ data, isError, isLoading }: Props) => {
const
content
=
(()
=>
{
const
content
=
(()
=>
{
if
(
isLoading
)
{
if
(
isLoading
)
{
return
<
Spinner
size=
"md"
m
=
"auto"
/>;
return
<
ContentLoader
mt
=
"auto"
/>;
}
}
if
(
isError
)
{
if
(
isError
)
{
...
...
ui/home/indicators/ChainIndicatorItem.tsx
View file @
fdc97ad3
...
@@ -18,7 +18,7 @@ interface Props {
...
@@ -18,7 +18,7 @@ interface Props {
}
}
const
ChainIndicatorItem
=
({
id
,
title
,
value
,
icon
,
isSelected
,
onClick
,
stats
}:
Props
)
=>
{
const
ChainIndicatorItem
=
({
id
,
title
,
value
,
icon
,
isSelected
,
onClick
,
stats
}:
Props
)
=>
{
const
bgColor
=
useColorModeValue
(
'
white
'
,
'
gray.900
'
);
const
bgColor
=
useColorModeValue
(
'
white
'
,
'
black
'
);
const
isMobile
=
useIsMobile
();
const
isMobile
=
useIsMobile
();
const
handleClick
=
React
.
useCallback
(()
=>
{
const
handleClick
=
React
.
useCallback
(()
=>
{
...
...
ui/home/indicators/ChainIndicators.tsx
View file @
fdc97ad3
...
@@ -40,8 +40,8 @@ const ChainIndicators = () => {
...
@@ -40,8 +40,8 @@ const ChainIndicators = () => {
()
=>
fetch
(
'
/node-api/stats
'
),
()
=>
fetch
(
'
/node-api/stats
'
),
);
);
const
bgColor
=
useColorModeValue
(
'
white
'
,
'
gray.900
'
);
const
bgColor
=
useColorModeValue
(
'
white
'
,
'
black
'
);
const
listBgColor
=
useColorModeValue
(
'
gray.50
'
,
'
black
'
);
const
listBgColor
=
useColorModeValue
(
'
gray.50
'
,
'
gray.900
'
);
if
(
indicators
.
length
===
0
)
{
if
(
indicators
.
length
===
0
)
{
return
null
;
return
null
;
...
@@ -91,7 +91,16 @@ const ChainIndicators = () => {
...
@@ -91,7 +91,16 @@ const ChainIndicators = () => {
<
ChainIndicatorChartContainer
{
...
queryResult
}
/>
<
ChainIndicatorChartContainer
{
...
queryResult
}
/>
</
Flex
>
</
Flex
>
{
indicators
.
length
>
1
&&
(
{
indicators
.
length
>
1
&&
(
<
Flex
flexShrink=
{
0
}
flexDir=
"column"
as=
"ul"
p=
{
3
}
borderRadius=
"lg"
bgColor=
{
listBgColor
}
rowGap=
{
3
}
order=
{
{
base
:
1
,
lg
:
2
}
}
>
<
Flex
flexShrink=
{
0
}
flexDir=
"column"
as=
"ul"
p=
{
3
}
borderRadius=
"lg"
bgColor=
{
listBgColor
}
rowGap=
{
3
}
order=
{
{
base
:
1
,
lg
:
2
}
}
>
{
indicators
.
map
((
indicator
)
=>
(
{
indicators
.
map
((
indicator
)
=>
(
<
ChainIndicatorItem
<
ChainIndicatorItem
key=
{
indicator
.
id
}
key=
{
indicator
.
id
}
...
...
ui/shared/ContentLoader.tsx
View file @
fdc97ad3
import
{
Box
,
Text
}
from
'
@chakra-ui/react
'
;
import
{
Box
,
Text
,
chakra
}
from
'
@chakra-ui/react
'
;
import
{
keyframes
}
from
'
@chakra-ui/system
'
;
import
{
keyframes
}
from
'
@chakra-ui/system
'
;
import
React
from
'
react
'
;
import
React
from
'
react
'
;
...
@@ -7,9 +7,13 @@ const runnerAnimation = keyframes`
...
@@ -7,9 +7,13 @@ const runnerAnimation = keyframes`
100% { left: '100%'; transform: translateX(-99%); }
100% { left: '100%'; transform: translateX(-99%); }
`
;
`
;
const
ContentLoader
=
()
=>
{
interface
Props
{
className
?:
string
;
}
const
ContentLoader
=
({
className
}:
Props
)
=>
{
return
(
return
(
<
Box
display=
"inline-block"
>
<
Box
display=
"inline-block"
className=
{
className
}
>
<
Box
<
Box
width=
"100%"
width=
"100%"
height=
"6px"
height=
"6px"
...
@@ -31,4 +35,4 @@ const ContentLoader = () => {
...
@@ -31,4 +35,4 @@ const ContentLoader = () => {
);
);
};
};
export
default
ContentLoader
;
export
default
chakra
(
ContentLoader
)
;
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