diff --git a/products/statement-generator/src/components/Button.tsx b/products/statement-generator/src/components/Button.tsx index ee532097..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} + ); } 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;