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 login = useSelector(s => s.login.publicKey);
|
||||||
const ev = dataEvent ?? Event.FromObject(data);
|
const ev = dataEvent ?? Event.FromObject(data);
|
||||||
const isMine = ev.PubKey === login;
|
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 = {
|
const options = {
|
||||||
showHeader: true,
|
showHeader: true,
|
||||||
@ -123,11 +125,11 @@ export default function Note(props) {
|
|||||||
<FontAwesomeIcon icon={faReply} />
|
<FontAwesomeIcon icon={faReply} />
|
||||||
</span>
|
</span>
|
||||||
<span className="pill" onClick={() => like()}>
|
<span className="pill" onClick={() => like()}>
|
||||||
<FontAwesomeIcon icon={faHeart} />
|
<FontAwesomeIcon color={liked ? "red" : "currentColor"} icon={faHeart} />
|
||||||
{likes}
|
{likes}
|
||||||
</span>
|
</span>
|
||||||
<span className="pill" onClick={() => dislike()}>
|
<span className="pill" onClick={() => dislike()}>
|
||||||
<FontAwesomeIcon icon={faThumbsDown} />
|
<FontAwesomeIcon color={disliked ? "orange" : "currentColor"} icon={faThumbsDown} />
|
||||||
{dislikes}
|
{dislikes}
|
||||||
</span>
|
</span>
|
||||||
<span className="pill" onClick={() => console.debug(ev)}>
|
<span className="pill" onClick={() => console.debug(ev)}>
|
||||||
|
Loading…
Reference in New Issue
Block a user