Skip to content

Commit e537e1e

Browse files
committed
Show instructions for authenticated/not
If not authenticated, show login button If no annotation, show instruction box If annotation or edit-highight sequence has happened, show edit card
1 parent a34e3f3 commit e537e1e

File tree

1 file changed

+11
-13
lines changed

1 file changed

+11
-13
lines changed

src/app/content/highlights/components/EditCard.tsx

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -75,20 +75,18 @@ function LoginOrEdit({
7575
aria-label={formatMessage({id: 'i18n:highlighter:edit-note:label'})}
7676
>
7777
{
78-
(authenticated || props.shouldFocusCard || props.data?.annotation) ?
79-
<form
80-
ref={mergeRefs(fref, element)}
81-
data-analytics-region='edit-note'
82-
data-highlight-card
83-
>
84-
{authenticated ? (
85-
<ActiveEditCard props={props} element={element}
86-
/>
87-
) : (
88-
<LoginConfirmation onBlur={props.onBlur} />
89-
)}
90-
</form> :
78+
authenticated ? (
79+
(props.shouldFocusCard || props.data?.annotation) ? (
80+
<form
81+
ref={mergeRefs(fref, element)}
82+
data-analytics-region='edit-note'
83+
data-highlight-card
84+
>
85+
<ActiveEditCard props={props} element={element} />
86+
</form>
87+
) :
9188
<i>Press Enter or double-click highlight to edit highlight</i>
89+
) : <LoginConfirmation onBlur={props.onBlur} />
9290
}
9391
</div>
9492
);

0 commit comments

Comments
 (0)