From 9e7cb3bd367607b32e102c3a87b68b33c53dec46 Mon Sep 17 00:00:00 2001 From: Georgios Andreadis Date: Wed, 22 Jul 2020 15:39:11 +0200 Subject: Fix scenario name handling and increase margin --- frontend/src/components/app/results/PortfolioResultsComponent.js | 2 +- .../modals/custom-components/NewScenarioModalComponent.js | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) (limited to 'frontend') diff --git a/frontend/src/components/app/results/PortfolioResultsComponent.js b/frontend/src/components/app/results/PortfolioResultsComponent.js index 90325b2b..35dba603 100644 --- a/frontend/src/components/app/results/PortfolioResultsComponent.js +++ b/frontend/src/components/app/results/PortfolioResultsComponent.js @@ -54,7 +54,7 @@ const PortfolioResultsComponent = ({ portfolio, scenarios }) => {

{METRIC_NAMES[metric]}

- + approx(tick)} diff --git a/frontend/src/components/modals/custom-components/NewScenarioModalComponent.js b/frontend/src/components/modals/custom-components/NewScenarioModalComponent.js index 51116f59..d7d99982 100644 --- a/frontend/src/components/modals/custom-components/NewScenarioModalComponent.js +++ b/frontend/src/components/modals/custom-components/NewScenarioModalComponent.js @@ -19,7 +19,11 @@ class NewScenarioModalComponent extends React.Component { } componentDidUpdate() { - this.textInput.value = this.props.currentPortfolioScenarioIds.length === 0 ? 'Base scenario' : '' + if (this.props.currentPortfolioScenarioIds.length === 0) { + this.textInput.value = 'Base scenario' + } else if (this.textInput.value === 'Base scenario') { + this.textInput.value = '' + } } reset() { -- cgit v1.2.3