From d4583eb327ecce4f5521f651de24164a455e5103 Mon Sep 17 00:00:00 2001 From: Jen Jones Arnesen Date: Fri, 23 Jun 2023 11:53:40 +0200 Subject: [PATCH] fix: remove view button when in thread --- .../InterpretationThread.js | 1 + .../InterpretationsUnit/InterpretationList.js | 1 + .../common/Interpretation/Interpretation.js | 42 +++++++++---------- 3 files changed, 23 insertions(+), 21 deletions(-) diff --git a/src/components/Interpretations/InterpretationModal/InterpretationThread.js b/src/components/Interpretations/InterpretationModal/InterpretationThread.js index f9e051f06..b890ecc6c 100644 --- a/src/components/Interpretations/InterpretationModal/InterpretationThread.js +++ b/src/components/Interpretations/InterpretationModal/InterpretationThread.js @@ -50,6 +50,7 @@ const InterpretationThread = ({ onReplyIconClick={() => focusRef.current?.focus()} onUpdated={() => onThreadUpdated(true)} onDeleted={onInterpretationDeleted} + isThread={true} />
{interpretation.comments.map((comment) => ( diff --git a/src/components/Interpretations/InterpretationsUnit/InterpretationList.js b/src/components/Interpretations/InterpretationsUnit/InterpretationList.js index 268112ad7..58a07c34f 100644 --- a/src/components/Interpretations/InterpretationsUnit/InterpretationList.js +++ b/src/components/Interpretations/InterpretationsUnit/InterpretationList.js @@ -71,6 +71,7 @@ export const InterpretationList = ({ onUpdated={refresh} disabled={disabled} appUrl={appUrl} + isThread={false} /> ))} diff --git a/src/components/Interpretations/common/Interpretation/Interpretation.js b/src/components/Interpretations/common/Interpretation/Interpretation.js index 6791a8907..4146fb50a 100644 --- a/src/components/Interpretations/common/Interpretation/Interpretation.js +++ b/src/components/Interpretations/common/Interpretation/Interpretation.js @@ -25,6 +25,7 @@ export const Interpretation = ({ disabled, onReplyIconClick, appUrl, + isThread, }) => { const [isUpdateMode, setIsUpdateMode] = useState(false) const [showSharingDialog, setShowSharingDialog] = useState(false) @@ -72,28 +73,26 @@ export const Interpretation = ({ count={interpretation.comments.length} dataTest="interpretation-reply-button" /> + {appUrl && !isThread && ( + onReplyIconClick(interpretation.id)} + dataTest="interpretation-view-button" + /> + )} {appUrl && ( - <> - - onReplyIconClick(interpretation.id) - } - dataTest="interpretation-view-button" - /> - - window.open( - `${appUrl}?interpretationId=${interpretation.id}`, - '_blank' - ) - } - dataTest="interpretation-launch-in-app-button" - /> - + + window.open( + `${appUrl}?interpretationId=${interpretation.id}`, + '_blank' + ) + } + dataTest="interpretation-launch-in-app-button" + /> )} {interpretation.access.manage && (