mirror of
https://gitlab.com/MrFry/qmining-page
synced 2025-04-01 20:23:44 +02:00
Todo table scroll, clickable columns now stored in server
This commit is contained in:
parent
50e8fd271a
commit
c68a445117
3 changed files with 19 additions and 4 deletions
|
@ -2,10 +2,8 @@ import React from 'react'
|
||||||
|
|
||||||
import styles from './todoCard.module.css'
|
import styles from './todoCard.module.css'
|
||||||
|
|
||||||
const clickableTypes = ['todo', 'blocked', 'inprogress', 'testing']
|
|
||||||
|
|
||||||
export default function TodoCard(props) {
|
export default function TodoCard(props) {
|
||||||
const { categories, type, onClick, userId } = props
|
const { categories, type, onClick, userId, clickableTypes } = props
|
||||||
const { name, description, category, points, votes, id } = props.cardData
|
const { name, description, category, points, votes, id } = props.cardData
|
||||||
const clickable = clickableTypes.includes(type)
|
const clickable = clickableTypes.includes(type)
|
||||||
const voted = votes.includes(userId)
|
const voted = votes.includes(userId)
|
||||||
|
|
|
@ -53,7 +53,7 @@ export default function TodoTable() {
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div>
|
<div className={styles.tableContainer}>
|
||||||
<div className={styles.table}>
|
<div className={styles.table}>
|
||||||
{Object.keys(columns).map((key) => {
|
{Object.keys(columns).map((key) => {
|
||||||
const category = columns[key]
|
const category = columns[key]
|
||||||
|
@ -70,6 +70,16 @@ export default function TodoTable() {
|
||||||
userId={userId}
|
userId={userId}
|
||||||
categories={categories}
|
categories={categories}
|
||||||
onClick={onCardClick}
|
onClick={onCardClick}
|
||||||
|
clickableTypes={Object.keys(columns).reduce(
|
||||||
|
(acc, key) => {
|
||||||
|
const col = columns[key]
|
||||||
|
if (col.clickable) {
|
||||||
|
acc.push(key)
|
||||||
|
}
|
||||||
|
return acc
|
||||||
|
},
|
||||||
|
[]
|
||||||
|
)}
|
||||||
/>
|
/>
|
||||||
)
|
)
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
.table {
|
.table {
|
||||||
display: flex;
|
display: flex;
|
||||||
|
min-width: 800px;
|
||||||
|
max-height: 600px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.categoryName {
|
.categoryName {
|
||||||
|
@ -14,3 +16,8 @@
|
||||||
.tableCol {
|
.tableCol {
|
||||||
flex: 1;
|
flex: 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.tableContainer {
|
||||||
|
overflow-x: scroll;
|
||||||
|
overflow-y: scroll;
|
||||||
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue