From b7be194b34fa737b08cdd8be25cad92a9310402f Mon Sep 17 00:00:00 2001 From: Glen Wider Date: Mon, 3 May 2021 16:32:02 +0200 Subject: [PATCH] add dynamic ReplyEditor submit button text --- src/components/ReplyEditor.tsx | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/components/ReplyEditor.tsx b/src/components/ReplyEditor.tsx index 2aab91c..3efff72 100644 --- a/src/components/ReplyEditor.tsx +++ b/src/components/ReplyEditor.tsx @@ -47,6 +47,14 @@ const ReplyEditor: React.FC = ({ } } + const getSubmitButtonText = () => { + if(type === "Edit") + return "Edit" + else { + return "Add " + type + } + } + return (