Removed reaction sorting

This commit is contained in:
mrfry 2021-05-11 14:27:25 +02:00
parent 933b453498
commit 2ab3915448

View file

@ -25,32 +25,26 @@ function ExistingReacts({ existingReacts, onClick, uid }) {
<div className={styles.reactionContainer}> <div className={styles.reactionContainer}>
<div className={styles.react_bttn}>Reakció</div> <div className={styles.react_bttn}>Reakció</div>
{existingReacts && {existingReacts &&
Object.keys(existingReacts) Object.keys(existingReacts).map((key) => {
.sort((akey, bkey) => { const currReact = existingReacts[key]
const a = existingReacts[akey] const react = reactions[key]
const b = existingReacts[bkey] if (!react) {
return a.length < b.length return null
}) }
.map((key) => { return (
const currReact = existingReacts[key] <div
const react = reactions[key] title={`'${key}': ${currReact.join(', ')}`}
if (!react) { className={`${currReact.includes(uid) && styles.reacted}`}
return null key={key}
} onClick={(e) => {
return ( e.stopPropagation()
<div onClick(key, currReact.includes(uid))
title={`'${key}': ${currReact.join(', ')}`} }}
className={`${currReact.includes(uid) && styles.reacted}`} >
key={key} {react.emoji} {currReact.length}
onClick={(e) => { </div>
e.stopPropagation() )
onClick(key, currReact.includes(uid)) })}
}}
>
{react.emoji} {currReact.length}
</div>
)
})}
</div> </div>
) )
} }