From 112df80e894bebfeccb3ebd1fd89818865b6556b Mon Sep 17 00:00:00 2001 From: manubo Date: Sat, 28 Sep 2019 12:22:14 +0200 Subject: [PATCH] Dyanically set iframe height --- src/css/popup.scss | 14 ++- src/js/components/App.js | 3 + src/js/components/App/TimerView.js | 7 +- .../Errors/InvalidConfigurationError.js | 2 +- src/js/components/Errors/UnknownError.js | 7 +- .../components/Errors/UpgradeRequiredError.js | 14 ++- src/js/components/Popup.js | 109 ++++++++---------- 7 files changed, 83 insertions(+), 73 deletions(-) diff --git a/src/css/popup.scss b/src/css/popup.scss index 7919bdf..f0d5be0 100644 --- a/src/css/popup.scss +++ b/src/css/popup.scss @@ -13,6 +13,8 @@ html { #moco-bx-root { min-width: 516px; + min-height: 300px; + transition: height 2s ease-out; h1 { font-weight: normal; @@ -99,11 +101,16 @@ html { text-align: center; margin-top: 3rem; - h1 { - margin-bottom: 0; + h2 { + font-weight: normal; + font-size: 24px; + line-height: 1.2; + margin-top: 0.5rem; + margin-bottom: 0.5rem; } + p { - margin-top: 0.6rem; + margin-top: 0.5rem; } .timer { @@ -134,7 +141,6 @@ html { img { margin-top: 1.5rem; margin-bottom: 2rem; - width: 44%; &.moco-bx-logo { width: 48px; diff --git a/src/js/components/App.js b/src/js/components/App.js index 73e9c8d..48f57d1 100644 --- a/src/js/components/App.js +++ b/src/js/components/App.js @@ -110,6 +110,9 @@ class App extends Component { componentDidMount() { window.addEventListener("keydown", this.handleKeyDown) + console.log(window.document.body.scrollHeight) + console.log(window.document.body) + parent.postMessage(window.document.body.scrollHeight, "*") chrome.runtime.onMessage.addListener(this.handleSetFormErrors) } diff --git a/src/js/components/App/TimerView.js b/src/js/components/App/TimerView.js index d22a4e2..eedc287 100644 --- a/src/js/components/App/TimerView.js +++ b/src/js/components/App/TimerView.js @@ -10,11 +10,8 @@ export default function TimerView({ timedActivity, onStopTimer }) { return (
-

- {timedActivity.assignment_name} -
- {timedActivity.task_name} -

+

{timedActivity.assignment_name}

+

{timedActivity.task_name}

{timedActivity.customer_name}

( Browser extension configuration settings chrome.runtime.sendMessage({ type: "openOptions" })} />