Skip to content

Commit

Permalink
Merged in r2-2604-pwa-fixing-login-page (pull request #6530)
Browse files Browse the repository at this point in the history
R2-2604 - PWA Fixing login page

Approved-by: Joshua Toliver
  • Loading branch information
aespinoza-quoin authored and jtoliver-quoin committed Oct 10, 2023
2 parents a8e073a + 5a18671 commit 7e3590f
Show file tree
Hide file tree
Showing 9 changed files with 36 additions and 11 deletions.
16 changes: 16 additions & 0 deletions app/javascript/app-init.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,20 @@ function appInit() {
return { store };
}

// This is a workaround for PWA incorrect Height
// Get rid of when this is fixed
// https://bugs.chromium.org/p/chromium/issues/detail?id=1457883
// https://bugs.chromium.org/p/chromium/issues/detail?id=1464146
const documentHeight = () => {
const doc = document.documentElement;

if (window.matchMedia("(display-mode: fullscreen)").matches) {
doc.style.setProperty("--doc-height", `${window.screen.availHeight}px`);
}
};

window.screen.orientation.addEventListener("change", documentHeight);

documentHeight();

export default appInit;
4 changes: 2 additions & 2 deletions app/javascript/components/code-of-conduct/styles.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.container {
height: 100vh;
height: var(--doc-height, 100vh);
display: flex;
flex-direction: column;
background-color: var(--c-blue);
Expand Down Expand Up @@ -44,7 +44,7 @@
border-radius: 0 0 10px 10px;
display: flex;
padding: 16px;

& span:first-child {
flex: 1;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@

.root {
width: 300px;
min-height: 100vh;
min-height: var(--doc-height, 100vh);
margin-left: 10px;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
:global html, :global body {
height: var(--doc-height, 100vh);
}

.root {
display: flex;
overflow: hidden;
background: var(--c-content-grey);
height: var(--doc-height, 100vh);
}

.content {
flex-grow: 1;
height: 100vh;
height: var(--doc-height, 100vh);
overflow: hidden;
background: var(--c-content-grey);
transition: var(--transition);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,12 @@
background: repeating-linear-gradient(45deg, var(--c-dark-blue), var(--c-dark-blue) 10px, var(--c-blue) 10px, var(--c-blue) 20px);
}

:global html, :global body {
height: var(--doc-height, 100vh);
}

.primeroBackground {
height: 100vh;
height: var(--doc-height, 100vh);
overflow: auto;
display: flex;
flex-direction: column;
Expand Down
6 changes: 3 additions & 3 deletions app/javascript/components/page/styles.css
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.root {
flex-grow: 1;
height: 100vh;
height: var(--doc-height, 100vh);
overflow: hidden;
overflow-y: scroll;

Expand All @@ -17,7 +17,7 @@
flex-grow: 1;
display: flex;
flex-direction: column;
height: 100vh;
height: var(--doc-height, 100vh);
overflow: hidden;

&.demo {
Expand Down Expand Up @@ -95,7 +95,7 @@
display: flex;
padding: 0;
height: 65%;

& > div:first-of-type {
padding: 0 0.5em;
overflow-y: scroll;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
display: flex;
align-items: center;
justify-content: center;
height: 100vh;
height: var(--doc-height, 100vh);
text-align: center;
flex-direction: column;
padding: 0 3%;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
display: flex;
align-items: center;
justify-content: center;
height: 100vh;
height: var(--doc-height, 100vh);
text-align: center;
flex-direction: column;
padding: 0 3%;
Expand Down
2 changes: 1 addition & 1 deletion app/javascript/config/theme.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ const overrides = {
"#root": {
display: "flex",
flexDirection: "column",
height: "100vh"
height: `var(--doc-height, 100vh)`
},
legend: {
display: "none"
Expand Down

0 comments on commit 7e3590f

Please sign in to comment.