From 5d5091d914855e49cbabc9650954d41449727e5b Mon Sep 17 00:00:00 2001 From: Mike Salvatore Date: Wed, 20 Jan 2021 15:34:33 -0500 Subject: [PATCH] ui: resize infection map when window resizes Fixes #150 --- .../ui/src/components/reactive-graph/ReactiveGraph.js | 10 ++++++---- .../monkey_island/cc/ui/src/styles/components/Map.scss | 6 ++++++ 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/monkey/monkey_island/cc/ui/src/components/reactive-graph/ReactiveGraph.js b/monkey/monkey_island/cc/ui/src/components/reactive-graph/ReactiveGraph.js index 3199385ba..8d8611eb6 100644 --- a/monkey/monkey_island/cc/ui/src/components/reactive-graph/ReactiveGraph.js +++ b/monkey/monkey_island/cc/ui/src/components/reactive-graph/ReactiveGraph.js @@ -12,12 +12,14 @@ class GraphWrapper extends React.Component { let newOptions = null; if(this.props.options !== undefined){ newOptions = this.props.options; - newOptions.height = this.props.containerHeight.toString() + 'px'; - newOptions.width = this.props.containerWidth.toString() + 'px'; } - return () + return ( +
+ +
+ ) } } -let ReactiveGraph = Dimensions()(GraphWrapper); +let ReactiveGraph = GraphWrapper; export {ReactiveGraph}; diff --git a/monkey/monkey_island/cc/ui/src/styles/components/Map.scss b/monkey/monkey_island/cc/ui/src/styles/components/Map.scss index f6d8ed192..169c61562 100644 --- a/monkey/monkey_island/cc/ui/src/styles/components/Map.scss +++ b/monkey/monkey_island/cc/ui/src/styles/components/Map.scss @@ -1,3 +1,9 @@ .map-window { position: relative; } + +.net-graph-wrapper { + height: calc(100% - 130px); + width: 100%; + padding-bottom: 10px; +}