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
f1529251
Commit
f1529251
authored
Aug 27, 2022
by
tom
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
search bar transition and minor fixes
parent
8a367e1b
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
32 additions
and
21 deletions
+32
-21
Burger.tsx
ui/blocks/header/Burger.tsx
+1
-0
Header.tsx
ui/blocks/header/Header.tsx
+11
-12
NavigationMobile.tsx
ui/blocks/navigation/NavigationMobile.tsx
+1
-1
SearchBarMobile.tsx
ui/blocks/searchBar/SearchBarMobile.tsx
+17
-7
Page.tsx
ui/shared/Page/Page.tsx
+2
-1
No files found.
ui/blocks/header/Burger.tsx
View file @
f1529251
...
...
@@ -34,6 +34,7 @@ const Burger = () => {
isOpen=
{
isOpen
}
placement=
"left"
onClose=
{
onClose
}
autoFocus=
{
false
}
>
<
DrawerOverlay
/>
<
DrawerContent
maxWidth=
"260px"
>
...
...
ui/blocks/header/Header.tsx
View file @
f1529251
import
{
HStack
,
VStack
,
Flex
,
useColorModeValue
}
from
'
@chakra-ui/react
'
;
import
{
HStack
,
Box
,
Flex
,
useColorModeValue
}
from
'
@chakra-ui/react
'
;
import
React
from
'
react
'
;
import
useIsMobile
from
'
lib/hooks/useIsMobile
'
;
...
...
@@ -15,27 +15,26 @@ const Header = () => {
if
(
isMobile
)
{
return
(
<
VStack
as=
"header"
position=
"fixed"
top=
{
0
}
left=
{
0
}
paddingX=
{
4
}
paddingY=
{
2
}
bgColor=
{
bgColor
}
width=
"100%"
>
<
Box
bgColor=
{
bgColor
}
>
<
Flex
as=
"header"
position=
"fixed"
top=
{
0
}
left=
{
0
}
paddingX=
{
4
}
paddingY=
{
2
}
bgColor=
{
bgColor
}
width=
"100%"
alignItems=
"center"
justifyContent=
"space-between"
zIndex=
{
10
}
>
<
Burger
/>
<
NetworkLogo
/>
<
ProfileMenu
/>
</
Flex
>
<
SearchBar
/>
</
VStack
>
</
Box
>
);
}
...
...
ui/blocks/navigation/NavigationMobile.tsx
View file @
f1529251
...
...
@@ -12,7 +12,7 @@ const NavigationMobile = () => {
return
(
<>
<
Box
as=
"nav"
mt=
{
8
}
>
<
Box
as=
"nav"
mt=
{
6
}
>
<
VStack
as=
"ul"
spacing=
"2"
alignItems=
"flex-start"
overflow=
"hidden"
>
{
mainNavItems
.
map
((
item
)
=>
<
NavLink
key=
{
item
.
text
}
{
...
item
}
isActive=
{
router
.
asPath
===
item
.
pathname
}
/>)
}
</
VStack
>
...
...
ui/blocks/searchBar/SearchBarMobile.tsx
View file @
f1529251
import
{
SearchIcon
}
from
'
@chakra-ui/icons
'
;
import
{
InputGroup
,
Input
,
InputLeftElement
,
useColorModeValue
}
from
'
@chakra-ui/react
'
;
import
{
InputGroup
,
Input
,
InputLeftElement
,
useColorModeValue
,
chakra
}
from
'
@chakra-ui/react
'
;
import
throttle
from
'
lodash/throttle
'
;
import
React
from
'
react
'
;
import
type
{
ChangeEvent
,
FormEvent
}
from
'
react
'
;
...
...
@@ -20,6 +20,7 @@ const SearchBarMobile = ({ onChange, onSubmit }: Props) => {
const
searchIconColor
=
useColorModeValue
(
'
blackAlpha.600
'
,
'
whiteAlpha.600
'
);
const
inputBorderColor
=
useColorModeValue
(
'
blackAlpha.100
'
,
'
whiteAlpha.200
'
);
const
bgColor
=
useColorModeValue
(
'
white
'
,
'
black
'
);
const
handleScroll
=
React
.
useCallback
(()
=>
{
const
currentScrollPosition
=
window
.
pageYOffset
;
...
...
@@ -44,12 +45,21 @@ const SearchBarMobile = ({ onChange, onSubmit }: Props) => {
// eslint-disable-next-line react-hooks/exhaustive-deps
},
[]);
if
(
!
isVisible
)
{
return
null
;
}
return
(
<
form
noValidate
onSubmit=
{
onSubmit
}
>
<
chakra
.
form
noValidate
onSubmit=
{
onSubmit
}
paddingX=
{
4
}
paddingTop=
{
1
}
paddingBottom=
{
2
}
position=
"fixed"
top=
"56px"
left=
"0"
bgColor=
{
bgColor
}
transform=
{
isVisible
?
'
translateY(0)
'
:
'
translateY(-100%)
'
}
transitionProperty=
"transform"
transitionDuration=
"slow"
>
<
InputGroup
size=
"sm"
>
<
InputLeftElement
>
<
SearchIcon
w=
{
4
}
h=
{
4
}
color=
{
searchIconColor
}
/>
...
...
@@ -62,7 +72,7 @@ const SearchBarMobile = ({ onChange, onSubmit }: Props) => {
borderColor=
{
inputBorderColor
}
/>
</
InputGroup
>
</
form
>
</
chakra
.
form
>
);
};
...
...
ui/shared/Page/Page.tsx
View file @
f1529251
...
...
@@ -33,13 +33,14 @@ const Page = ({ children }: Props) => {
alignItems=
"stretch"
>
{
!
isMobile
&&
<
NavigationDesktop
/>
}
<
VStack
width=
"100%"
paddingX=
{
isMobile
?
4
:
8
}
paddingTop=
{
isMobile
?
'
104px
'
:
9
}
paddingBottom=
{
1
0
}
>
<
VStack
width=
"100%"
paddingX=
{
isMobile
?
4
:
8
}
paddingTop=
{
isMobile
?
0
:
9
}
paddingBottom=
{
10
}
spacing=
{
0
}
>
<
Header
/>
<
Box
as=
"main"
borderRadius=
"base"
w=
"100%"
overflow=
"hidden"
paddingTop=
{
isMobile
?
'
138px
'
:
'
52px
'
}
>
{
children
}
</
Box
>
...
...
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