From 823111b2707b0be052e5ae0698a83758773e90ab Mon Sep 17 00:00:00 2001 From: Nicholas King Date: Tue, 25 May 2021 16:44:11 -0700 Subject: [PATCH 1/3] Make the columns scroll separately --- frontend/MainContainer.tsx | 16 +++++++++++++--- frontend/app.css | 14 ++++++++++++++ frontend/components/TextDetailedAnalysis.tsx | 6 +++--- frontend/components/TextGenerationControl.tsx | 6 ++++-- frontend/components/TextGenerationResults.tsx | 4 +++- 5 files changed, 37 insertions(+), 9 deletions(-) diff --git a/frontend/MainContainer.tsx b/frontend/MainContainer.tsx index 5f92678..33091b2 100644 --- a/frontend/MainContainer.tsx +++ b/frontend/MainContainer.tsx @@ -1,4 +1,4 @@ -import React, { useState } from "react"; +import React, { useEffect, useState } from "react"; import { bindActionCreators } from "redux"; import { connect } from 'react-redux'; import { @@ -36,6 +36,8 @@ const Container: React.FunctionComponent = ({ generateText, selectText }) => { + const [isFolded, setIsFolded] = useState(false); + const getDetailedAnalysisComponent = () => { if (selectedTextIds.length == 0) { return (); @@ -47,10 +49,18 @@ const Container: React.FunctionComponent = ({ } } + useEffect(() => { + const form = document.getElementById("text_gen_form"); + const grid = document.getElementById("two_column_grid"); + if (grid) { + grid.style.height = `calc(93.5vh - ${form?.offsetHeight}px)` + } + }) + return (
- -
+ setIsFolded(!isFolded)} /> +
{ +class TextDetailedAnalysis extends React.Component { constructor(props) { super(props); @@ -20,7 +20,7 @@ class TextGenerationResults extends React.Component +

Toxicity Analysis

{ + this.props.onFold(); this.setState({ isFolded: !this.state.isFolded }); @@ -131,7 +133,7 @@ class TextGenerationControl extends React.Component< const textFieldStyle = {root: {width: "110px", display: "inline-block"}}; if (this.state.isFolded) { return ( -
+
+

Generated Results

)} +
); } From ef7979a815458df23b1d4997778c9332b7829384 Mon Sep 17 00:00:00 2001 From: Nicholas King Date: Tue, 25 May 2021 16:49:22 -0700 Subject: [PATCH 2/3] Tweak bar chart border color --- frontend/components/TextGenerationResults.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/components/TextGenerationResults.tsx b/frontend/components/TextGenerationResults.tsx index 0432f50..4cc0812 100644 --- a/frontend/components/TextGenerationResults.tsx +++ b/frontend/components/TextGenerationResults.tsx @@ -95,7 +95,7 @@ class TextGenerationResults extends React.Component {item.id}
-
+