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
1d96aa0b
Commit
1d96aa0b
authored
Aug 29, 2022
by
tom
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add active state for network button in desktop
parent
5cb9197b
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
12 deletions
+13
-12
Burger.tsx
ui/blocks/header/Burger.tsx
+0
-1
NetworkMenu.tsx
ui/blocks/networkMenu/NetworkMenu.tsx
+10
-6
NetworkMenuButton.tsx
ui/blocks/networkMenu/NetworkMenuButton.tsx
+3
-5
No files found.
ui/blocks/header/Burger.tsx
View file @
1d96aa0b
...
@@ -43,7 +43,6 @@ const Burger = () => {
...
@@ -43,7 +43,6 @@ const Burger = () => {
<
Flex
alignItems=
"center"
justifyContent=
"space-between"
>
<
Flex
alignItems=
"center"
justifyContent=
"space-between"
>
<
NetworkLogo
onClick=
{
handleNetworkLogoClick
}
/>
<
NetworkLogo
onClick=
{
handleNetworkLogoClick
}
/>
<
NetworkMenuButton
<
NetworkMenuButton
isCollapsed
isMobile
isMobile
isActive=
{
isNetworkMenuOpened
}
isActive=
{
isNetworkMenuOpened
}
onClick=
{
handleNetworkMenuButtonClick
}
onClick=
{
handleNetworkMenuButtonClick
}
...
...
ui/blocks/networkMenu/NetworkMenu.tsx
View file @
1d96aa0b
...
@@ -10,12 +10,16 @@ interface Props {
...
@@ -10,12 +10,16 @@ interface Props {
const
NetworkMenu
=
({
isCollapsed
}:
Props
)
=>
{
const
NetworkMenu
=
({
isCollapsed
}:
Props
)
=>
{
return
(
return
(
<
Popover
openDelay=
{
300
}
placement=
"right-start"
gutter=
{
22
}
isLazy
>
<
Popover
openDelay=
{
300
}
placement=
"right-start"
gutter=
{
22
}
isLazy
>
<
PopoverTrigger
>
{
({
isOpen
})
=>
(
<
Box
>
<>
<
NetworkMenuButton
isCollapsed=
{
isCollapsed
}
/>
<
PopoverTrigger
>
</
Box
>
<
Box
marginLeft=
{
isCollapsed
?
'
0px
'
:
'
7px
'
}
>
</
PopoverTrigger
>
<
NetworkMenuButton
isActive=
{
isOpen
}
/>
<
NetworkMenuContentDesktop
/>
</
Box
>
</
PopoverTrigger
>
<
NetworkMenuContentDesktop
/>
</>
)
}
</
Popover
>
</
Popover
>
);
);
};
};
...
...
ui/blocks/networkMenu/NetworkMenuButton.tsx
View file @
1d96aa0b
...
@@ -5,13 +5,12 @@ import networksIcon from 'icons/networks.svg';
...
@@ -5,13 +5,12 @@ import networksIcon from 'icons/networks.svg';
import
getDefaultTransitionProps
from
'
theme/utils/getDefaultTransitionProps
'
;
import
getDefaultTransitionProps
from
'
theme/utils/getDefaultTransitionProps
'
;
interface
Props
{
interface
Props
{
isCollapsed
?:
boolean
;
isMobile
?:
boolean
;
isMobile
?:
boolean
;
isActive
?:
boolean
;
isActive
?:
boolean
;
onClick
?:
()
=>
void
;
onClick
?:
()
=>
void
;
}
}
const
NetworkMenuButton
=
({
is
Collapsed
,
is
Mobile
,
isActive
,
onClick
}:
Props
,
ref
:
React
.
ForwardedRef
<
HTMLButtonElement
>
)
=>
{
const
NetworkMenuButton
=
({
isMobile
,
isActive
,
onClick
}:
Props
,
ref
:
React
.
ForwardedRef
<
HTMLButtonElement
>
)
=>
{
const
defaultIconColor
=
useColorModeValue
(
'
gray.600
'
,
'
gray.400
'
);
const
defaultIconColor
=
useColorModeValue
(
'
gray.600
'
,
'
gray.400
'
);
const
bgColorMobile
=
useColorModeValue
(
'
blue.50
'
,
'
gray.800
'
);
const
bgColorMobile
=
useColorModeValue
(
'
blue.50
'
,
'
gray.800
'
);
const
iconColorMobile
=
useColorModeValue
(
'
blue.700
'
,
'
blue.50
'
);
const
iconColorMobile
=
useColorModeValue
(
'
blue.700
'
,
'
blue.50
'
);
...
@@ -25,7 +24,7 @@ const NetworkMenuButton = ({ isCollapsed, isMobile, isActive, onClick }: Props,
...
@@ -25,7 +24,7 @@ const NetworkMenuButton = ({ isCollapsed, isMobile, isActive, onClick }: Props,
ref=
{
ref
}
ref=
{
ref
}
h=
"36px"
h=
"36px"
borderRadius=
"base"
borderRadius=
"base"
backgroundColor=
{
is
Mobile
&&
is
Active
?
bgColorMobile
:
'
none
'
}
backgroundColor=
{
isActive
?
bgColorMobile
:
'
none
'
}
onClick=
{
onClick
}
onClick=
{
onClick
}
>
>
<
Icon
<
Icon
...
@@ -33,9 +32,8 @@ const NetworkMenuButton = ({ isCollapsed, isMobile, isActive, onClick }: Props,
...
@@ -33,9 +32,8 @@ const NetworkMenuButton = ({ isCollapsed, isMobile, isActive, onClick }: Props,
width=
"36px"
width=
"36px"
height=
"36px"
height=
"36px"
padding=
"10px"
padding=
"10px"
color=
{
is
Mobile
&&
is
Active
?
iconColorMobile
:
defaultIconColor
}
color=
{
isActive
?
iconColorMobile
:
defaultIconColor
}
_hover=
{
{
color
:
isMobile
?
undefined
:
'
blue.400
'
}
}
_hover=
{
{
color
:
isMobile
?
undefined
:
'
blue.400
'
}
}
marginLeft=
{
isCollapsed
?
'
0px
'
:
'
7px
'
}
cursor=
"pointer"
cursor=
"pointer"
{
...
getDefaultTransitionProps
({
transitionProperty
:
'
margin
'
})
}
{
...
getDefaultTransitionProps
({
transitionProperty
:
'
margin
'
})
}
/>
/>
...
...
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