Skip to content

Commit

Permalink
fix: remove view button when in thread
Browse files Browse the repository at this point in the history
  • Loading branch information
jenniferarnesen committed Jun 23, 2023
1 parent 1af2137 commit d4583eb
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ const InterpretationThread = ({
onReplyIconClick={() => focusRef.current?.focus()}
onUpdated={() => onThreadUpdated(true)}
onDeleted={onInterpretationDeleted}
isThread={true}
/>
<div className={'comments'}>
{interpretation.comments.map((comment) => (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ export const InterpretationList = ({
onUpdated={refresh}
disabled={disabled}
appUrl={appUrl}
isThread={false}
/>
))}
</ol>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ export const Interpretation = ({
disabled,
onReplyIconClick,
appUrl,
isThread,
}) => {
const [isUpdateMode, setIsUpdateMode] = useState(false)
const [showSharingDialog, setShowSharingDialog] = useState(false)
Expand Down Expand Up @@ -72,28 +73,26 @@ export const Interpretation = ({
count={interpretation.comments.length}
dataTest="interpretation-reply-button"
/>
{appUrl && !isThread && (
<MessageIconButton
tooltipContent={i18n.t('See interpretation')}
iconComponent={IconView16}
onClick={() => onReplyIconClick(interpretation.id)}
dataTest="interpretation-view-button"
/>
)}
{appUrl && (
<>
<MessageIconButton
tooltipContent={i18n.t('See interpretation')}
iconComponent={IconView16}
onClick={() =>
onReplyIconClick(interpretation.id)
}
dataTest="interpretation-view-button"
/>
<MessageIconButton
tooltipContent={i18n.t('Open in app')}
iconComponent={IconLaunch16}
onClick={() =>
window.open(
`${appUrl}?interpretationId=${interpretation.id}`,
'_blank'
)
}
dataTest="interpretation-launch-in-app-button"
/>
</>
<MessageIconButton
tooltipContent={i18n.t('Open in app')}
iconComponent={IconLaunch16}
onClick={() =>
window.open(
`${appUrl}?interpretationId=${interpretation.id}`,
'_blank'
)
}
dataTest="interpretation-launch-in-app-button"
/>
)}
{interpretation.access.manage && (
<MessageIconButton
Expand Down Expand Up @@ -151,5 +150,6 @@ Interpretation.propTypes = {
onUpdated: PropTypes.func.isRequired,
appUrl: PropTypes.string,
disabled: PropTypes.bool,
isThread: PropTypes.bool,
onClick: PropTypes.func,
}

0 comments on commit d4583eb

Please sign in to comment.