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
cb844b8a
Commit
cb844b8a
authored
Apr 16, 2024
by
Max Alekseenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix app layout for mobiles
parent
b77b92b4
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
47 additions
and
26 deletions
+47
-26
LayoutApp.tsx
ui/shared/layout/LayoutApp.tsx
+38
-18
LayoutHome.tsx
ui/shared/layout/LayoutHome.tsx
+1
-1
MainArea.tsx
ui/shared/layout/components/MainArea.tsx
+5
-4
HeaderMobile.tsx
ui/snippets/header/HeaderMobile.tsx
+3
-3
No files found.
ui/shared/layout/LayoutApp.tsx
View file @
cb844b8a
import
{
Global
,
css
}
from
'
@emotion/react
'
;
import
React
from
'
react
'
;
import
React
from
'
react
'
;
import
type
{
Props
}
from
'
./types
'
;
import
type
{
Props
}
from
'
./types
'
;
...
@@ -9,24 +10,43 @@ import * as Layout from './components';
...
@@ -9,24 +10,43 @@ import * as Layout from './components';
const
LayoutDefault
=
({
children
}:
Props
)
=>
{
const
LayoutDefault
=
({
children
}:
Props
)
=>
{
return
(
return
(
<
Layout
.
Container
overflowY=
"hidden"
height=
"100vh"
>
<>
<
Layout
.
TopRow
/>
<
Global
<
HeaderMobile
/>
styles=
{
css
`
<
Layout
.
MainArea
>
html {
<
Layout
.
MainColumn
height: -webkit-fill-available;
paddingTop=
{
{
base
:
16
,
lg
:
0
}
}
}
paddingBottom=
{
0
}
body {
paddingX=
{
{
base
:
4
,
lg
:
6
}
}
height: 100vh;
height=
{
{
base
:
'
calc(100vh - 92px)
'
,
sm
:
'
auto
'
}
}
// 92px = Layout.TopRow + HeaderMobile
height: -webkit-fill-available;
>
display: flex;
<
AppErrorBoundary
>
flex-direction: column;
<
Layout
.
Content
pt=
{
{
base
:
0
,
lg
:
2
}
}
flexGrow=
{
1
}
>
}
{
children
}
#__next {
</
Layout
.
Content
>
flex: 1;
</
AppErrorBoundary
>
display: flex;
</
Layout
.
MainColumn
>
flex-direction: column;
</
Layout
.
MainArea
>
}
</
Layout
.
Container
>
`
}
/>
<
Layout
.
Container
overflowY=
"hidden"
flex=
{
1
}
display=
"flex"
flexDir=
"column"
>
<
Layout
.
TopRow
/>
<
HeaderMobile
hideSearchBar
/>
<
Layout
.
MainArea
minH=
"auto"
flex=
{
1
}
>
<
Layout
.
MainColumn
paddingTop=
{
{
base
:
0
,
lg
:
0
}
}
paddingBottom=
{
0
}
paddingX=
{
{
base
:
4
,
lg
:
6
}
}
>
<
AppErrorBoundary
>
<
Layout
.
Content
pt=
{
{
base
:
0
,
lg
:
2
}
}
flexGrow=
{
1
}
>
{
children
}
</
Layout
.
Content
>
</
AppErrorBoundary
>
</
Layout
.
MainColumn
>
</
Layout
.
MainArea
>
</
Layout
.
Container
>
</>
);
);
};
};
...
...
ui/shared/layout/LayoutHome.tsx
View file @
cb844b8a
...
@@ -12,7 +12,7 @@ const LayoutHome = ({ children }: Props) => {
...
@@ -12,7 +12,7 @@ const LayoutHome = ({ children }: Props) => {
return
(
return
(
<
Layout
.
Container
>
<
Layout
.
Container
>
<
Layout
.
TopRow
/>
<
Layout
.
TopRow
/>
<
HeaderMobile
isHomePage
/>
<
HeaderMobile
hideSearchBar
/>
<
Layout
.
MainArea
>
<
Layout
.
MainArea
>
<
Layout
.
SideBar
/>
<
Layout
.
SideBar
/>
<
Layout
.
MainColumn
<
Layout
.
MainColumn
...
...
ui/shared/layout/components/MainArea.tsx
View file @
cb844b8a
import
{
Flex
}
from
'
@chakra-ui/react
'
;
import
{
Flex
,
chakra
}
from
'
@chakra-ui/react
'
;
import
React
from
'
react
'
;
import
React
from
'
react
'
;
interface
Props
{
interface
Props
{
children
:
React
.
ReactNode
;
children
:
React
.
ReactNode
;
className
?:
string
;
}
}
const
MainArea
=
({
children
}:
Props
)
=>
{
const
MainArea
=
({
children
,
className
}:
Props
)
=>
{
return
(
return
(
<
Flex
w=
"100%"
minH=
"calc(100vh - 36px)"
alignItems=
"stretch"
>
<
Flex
className=
{
className
}
w=
"100%"
minH=
"calc(100vh - 36px)"
alignItems=
"stretch"
>
{
children
}
{
children
}
</
Flex
>
</
Flex
>
);
);
};
};
export
default
React
.
memo
(
MainArea
);
export
default
React
.
memo
(
chakra
(
MainArea
)
);
ui/snippets/header/HeaderMobile.tsx
View file @
cb844b8a
...
@@ -16,11 +16,11 @@ const LOGO_IMAGE_PROPS = {
...
@@ -16,11 +16,11 @@ const LOGO_IMAGE_PROPS = {
};
};
type
Props
=
{
type
Props
=
{
isHomePage
?:
boolean
;
hideSearchBar
?:
boolean
;
renderSearchBar
?:
()
=>
React
.
ReactNode
;
renderSearchBar
?:
()
=>
React
.
ReactNode
;
}
}
const
HeaderMobile
=
({
isHomePage
,
renderSearchBar
}:
Props
)
=>
{
const
HeaderMobile
=
({
hideSearchBar
,
renderSearchBar
}:
Props
)
=>
{
const
bgColor
=
useColorModeValue
(
'
white
'
,
'
black
'
);
const
bgColor
=
useColorModeValue
(
'
white
'
,
'
black
'
);
const
scrollDirection
=
useScrollDirection
();
const
scrollDirection
=
useScrollDirection
();
const
{
ref
,
inView
}
=
useInView
({
threshold
:
1
});
const
{
ref
,
inView
}
=
useInView
({
threshold
:
1
});
...
@@ -57,7 +57,7 @@ const HeaderMobile = ({ isHomePage, renderSearchBar }: Props) => {
...
@@ -57,7 +57,7 @@ const HeaderMobile = ({ isHomePage, renderSearchBar }: Props) => {
{
config
.
features
.
blockchainInteraction
.
isEnabled
&&
<
WalletMenuMobile
/>
}
{
config
.
features
.
blockchainInteraction
.
isEnabled
&&
<
WalletMenuMobile
/>
}
</
Flex
>
</
Flex
>
</
Flex
>
</
Flex
>
{
!
isHomePage
&&
searchBar
}
{
!
hideSearchBar
&&
searchBar
}
</
Box
>
</
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