mirror of
https://gitlab.com/MrFry/qmining-page
synced 2025-04-01 20:23:44 +02:00
Added todo table
This commit is contained in:
parent
1a982b69c9
commit
cbd6bf2baa
15 changed files with 608 additions and 157 deletions
48
src/components/todoStuff/todoCard.js
Normal file
48
src/components/todoStuff/todoCard.js
Normal file
|
@ -0,0 +1,48 @@
|
|||
import React from 'react'
|
||||
|
||||
import styles from './todoCard.module.css'
|
||||
|
||||
const clickableTypes = ['todo', 'blocked', 'inprogress', 'testing']
|
||||
|
||||
export default function TodoCard(props) {
|
||||
const { categories, type, onClick, userId } = props
|
||||
const { name, description, category, points, votes, id } = props.cardData
|
||||
const clickable = clickableTypes.includes(type)
|
||||
const voted = votes.includes(userId)
|
||||
|
||||
return (
|
||||
<div
|
||||
className={`${styles.card} ${clickable && styles.clickable} ${voted &&
|
||||
styles.voted}`}
|
||||
title={description}
|
||||
onClick={() => {
|
||||
if (clickable) {
|
||||
onClick(id)
|
||||
}
|
||||
}}
|
||||
>
|
||||
<div className={styles.description}>
|
||||
<span className={styles.id}>{`#${id}`}</span>
|
||||
{name}
|
||||
</div>
|
||||
<div className={styles.category}>
|
||||
<span
|
||||
style={{
|
||||
backgroundColor: categories[category].color,
|
||||
color: 'white',
|
||||
borderRadius: '2px',
|
||||
padding: '0px 2px',
|
||||
}}
|
||||
>
|
||||
{category}
|
||||
</span>
|
||||
</div>
|
||||
<div className={styles.numbers}>
|
||||
<div>
|
||||
<div>{`Votes: ${votes.length}`}</div>
|
||||
</div>
|
||||
<div>{points}</div>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue