diff options
| author | aidahosa1 <aisosa_idahosa@brown.edu> | 2024-09-17 09:29:33 -0400 |
|---|---|---|
| committer | aidahosa1 <aisosa_idahosa@brown.edu> | 2024-09-17 09:29:33 -0400 |
| commit | 1568898125218538a93666cf5d83b9cf01739b49 (patch) | |
| tree | 0c05f094cec54aeee2286548fc89080336004d90 /src/client/views/pdf/GPTPopup | |
| parent | 2b4288efa2f21db46addd19c8884f80dba835f2d (diff) | |
| parent | c36607691e0b7f5c04f3209a64958f5e51ddd785 (diff) | |
Merge branch 'master' into aisosa-starter
Diffstat (limited to 'src/client/views/pdf/GPTPopup')
| -rw-r--r-- | src/client/views/pdf/GPTPopup/GPTPopup.tsx | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/client/views/pdf/GPTPopup/GPTPopup.tsx b/src/client/views/pdf/GPTPopup/GPTPopup.tsx index 13196f06d..002e82332 100644 --- a/src/client/views/pdf/GPTPopup/GPTPopup.tsx +++ b/src/client/views/pdf/GPTPopup/GPTPopup.tsx @@ -1,4 +1,3 @@ -/* eslint-disable jsx-a11y/label-has-associated-control */ import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import { Button, IconButton, Type } from 'browndash-components'; import { action, makeObservable, observable } from 'mobx'; @@ -269,7 +268,7 @@ export class GPTPopup extends ObservableReactComponent<GPTPopupProps> { public addDoc: (doc: Doc | Doc[], sidebarKey?: string | undefined) => boolean = () => false; - public createFilteredDoc: (axes?: any) => boolean = () => false; + public createFilteredDoc: (axes?: string[]) => boolean = () => false; public addToCollection: ((doc: Doc | Doc[], annotationKey?: string | undefined) => boolean) | undefined; @observable quizRespText: string = '' @@ -439,7 +438,7 @@ export class GPTPopup extends ObservableReactComponent<GPTPopupProps> { * Transfers the image urls to actual image docs */ private transferToImage = (source: string) => { - const textAnchor = this.imgTargetDoc; + const textAnchor = this.textAnchor ?? this.imgTargetDoc; if (!textAnchor) return; const newDoc = Docs.Create.ImageDocument(source, { x: NumCast(textAnchor.x) + NumCast(textAnchor._width) + 10, @@ -641,8 +640,8 @@ export class GPTPopup extends ObservableReactComponent<GPTPopupProps> { <div style={{ display: 'flex', flexDirection: 'column', gap: '1rem' }}> {this.heading('GENERATED IMAGE')} <div className="image-content-wrapper"> - {this.imgUrls.map(rawSrc => ( - <div className="img-wrapper"> + {this.imgUrls.map((rawSrc, i) => ( + <div key={rawSrc[0] + i} className="img-wrapper"> <div className="img-container"> <img key={rawSrc[0]} src={rawSrc[0]} width={150} height={150} alt="dalle generation" /> </div> |
