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,7 +4,7 @@ import styles from './todoRow.module.css'
export default function TodoRow(props) {
const { categories, userId, onClick } = props
const { name, category, votes, id } = props.rowData
const { name, category, votes, id, group } = props.rowData
const voted = votes.includes(userId)
return (
@ -12,7 +12,10 @@ export default function TodoRow(props) {
onClick={() => {
onClick(props.rowData)
}}
className={`${styles.row} ${voted && styles.voted}`}
className={styles.row}
style={{
border: `2px solid ${group || '#99f'}`,
}}
>
<div className={styles.id}>{`#${id}`}</div>
<div className={styles.description}>{name}</div>
@ -30,7 +33,9 @@ export default function TodoRow(props) {
{categories[category].name}
</div>
</div>
<div className={styles.votes}>{`Votes: ${votes.length}`}</div>
<div
className={`${styles.votes} ${voted && styles.voted}`}
>{`Votes: ${votes.length}`}</div>
</div>
)
}