diff options
| author | Sophie Zhang <sophie_zhang@brown.edu> | 2024-01-31 00:12:55 -0500 |
|---|---|---|
| committer | Sophie Zhang <sophie_zhang@brown.edu> | 2024-01-31 00:12:55 -0500 |
| commit | 7082d37c07575afe29818c3a286e9b981e8bc307 (patch) | |
| tree | b668880ac7570f2d5ceb620da5d0f9d148cb0035 /src/client/views/nodes/trails/PresBox.tsx | |
| parent | e9dddc1ddadcaf3333ce95a2009c94f42e0152d4 (diff) | |
fix: got styling to work again
Diffstat (limited to 'src/client/views/nodes/trails/PresBox.tsx')
| -rw-r--r-- | src/client/views/nodes/trails/PresBox.tsx | 33 |
1 files changed, 21 insertions, 12 deletions
diff --git a/src/client/views/nodes/trails/PresBox.tsx b/src/client/views/nodes/trails/PresBox.tsx index b2059b185..b8b60d2a9 100644 --- a/src/client/views/nodes/trails/PresBox.tsx +++ b/src/client/views/nodes/trails/PresBox.tsx @@ -37,6 +37,12 @@ import { ScriptingBox } from '../ScriptingBox'; import './PresBox.scss'; import ReactLoading from 'react-loading'; import { PresEffect, PresEffectDirection, PresMovement, PresStatus } from './PresEnums'; +import ReactTextareaAutosize from 'react-textarea-autosize'; +import { IconButton, Type } from 'browndash-components'; +import { BiMicrophone, BiX } from 'react-icons/bi'; +import { AiOutlineSend } from 'react-icons/ai'; +import { gptTrailSlideCustomization } from '../../../apis/gpt/customization'; +import { DictationManager } from '../../../util/DictationManager'; export interface pinDataTypes { scrollable?: boolean; dataviz?: number[]; @@ -300,22 +306,24 @@ export class PresBox extends ViewBoxBaseComponent<FieldViewProps>() { @action customizeWithGPT = async (input: string) => { + console.log(this.slideToModify); // const testInput = 'change title to Customized Slide, transition for 2.3s with fade in effect'; - if (!this.slideToModify) return; + // if (!this.slideToModify) return; this.setIsRecording(false); this.setIsLoading(true); try { const res = await gptTrailSlideCustomization(input); - if (typeof res === 'string') { - const resObj = JSON.parse(res); - console.log('Result ', resObj); - // this.activeItem - for (let key in resObj) { - if (resObj[key]) { - this.slideToModify[key] = resObj[key]; - } - } - } + console.log('slide result', res); + // if (typeof res === 'string') { + // const resObj = JSON.parse(res); + // console.log('Result ', resObj); + // // this.activeItem + // for (let key in resObj) { + // if (resObj[key]) { + // this.slideToModify[key] = resObj[key]; + // } + // } + // } } catch (err) { console.error(err); } @@ -828,6 +836,7 @@ export class PresBox extends ViewBoxBaseComponent<FieldViewProps>() { */ navigateToActiveItem = (afterNav?: () => void) => { const activeItem: Doc = this.activeItem; + console.log('active item', activeItem); // GPT update this.slideToModify = activeItem; const targetDoc: Doc = this.targetDoc; @@ -2749,7 +2758,7 @@ export class PresBox extends ViewBoxBaseComponent<FieldViewProps>() { /> )} </div> - <TextareaAutosize + <ReactTextareaAutosize ref={r => (this._inputref = r)} minRows={3} placeholder="Customize..." |
