Added groups

This commit is contained in:
mrfry 2020-12-21 10:59:16 +01:00
parent c09bb64b2a
commit bc776b3307
8 changed files with 94 additions and 14 deletions

View file

@ -4,12 +4,15 @@ import styles from './todoCard.module.css'
export default function TodoCard(props) {
const { categories, onClick, userId } = props
const { name, category, points, votes, id } = props.cardData
const { name, category, points, votes, id, group } = props.cardData
const voted = votes.includes(userId)
return (
<div
className={`${styles.card} ${voted && styles.voted}`}
className={styles.card}
style={{
border: `2px solid ${group || '#99f'}`,
}}
onClick={() => {
onClick(props.cardData)
}}
@ -31,7 +34,7 @@ export default function TodoCard(props) {
</span>
</div>
<div className={styles.numbers}>
<div>
<div className={`${voted && styles.voted}`}>
<div>{`Votes: ${votes.length}`}</div>
</div>
<div>{points}</div>