aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/pdf/GPTPopup
diff options
context:
space:
mode:
authorSophie Zhang <sophie_zhang@brown.edu>2023-04-13 01:50:41 -0400
committerSophie Zhang <sophie_zhang@brown.edu>2023-04-13 01:50:41 -0400
commitcd30c14116bbbab16c21a7ecc31090d2b4bf413f (patch)
tree3373db680316825e3315b131e74028436bc742d7 /src/client/views/pdf/GPTPopup
parent65781ccf9a3f19578cf4a51bca65b35c05c0795b (diff)
cleaning
Diffstat (limited to 'src/client/views/pdf/GPTPopup')
-rw-r--r--src/client/views/pdf/GPTPopup/GPTPopup.scss4
-rw-r--r--src/client/views/pdf/GPTPopup/GPTPopup.tsx24
2 files changed, 15 insertions, 13 deletions
diff --git a/src/client/views/pdf/GPTPopup/GPTPopup.scss b/src/client/views/pdf/GPTPopup/GPTPopup.scss
index 50fbe5211..44413ede7 100644
--- a/src/client/views/pdf/GPTPopup/GPTPopup.scss
+++ b/src/client/views/pdf/GPTPopup/GPTPopup.scss
@@ -13,8 +13,8 @@ $highlightedText: #82e0ff;
box-shadow: 0 2px 5px #7474748d;
color: $textgrey;
position: fixed;
- bottom: 5px;
- right: 5px;
+ bottom: 10px;
+ right: 10px;
width: 250px;
min-height: 200px;
border-radius: 15px;
diff --git a/src/client/views/pdf/GPTPopup/GPTPopup.tsx b/src/client/views/pdf/GPTPopup/GPTPopup.tsx
index 91bc0a7ff..cc0072a94 100644
--- a/src/client/views/pdf/GPTPopup/GPTPopup.tsx
+++ b/src/client/views/pdf/GPTPopup/GPTPopup.tsx
@@ -127,17 +127,19 @@ export class GPTPopup extends React.Component<GPTPopupProps> {
editBox = () => {
const hr = this.props.highlightRange;
return (
- hr && (
- <>
- <div>
- {this.heading('TEXT EDIT SUGGESTIONS')}
- <div className="content-wrapper">
+ <>
+ <div>
+ {this.heading('TEXT EDIT SUGGESTIONS')}
+ <div className="content-wrapper">
+ {hr && (
<div>
{this.props.text.slice(0, hr[0])} <span className="highlighted-text">{this.props.text.slice(hr[0], hr[1])}</span> {this.props.text.slice(hr[1])}
</div>
- </div>
+ )}
</div>
- {!this.props.loading && (
+ </div>
+ {hr && !this.props.loading && (
+ <>
<div className="btns-wrapper">
<>
<button className="icon-btn" onPointerDown={e => this.props.callEditApi(e)}>
@@ -152,10 +154,10 @@ export class GPTPopup extends React.Component<GPTPopupProps> {
</button>
</>
</div>
- )}
- {this.aiWarning()}
- </>
- )
+ {this.aiWarning()}
+ </>
+ )}
+ </>
);
};