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
931acc39
Commit
931acc39
authored
May 15, 2023
by
isstuev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
type fix
parent
1cb344e2
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
32 additions
and
26 deletions
+32
-26
config.ts
configs/app/config.ts
+1
-0
useNavItems.tsx
lib/hooks/useNavItems.tsx
+2
-23
navigation-items.ts
types/client/navigation-items.ts
+23
-0
NavLink.tsx
ui/snippets/navigation/NavLink.tsx
+2
-1
NavLinkGroupDesktop.tsx
ui/snippets/navigation/NavLinkGroupDesktop.tsx
+2
-1
NavLinkGroupMobile.tsx
ui/snippets/navigation/NavLinkGroupMobile.tsx
+2
-1
No files found.
configs/app/config.ts
View file @
931acc39
/* eslint-disable no-restricted-properties */
import
type
{
NavItemExternal
}
from
'
types/client/navigation-items
'
;
import
type
{
WalletType
}
from
'
types/client/wallets
'
;
import
type
{
NetworkExplorer
}
from
'
types/networks
'
;
import
type
{
ChainIndicatorId
}
from
'
ui/home/indicators/types
'
;
...
...
lib/hooks/useNavItems.tsx
View file @
931acc39
import
{
useRouter
}
from
'
next/router
'
;
import
type
{
Route
}
from
'
nextjs-routes
'
;
import
React
from
'
react
'
;
import
type
{
NavItemInternal
,
NavItem
,
NavGroupItem
}
from
'
types/client/navigation-items
'
;
import
appConfig
from
'
configs/app/config
'
;
import
abiIcon
from
'
icons/ABI.svg
'
;
import
apiKeysIcon
from
'
icons/API.svg
'
;
...
...
@@ -27,28 +28,6 @@ import verifiedIcon from 'icons/verified.svg';
import
watchlistIcon
from
'
icons/watchlist.svg
'
;
import
{
rightLineArrow
}
from
'
lib/html-entities
'
;
type
NavItemCommon
=
{
text
:
string
;
icon
?:
React
.
FunctionComponent
<
React
.
SVGAttributes
<
SVGElement
>>
;
}
type
NavItemInternal
=
NavItemCommon
&
{
nextRoute
:
Route
;
isActive
?:
boolean
;
isNewUi
?:
boolean
;
}
type
NavItemExternal
=
NavItemCommon
&
{
url
:
string
;
}
export
type
NavItem
=
NavItemInternal
|
NavItemExternal
export
type
NavGroupItem
=
NavItemCommon
&
{
isActive
?:
boolean
;
subItems
:
Array
<
NavItem
>
|
Array
<
Array
<
NavItem
>>
;
}
interface
ReturnType
{
mainNavItems
:
Array
<
NavItem
|
NavGroupItem
>
;
accountNavItems
:
Array
<
NavItem
>
;
...
...
types/client/navigation-items.ts
0 → 100644
View file @
931acc39
import
type
{
Route
}
from
'
nextjs-routes
'
;
type
NavItemCommon
=
{
text
:
string
;
icon
?:
React
.
FunctionComponent
<
React
.
SVGAttributes
<
SVGElement
>>
;
}
export
type
NavItemInternal
=
NavItemCommon
&
{
nextRoute
:
Route
;
isActive
?:
boolean
;
isNewUi
?:
boolean
;
}
export
type
NavItemExternal
=
NavItemCommon
&
{
url
:
string
;
}
export
type
NavItem
=
NavItemInternal
|
NavItemExternal
export
type
NavGroupItem
=
NavItemCommon
&
{
isActive
?:
boolean
;
subItems
:
Array
<
NavItem
>
|
Array
<
Array
<
NavItem
>>
;
}
ui/snippets/navigation/NavLink.tsx
View file @
931acc39
...
...
@@ -3,8 +3,9 @@ import NextLink from 'next/link';
import
{
route
}
from
'
nextjs-routes
'
;
import
React
from
'
react
'
;
import
type
{
NavItem
}
from
'
types/client/navigation-items
'
;
import
useIsMobile
from
'
lib/hooks/useIsMobile
'
;
import
type
{
NavItem
}
from
'
lib/hooks/useNavItems
'
;
import
{
isInternalItem
}
from
'
lib/hooks/useNavItems
'
;
import
useColors
from
'
./useColors
'
;
...
...
ui/snippets/navigation/NavLinkGroupDesktop.tsx
View file @
931acc39
...
...
@@ -12,8 +12,9 @@ import {
}
from
'
@chakra-ui/react
'
;
import
React
from
'
react
'
;
import
type
{
NavGroupItem
}
from
'
types/client/navigation-items
'
;
import
chevronIcon
from
'
icons/arrows/east-mini.svg
'
;
import
type
{
NavGroupItem
}
from
'
lib/hooks/useNavItems
'
;
import
NavLink
from
'
./NavLink
'
;
import
useNavLinkStyleProps
from
'
./useNavLinkStyleProps
'
;
...
...
ui/snippets/navigation/NavLinkGroupMobile.tsx
View file @
931acc39
...
...
@@ -7,8 +7,9 @@ import {
}
from
'
@chakra-ui/react
'
;
import
React
from
'
react
'
;
import
type
{
NavGroupItem
}
from
'
types/client/navigation-items
'
;
import
chevronIcon
from
'
icons/arrows/east-mini.svg
'
;
import
type
{
NavGroupItem
}
from
'
lib/hooks/useNavItems
'
;
import
useNavLinkStyleProps
from
'
./useNavLinkStyleProps
'
;
...
...
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