Skip to content

Commit

Permalink
fix: 修复移动端下会被虚拟导航栏遮挡的问题
Browse files Browse the repository at this point in the history
主要是100vh在移动端兼容性问题
  • Loading branch information
moonrailgun committed Aug 14, 2021
1 parent 2a31d43 commit a992c9c
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 24 deletions.
8 changes: 2 additions & 6 deletions build/template/pre-loading.css
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ html, body {
overflow-y: auto;
/* 不显示横向滚动条, 至少不在html, body层显示横向滚动条 */
overflow-x: hidden;
height: auto !important;
min-height: 100vh !important;
height: 100% !important;
min-height: 100% !important;
}

body {
Expand All @@ -27,13 +27,9 @@ body {
background-size: cover;
background-position: center;
background-repeat: no-repeat;
min-width: 100vw;
min-height: 100vh;
}

#app {
min-width: 100vw;
min-height: 100vh;
display: flex;
}

Expand Down
1 change: 1 addition & 0 deletions src/portal/routes/rtc/MainScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ const Container = styled.div`
const MainContent = styled.div`
flex: 1;
position: relative;
height: 100%;
`;

const MainPeerContainer = styled.div`
Expand Down
2 changes: 1 addition & 1 deletion src/web/components/panels/CommonPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const Root = styled.div`
display: flex;
flex-direction: column;
height: 100%;
max-height: 100vh;
max-height: 100%;
overflow: hidden;
`;

Expand Down
30 changes: 19 additions & 11 deletions src/web/routes/App.less
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
* {
box-sizing: border-box;
font-family: PingFang SC, "Microsoft YaHei", arial, serif;
font-family: PingFang SC, 'Microsoft YaHei', arial, serif;
transition: opacity 0.1s ease-in-out;
}

html, body {
html,
body {
margin: 0;
padding: 0;
min-height: 100%;
Expand All @@ -13,16 +14,21 @@ html, body {
overflow: hidden;
}


.app {
ul, li, p {
ul,
li,
p {
margin: 0;
padding: 0;
list-style: none;
}

a {
&,&:link,&:visited,&:hover,&:active {
&,
&:link,
&:visited,
&:hover,
&:active {
text-decoration: none;
color: #2596e5;
font-size: 14px;
Expand All @@ -33,7 +39,7 @@ html, body {
margin: 0;
white-space: pre-wrap;
word-wrap: break-word;
font-family: PingFang SC, "Microsoft YaHei", arial, serif;
font-family: PingFang SC, 'Microsoft YaHei', arial, serif;
}

img {
Expand All @@ -42,17 +48,19 @@ html, body {
}
}


#app {
.app {
position: absolute;
left: 0;
right: 0;
bottom: 0;
top: 0;
overflow: hidden;
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
min-height: 100vh;
min-width: 100%;
height: 100vh;
background-color: rgba(255,255,255,0.2);
background-color: rgba(255, 255, 255, 0.2);
transition: initial;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,14 @@ import { GroupMembersAction } from '@web/components/panels/actions/GroupMembersA
const Root = styled.div`
display: flex;
flex-direction: row;
flex: 1;
height: 100%;
`;

interface GroupChatPanelProps {
groupUUID: string;
}
export const GroupChatPanel: React.FC<GroupChatPanelProps> = TMemo((props) => {
const { groupUUID } = props;
const [showMembers, setShowMembers] = useState(false);
const groupInfo = useJoinedGroupInfo(groupUUID);

if (_isNil(groupInfo)) {
Expand Down
2 changes: 1 addition & 1 deletion src/web/routes/Main/Content/Personal/UserConversePanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import styled from 'styled-components';

const Root = styled.div`
display: flex;
flex: 1;
flex-direction: column;
height: 100%;
`;

interface UserConversePanelParams {
Expand Down
8 changes: 5 additions & 3 deletions src/web/routes/Main/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,11 @@ import { SidebarContextProvider } from './SidebarContext';
const Root = styled.div.attrs({
'data-testid': 'main-page-root',
})`
width: 100vw;
height: 100vh;
position: relative;
position: absolute;
left: 0;
right: 0;
top: 0;
bottom: 0;
`;

const BaseContent = styled.div`
Expand Down

0 comments on commit a992c9c

Please sign in to comment.