From 0c29f4af63e98c18afe8d8e1362916a23d5158eb Mon Sep 17 00:00:00 2001 From: Sydney Walcoff Date: Wed, 9 Oct 2024 10:26:29 -0700 Subject: [PATCH 1/3] fix lint error and return text to buttons --- products/statement-generator/src/components/Button.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/products/statement-generator/src/components/Button.tsx b/products/statement-generator/src/components/Button.tsx index ee532097..52966c96 100644 --- a/products/statement-generator/src/components/Button.tsx +++ b/products/statement-generator/src/components/Button.tsx @@ -204,7 +204,7 @@ export function LinkButtonComponent({ className={`${classes.root} ${className}`} to={to!} data-testid={dataTestId} - /> + >{buttonText} ); } From 7b4310c52f35c9a862a88ba8295dd30537e962c0 Mon Sep 17 00:00:00 2001 From: Sydney Walcoff Date: Wed, 9 Oct 2024 10:35:11 -0700 Subject: [PATCH 2/3] jk this one has the button text --- products/statement-generator/src/components/Button.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/products/statement-generator/src/components/Button.tsx b/products/statement-generator/src/components/Button.tsx index 52966c96..b524044c 100644 --- a/products/statement-generator/src/components/Button.tsx +++ b/products/statement-generator/src/components/Button.tsx @@ -204,7 +204,9 @@ export function LinkButtonComponent({ className={`${classes.root} ${className}`} to={to!} data-testid={dataTestId} - >{buttonText} + > + {buttonText} + ); } From d544cd46e80e906891d1f7cfdcc055be71d278a0 Mon Sep 17 00:00:00 2001 From: Sydney Walcoff Date: Wed, 9 Oct 2024 11:24:51 -0700 Subject: [PATCH 3/3] resolve build error --- .../src/components/TextPreview.tsx | 108 +++++++++--------- 1 file changed, 55 insertions(+), 53 deletions(-) diff --git a/products/statement-generator/src/components/TextPreview.tsx b/products/statement-generator/src/components/TextPreview.tsx index c7e28731..7d5f3677 100644 --- a/products/statement-generator/src/components/TextPreview.tsx +++ b/products/statement-generator/src/components/TextPreview.tsx @@ -1,4 +1,4 @@ -import React, { forwardRef, useState, useRef, useEffect } from 'react'; +import React, { useState, useRef, useEffect } from 'react'; import { makeStyles, createStyles } from '@material-ui/core'; import CreateIcon from '@material-ui/icons/Create'; @@ -58,63 +58,65 @@ interface ComponentProps { isFirstPreview?: boolean; } -const TextPreview = forwardRef( - ( - { onSaveClick, content, nameOfStep, className = '', style, isFirstPreview }, - ref - ) => { - const classes = useStyles(); - const utilityClasses = useUtilityStyles(); - const [isEditing, setIsEditing] = useState(false); - const editButtonRef = useRef(null); - const previewContainerRef = useRef(null); +const TextPreview = ({ + onSaveClick, + content, + nameOfStep, + className = '', + style, + isFirstPreview, +}: ComponentProps) => { + const classes = useStyles(); + const utilityClasses = useUtilityStyles(); + const [isEditing, setIsEditing] = useState(false); + const editButtonRef = useRef(null); + const previewContainerRef = useRef(null); - const handleClick = () => { - setIsEditing(true); - }; + const handleClick = () => { + setIsEditing(true); + }; - useEffect(() => { - if (isFirstPreview && previewContainerRef.current) { - previewContainerRef.current.focus(); - } - }, [isFirstPreview]); + useEffect(() => { + if (isFirstPreview && previewContainerRef.current) { + previewContainerRef.current.focus(); + } + }, [isFirstPreview]); - return ( -
-
-

{nameOfStep}

+ return ( +
+
+

{nameOfStep}

-
- {!isEditing && ( - - )} -
+
+ {!isEditing && ( + + )}
- - {isEditing ? ( - - ) : ( -

{content}

- )}
- ); - } -); + + {isEditing ? ( + + ) : ( +

{content}

+ )} +
+ ); +}; export default TextPreview;