v2 lazy rundown (#317)

* chore: update related deps

* refactor: memoise entrypoints

* refactor: store selectors

* refactor: improve component performance

* chore: remove unused dependencies

* refactor: improve component dnd
This commit is contained in:
Carlos Valente
2023-03-30 21:22:36 +02:00
committed by GitHub
parent 03d5389540
commit 9338a615d4
27 changed files with 701 additions and 698 deletions
@@ -148,7 +148,7 @@ export default function OntimeTable({ tableData, userFields, selectedId, handleU
if (el) {
el.scrollIntoView({
behavior: 'smooth',
block: 'center',
block: 'start',
inline: 'nearest',
});
}
@@ -13,22 +13,15 @@ export default function SortableCell({ column }) {
id: column.id,
});
// prevent scaling on drag
const cssTransform = {
...transform,
scaleX: 1,
scaleY: 1,
}
// build drag styles
const dragStyle = {
transform: CSS.Transform.toString(cssTransform),
transition,
...style,
transform: CSS.Translate.toString(transform),
transition,
};
return (
<th {...restColumn} ref={setNodeRef} style={{...dragStyle}} className={isDragging ? styles.dragging: ''}>
<th {...restColumn} ref={setNodeRef} style={dragStyle} className={isDragging ? styles.dragging : ''}>
<div {...attributes} {...listeners}>
<Tooltip label={column.Header} openDelay={tooltipDelayFast}>
{column.render('Header')}