Skip to content

Commit b255a14

Browse files
committed
components/ViewHeightSensor: remove view height sensor
This appears to no longer be necessary for correct app height on Android.
1 parent 27b8b1e commit b255a14

File tree

7 files changed

+19
-52
lines changed

7 files changed

+19
-52
lines changed

src/activities/activities.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
top: 0px;
3939
// FIXME: this should be a variable
4040
left: 47px;
41-
height: 100%;
41+
height: calc(100% - pb.$status-bar-height);
4242
z-index: bp.$pt-z-index-overlay;
4343
}
4444
}

src/app/app.scss

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
width: 100%;
1717
height: 100%;
1818
background-color: bp.$pt-app-background-color;
19+
display: flex;
20+
flex-direction: column;
1921

2022
.#{bp.$ns}-dark & {
2123
background-color: bp.$pt-dark-app-background-color;
@@ -52,9 +54,9 @@
5254
}
5355

5456
.pb-app-body {
55-
// height makes everything fit without scrolling
56-
height: calc(var(--pb-vh, 100vh) - #{pb.$status-bar-height}) !important;
57-
position: relative;
57+
min-height: 0;
58+
flex: 1 1 auto;
59+
5860
display: flex;
5961
flex-direction: row;
6062

src/components/ViewHeightSensor.test.tsx

Lines changed: 0 additions & 11 deletions
This file was deleted.

src/components/ViewHeightSensor.tsx

Lines changed: 0 additions & 29 deletions
This file was deleted.

src/index.scss

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,6 @@
1212
@use 'variables' as pb;
1313
@use '@blueprintjs/core/lib/scss/variables' as bp;
1414

15-
:root {
16-
--pb-vh: 100vh;
17-
}
18-
1915
// use :focus-visible instead of :focus (so we don't need blueprint.js focus style manager)
2016

2117
:focus {
@@ -48,6 +44,19 @@ body {
4844
// no scrolling of the page
4945
overflow: hidden;
5046
user-select: none;
47+
width: 100%;
48+
height: 100%;
49+
position: absolute;
50+
}
51+
52+
#root {
53+
width: 100%;
54+
height: 100%;
55+
56+
& [data-overlay-container] {
57+
width: 100%;
58+
height: 100%;
59+
}
5160
}
5261

5362
// Utility classes - do not use these in new code!

src/index.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ import { createLogger } from 'redux-logger';
1313
import createSagaMiddleware from 'redux-saga';
1414
import App from './app/App';
1515
import { appVersion } from './app/constants';
16-
import ViewHeightSensor from './components/ViewHeightSensor';
1716
import { db } from './fileStorage/context';
1817
import { i18nManager } from './i18n';
1918
import { rootReducer } from './reducers';
@@ -95,7 +94,6 @@ ReactDOM.render(
9594
<React.StrictMode>
9695
<Provider store={store}>
9796
<I18nContext.Provider value={i18nManager}>
98-
<ViewHeightSensor />
9997
<OverlayProvider>
10098
<HotkeysProvider>
10199
<App />

src/status-bar/status-bar.scss

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@
77
@use '../variables' as pb;
88

99
.pb-status-bar {
10-
position: fixed;
11-
top: calc(var(--pb-vh, 100vh) - #{pb.$status-bar-height});
1210
background-color: pb.$pybricks-blue;
1311
height: pb.$status-bar-height;
1412
width: 100vw;

0 commit comments

Comments
 (0)