forked from Kieran/snort
feat: highlight your reactions on notes
This commit is contained in:
parent
4680397e1a
commit
1c6176a397
@ -28,6 +28,8 @@ export default function Note(props) {
|
||||
const login = useSelector(s => s.login.publicKey);
|
||||
const ev = dataEvent ?? Event.FromObject(data);
|
||||
const isMine = ev.PubKey === login;
|
||||
const liked = reactions?.find(({ PubKey, Content }) => Content === "+" || Content === "🤙" && PubKey === login)
|
||||
const disliked = reactions?.find(({ PubKey, Content }) => Content === "+" && PubKey === login)
|
||||
|
||||
const options = {
|
||||
showHeader: true,
|
||||
@ -123,11 +125,11 @@ export default function Note(props) {
|
||||
<FontAwesomeIcon icon={faReply} />
|
||||
</span>
|
||||
<span className="pill" onClick={() => like()}>
|
||||
<FontAwesomeIcon icon={faHeart} />
|
||||
<FontAwesomeIcon color={liked ? "red" : "currentColor"} icon={faHeart} />
|
||||
{likes}
|
||||
</span>
|
||||
<span className="pill" onClick={() => dislike()}>
|
||||
<FontAwesomeIcon icon={faThumbsDown} />
|
||||
<FontAwesomeIcon color={disliked ? "orange" : "currentColor"} icon={faThumbsDown} />
|
||||
{dislikes}
|
||||
</span>
|
||||
<span className="pill" onClick={() => console.debug(ev)}>
|
||||
|
Loading…
Reference in New Issue
Block a user