From 7e72c17ba037b4b18afe04c23cca5cae648df780 Mon Sep 17 00:00:00 2001 From: kaloster Date: Tue, 22 Oct 2024 17:38:46 -0400 Subject: [PATCH] fix: secondary input --- .../src/components/AnnoDialog/AnnoDialog.tsx | 51 ++++++++++++------- client/src/components/AnnoDialog/types.ts | 2 + .../EditGenesetNameDialogue.tsx | 2 +- .../AddGeneToGenesetDialogue.tsx | 2 +- 4 files changed, 37 insertions(+), 20 deletions(-) diff --git a/client/src/components/AnnoDialog/AnnoDialog.tsx b/client/src/components/AnnoDialog/AnnoDialog.tsx index a67fbaaad..08b6f45e3 100644 --- a/client/src/components/AnnoDialog/AnnoDialog.tsx +++ b/client/src/components/AnnoDialog/AnnoDialog.tsx @@ -3,24 +3,25 @@ import { Button, Dialog, Classes, Tooltip } from "@blueprintjs/core"; import { AnnoDialogProps } from "./types"; import { DialogBody, DialogForm, ErrorText, SecondaryText } from "./style"; -export function AnnoDialog(props: AnnoDialogProps): JSX.Element { - const { - isActive, - text, - title, - instruction, - cancelTooltipContent, - errorMessage, - validationError, - annoInput, - secondaryInstructions, - secondaryInput, - handleCancel, - handleSubmit, - primaryButtonText, - primaryButtonProps, - inputProps, - } = props; +function AnnoDialog({ + isActive, + text, + title, + instruction, + cancelTooltipContent, + errorMessage, + validationError, + annoInput, + secondaryInstructions, + secondaryInput, + handleCancel, + handleSubmit, + primaryButtonText, + secondaryButtonText, + handleSecondaryButtonSubmit, + primaryButtonProps, + inputProps, +}: AnnoDialogProps): JSX.Element { return ( {errorMessage} + {/* we might rename, secondary button and secondary input are not related */} {secondaryInstructions && ( {secondaryInstructions} @@ -46,6 +48,17 @@ export function AnnoDialog(props: AnnoDialogProps): JSX.Element { + {/* we might rename, secondary button and secondary input are not related */} + {handleSecondaryButtonSubmit && secondaryButtonText ? ( + + ) : null}