mirror of
https://github.com/omnivore-app/omnivore.git
synced 2026-03-11 08:54:26 +00:00
Simplify code to set custom highlight color
This commit is contained in:
parent
63b01ca2e6
commit
a0d4b1493a
1 changed files with 3 additions and 13 deletions
|
|
@ -67,20 +67,10 @@ function nodeAttributesFromHighlight(
|
|||
const patch = highlight.patch
|
||||
const id = highlight.id
|
||||
const withNote = !!highlight.annotation
|
||||
let customColor = undefined
|
||||
const tooltip = undefined
|
||||
// We've disabled shared highlights, so passing undefined
|
||||
// here now, and removing the user object from highlights
|
||||
// !highlight.createdByMe
|
||||
// ? stringToColour(highlight.user.profile.username)
|
||||
// : undefined
|
||||
// const tooltip = !highlight.createdByMe
|
||||
// ? `Created by: @${highlight.user.profile.username}`
|
||||
// : undefined
|
||||
|
||||
if (!highlight.createdByMe) {
|
||||
customColor = 'var(--colors-recommendedHighlightBackground)'
|
||||
}
|
||||
const customColor = highlight.createdByMe
|
||||
? undefined
|
||||
: 'var(--colors-recommendedHighlightBackground)'
|
||||
|
||||
return makeHighlightNodeAttributes(patch, id, withNote, customColor, tooltip)
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue