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
7700cd77
Commit
7700cd77
authored
Aug 27, 2022
by
tom
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
merge fix
parent
4f9d218e
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
20 deletions
+18
-20
useNavItems.tsx
lib/hooks/useNavItems.tsx
+4
-4
NetworkMenu.tsx
ui/navigation/networkMenu/NetworkMenu.tsx
+0
-16
Page.tsx
ui/shared/Page/Page.tsx
+14
-0
No files found.
lib/hooks/useNavItems.tsx
View file @
7700cd77
...
...
@@ -26,10 +26,10 @@ export default function useNavItems() {
const
accountNavItems
=
[
{
text
:
'
Watchlist
'
,
pathname
:
basePath
+
'
/account/watchlist
'
,
icon
:
watchlistIcon
},
{
text
:
'
Private tags
'
,
pathname
:
basePath
+
'
/account/private
-
tags
'
,
icon
:
privateTagIcon
},
{
text
:
'
Public tags
'
,
pathname
:
basePath
+
'
/account/public
-tags
'
,
icon
:
publicTagIcon
},
{
text
:
'
API keys
'
,
pathname
:
basePath
+
'
/account/api
-keys
'
,
icon
:
apiKeysIcon
},
{
text
:
'
Custom ABI
'
,
pathname
:
basePath
+
'
/account/custom
-
abi
'
,
icon
:
abiIcon
},
{
text
:
'
Private tags
'
,
pathname
:
basePath
+
'
/account/private
_
tags
'
,
icon
:
privateTagIcon
},
{
text
:
'
Public tags
'
,
pathname
:
basePath
+
'
/account/public
_tags_request
'
,
icon
:
publicTagIcon
},
{
text
:
'
API keys
'
,
pathname
:
basePath
+
'
/account/api
_key
'
,
icon
:
apiKeysIcon
},
{
text
:
'
Custom ABI
'
,
pathname
:
basePath
+
'
/account/custom
_
abi
'
,
icon
:
abiIcon
},
];
return
{
mainNavItems
,
accountNavItems
};
...
...
ui/navigation/networkMenu/NetworkMenu.tsx
View file @
7700cd77
import
{
Popover
,
PopoverTrigger
,
Box
}
from
'
@chakra-ui/react
'
;
import
{
useRouter
}
from
'
next/router
'
;
import
React
from
'
react
'
;
import
*
as
cookies
from
'
lib/cookies
'
;
import
NetworkMenuButton
from
'
./NetworkMenuButton
'
;
import
NetworkMenuPopup
from
'
./NetworkMenuPopup
'
;
interface
Props
{
...
...
@@ -11,19 +8,6 @@ interface Props {
}
const
NetworkMenu
=
({
isCollapsed
}:
Props
)
=>
{
const
router
=
useRouter
();
const
networkType
=
router
.
query
.
network_type
;
const
networkSubType
=
router
.
query
.
network_sub_type
;
React
.
useEffect
(()
=>
{
if
(
typeof
networkType
===
'
string
'
)
{
cookies
.
set
(
cookies
.
NAMES
.
NETWORK_TYPE
,
networkType
);
}
if
(
typeof
networkSubType
===
'
string
'
)
{
cookies
.
set
(
cookies
.
NAMES
.
NETWORK_SUB_TYPE
,
networkSubType
);
}
},
[
networkType
,
networkSubType
]);
return
(
<
Popover
openDelay=
{
300
}
placement=
"right-start"
gutter=
{
22
}
isLazy
>
<
PopoverTrigger
>
...
...
ui/shared/Page/Page.tsx
View file @
7700cd77
import
{
Box
,
HStack
,
VStack
}
from
'
@chakra-ui/react
'
;
import
{
useRouter
}
from
'
next/router
'
;
import
React
from
'
react
'
;
import
*
as
cookies
from
'
lib/cookies
'
;
import
useIsMobile
from
'
lib/hooks/useIsMobile
'
;
import
Header
from
'
ui/header/Header
'
;
import
Navigation
from
'
ui/navigation/Navigation
'
;
...
...
@@ -11,6 +13,18 @@ interface Props {
const
Page
=
({
children
}:
Props
)
=>
{
const
isMobile
=
useIsMobile
();
const
router
=
useRouter
();
const
networkType
=
router
.
query
.
network_type
;
const
networkSubType
=
router
.
query
.
network_sub_type
;
React
.
useEffect
(()
=>
{
if
(
typeof
networkType
===
'
string
'
)
{
cookies
.
set
(
cookies
.
NAMES
.
NETWORK_TYPE
,
networkType
);
}
if
(
typeof
networkSubType
===
'
string
'
)
{
cookies
.
set
(
cookies
.
NAMES
.
NETWORK_SUB_TYPE
,
networkSubType
);
}
},
[
networkType
,
networkSubType
]);
return
(
<
HStack
...
...
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