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
41bf1447
Commit
41bf1447
authored
Nov 16, 2022
by
isstuev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add chain indicators
parent
c383aa7f
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
32 additions
and
108 deletions
+32
-108
index.tsx
pages/index.tsx
+1
-1
ChainIndicators.tsx
ui/home/indicators/ChainIndicators.tsx
+1
-0
Home.tsx
ui/pages/Home.tsx
+30
-68
Home2.tsx
ui/pages/Home2.tsx
+0
-39
No files found.
pages/index.tsx
View file @
41bf1447
...
@@ -2,7 +2,7 @@ import type { NextPage } from 'next';
...
@@ -2,7 +2,7 @@ import type { NextPage } from 'next';
import
Head
from
'
next/head
'
;
import
Head
from
'
next/head
'
;
import
React
from
'
react
'
;
import
React
from
'
react
'
;
import
Home
from
'
ui/pages/Home
2
'
;
import
Home
from
'
ui/pages/Home
'
;
const
HomePage
:
NextPage
=
()
=>
{
const
HomePage
:
NextPage
=
()
=>
{
return
(
return
(
...
...
ui/home/indicators/ChainIndicators.tsx
View file @
41bf1447
...
@@ -74,6 +74,7 @@ const ChainIndicators = () => {
...
@@ -74,6 +74,7 @@ const ChainIndicators = () => {
flexDir=
{
{
base
:
'
column
'
,
lg
:
'
row
'
}
}
flexDir=
{
{
base
:
'
column
'
,
lg
:
'
row
'
}
}
w=
"100%"
w=
"100%"
alignItems=
"stretch"
alignItems=
"stretch"
mt=
{
8
}
>
>
<
Flex
flexGrow=
{
1
}
flexDir=
"column"
order=
{
{
base
:
2
,
lg
:
1
}
}
p=
{
{
base
:
6
,
lg
:
0
}
}
>
<
Flex
flexGrow=
{
1
}
flexDir=
"column"
order=
{
{
base
:
2
,
lg
:
1
}
}
p=
{
{
base
:
6
,
lg
:
0
}
}
>
<
Flex
alignItems=
"center"
>
<
Flex
alignItems=
"center"
>
...
...
ui/pages/Home.tsx
View file @
41bf1447
import
{
VStack
,
Textarea
,
Button
,
Alert
,
AlertTitle
,
AlertDescription
,
Link
,
Code
}
from
'
@chakra-ui/react
'
;
import
{
Box
,
Heading
,
Flex
,
LightMode
}
from
'
@chakra-ui/react
'
;
import
*
as
Sentry
from
'
@sentry/react
'
;
import
type
{
ChangeEvent
}
from
'
react
'
;
import
React
from
'
react
'
;
import
React
from
'
react
'
;
import
appConfig
from
'
configs/app/config
'
;
import
*
as
cookies
from
'
lib/cookies
'
;
import
useToast
from
'
lib/hooks/useToast
'
;
import
ChainIndicators
from
'
ui/home/indicators/ChainIndicators
'
;
import
ChainIndicators
from
'
ui/home/indicators/ChainIndicators
'
;
import
LatestBlocks
from
'
ui/home/LatestBlocks
'
;
import
LatestTxs
from
'
ui/home/LatestTxs
'
;
import
Stats
from
'
ui/home/Stats
'
;
import
Page
from
'
ui/shared/Page/Page
'
;
import
Page
from
'
ui/shared/Page/Page
'
;
import
PageTitle
from
'
ui/shared/Page/PageTitle
'
;
import
SearchBar
from
'
ui/snippets/searchBar/SearchBar
'
;
const
Home
=
()
=>
{
const
Home
=
()
=>
{
const
toast
=
useToast
();
const
[
isFormVisible
,
setFormVisibility
]
=
React
.
useState
(
false
);
const
[
token
,
setToken
]
=
React
.
useState
(
''
);
React
.
useEffect
(()
=>
{
const
token
=
cookies
.
get
(
cookies
.
NAMES
.
API_TOKEN
);
setFormVisibility
(
Boolean
(
!
token
&&
appConfig
.
isAccountSupported
));
},
[]);
const
checkSentry
=
React
.
useCallback
(()
=>
{
Sentry
.
captureException
(
new
Error
(
'
Test error
'
),
{
extra
:
{
foo
:
'
bar
'
},
tags
:
{
source
:
'
test
'
}
});
},
[]);
const
handleTokenChange
=
React
.
useCallback
((
event
:
ChangeEvent
<
HTMLTextAreaElement
>
)
=>
{
setToken
(
event
.
target
.
value
);
},
[]);
const
handleSetTokenClick
=
React
.
useCallback
(()
=>
{
cookies
.
set
(
cookies
.
NAMES
.
API_TOKEN
,
token
);
setToken
(
''
);
toast
({
position
:
'
top-right
'
,
title
:
'
Success 🥳
'
,
description
:
'
Successfully set cookie
'
,
status
:
'
success
'
,
variant
:
'
subtle
'
,
isClosable
:
true
,
onCloseComplete
:
()
=>
{
setFormVisibility
(
false
);
},
});
},
[
toast
,
token
]);
const
prodUrl
=
'
https://blockscout.com/poa/core
'
;
return
(
return
(
<
Page
>
<
Page
hasSearch=
{
false
}
>
<
VStack
gap=
{
4
}
alignItems=
"flex-start"
maxW=
"1000px"
>
<
Box
<
PageTitle
text=
{
w=
"100%"
`Home Page for ${ appConfig.network.name } network`
backgroundImage=
"radial-gradient(farthest-corner at 0 0, rgba(183, 148, 244, 0.8) 0%, rgba(0, 163, 196, 0.8) 100%)"
}
/>
borderRadius=
"24px"
<
ChainIndicators
/>
padding=
{
{
base
:
'
24px 40px
'
,
lg
:
'
48px
'
}
}
{
/* will be deleted when we move to new CI */
}
minW=
"850px"
{
isFormVisible
&&
(
>
<>
<
Heading
<
Alert
status=
"error"
flexDirection=
"column"
alignItems=
"flex-start"
>
as=
"h1"
<
AlertTitle
fontSize=
"md"
>
size=
{
{
base
:
'
lg
'
,
ld
:
'
xl
'
}
}
!!! Temporary solution for authentication !!!
fontWeight=
{
{
base
:
600
,
lg
:
500
}
}
</
AlertTitle
>
color=
"white"
<
AlertDescription
mt=
{
3
}
>
mb=
{
{
base
:
6
,
lg
:
8
}
}
To Sign in go to
<
Link
href=
{
prodUrl
}
target=
"_blank"
>
{
prodUrl
}
</
Link
>
first, sign in there, copy obtained API token from cookie
>
<
Code
ml=
{
1
}
>
{
cookies
.
NAMES
.
API_TOKEN
}
</
Code
>
and paste it in the form below. After submitting the form you should be successfully
Welcome to Blockscout explorer
authenticated in current environment
</
Heading
>
</
AlertDescription
>
<
LightMode
><
SearchBar
backgroundColor=
"white"
isHomepage
/></
LightMode
>
</
Alert
>
</
Box
>
<
Textarea
value=
{
token
}
onChange=
{
handleTokenChange
}
placeholder=
"API token"
/>
<
Stats
/>
<
Button
onClick=
{
handleSetTokenClick
}
>
Set cookie
</
Button
>
<
ChainIndicators
/
>
</
>
<
Flex
mt=
{
12
}
direction=
{
{
base
:
'
column
'
,
lg
:
'
row
'
}
}
>
)
}
<
Box
mr=
{
{
base
:
0
,
lg
:
12
}
}
mb=
{
{
base
:
8
,
lg
:
0
}
}
width=
{
{
base
:
'
100%
'
,
lg
:
'
280px
'
}
}
><
LatestBlocks
/></
Box
>
<
B
utton
colorScheme=
"red"
onClick=
{
checkSentry
}
>
Check Sentry
</
Button
>
<
B
ox
flexGrow=
{
1
}
><
LatestTxs
/></
Box
>
</
VStack
>
</
Flex
>
</
Page
>
</
Page
>
);
);
};
};
...
...
ui/pages/Home2.tsx
deleted
100644 → 0
View file @
c383aa7f
import
{
Box
,
Heading
,
Flex
,
LightMode
}
from
'
@chakra-ui/react
'
;
import
React
from
'
react
'
;
import
LatestBlocks
from
'
ui/home/LatestBlocks
'
;
import
LatestTxs
from
'
ui/home/LatestTxs
'
;
import
Stats
from
'
ui/home/Stats
'
;
import
Page
from
'
ui/shared/Page/Page
'
;
import
SearchBar
from
'
ui/snippets/searchBar/SearchBar
'
;
const
Home
=
()
=>
{
return
(
<
Page
hasSearch=
{
false
}
>
<
Box
w=
"100%"
backgroundImage=
"radial-gradient(farthest-corner at 0 0, rgba(183, 148, 244, 0.8) 0%, rgba(0, 163, 196, 0.8) 100%)"
borderRadius=
"24px"
padding=
{
{
base
:
'
24px 40px
'
,
lg
:
'
48px
'
}
}
>
<
Heading
as=
"h1"
size=
{
{
base
:
'
lg
'
,
ld
:
'
xl
'
}
}
fontWeight=
{
{
base
:
600
,
lg
:
500
}
}
color=
"white"
mb=
{
{
base
:
6
,
lg
:
8
}
}
>
Welcome to Blockscout explorer
</
Heading
>
<
LightMode
><
SearchBar
backgroundColor=
"white"
isHomepage
/></
LightMode
>
</
Box
>
<
Stats
/>
<
Flex
mt=
{
12
}
direction=
{
{
base
:
'
column
'
,
lg
:
'
row
'
}
}
>
<
Box
mr=
{
{
base
:
0
,
lg
:
12
}
}
mb=
{
{
base
:
8
,
lg
:
0
}
}
width=
{
{
base
:
'
100%
'
,
lg
:
'
280px
'
}
}
><
LatestBlocks
/></
Box
>
<
Box
flexGrow=
{
1
}
><
LatestTxs
/></
Box
>
</
Flex
>
</
Page
>
);
};
export
default
Home
;
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