{ number } diff --git a/bbb-learning-dashboard/src/components/StatusTable.jsx b/bbb-learning-dashboard/src/components/StatusTable.jsx index b8d501ae48..c9fa9ffe40 100644 --- a/bbb-learning-dashboard/src/components/StatusTable.jsx +++ b/bbb-learning-dashboard/src/components/StatusTable.jsx @@ -104,6 +104,61 @@ class StatusTable extends React.Component { const isRTL = document.dir === 'rtl'; + function makeLineThrough(userPeriod, period) { + const { registeredOn, leftOn } = userPeriod; + const boundaryLeft = period.start; + const boundaryRight = period.end; + const interval = period.end - period.start; + let roundedLeft = registeredOn >= boundaryLeft + && registeredOn <= boundaryRight ? 'rounded-l' : ''; + let roundedRight = leftOn >= boundaryLeft + && leftOn <= boundaryRight ? 'rounded-r' : ''; + let offsetLeft = 0; + let offsetRight = 0; + if (registeredOn >= boundaryLeft && registeredOn <= boundaryRight) { + offsetLeft = ((registeredOn - boundaryLeft) * 100) / interval; + } + if (leftOn >= boundaryLeft && leftOn <= boundaryRight) { + offsetRight = ((boundaryRight - leftOn) * 100) / interval; + } + let width = ''; + if (offsetLeft === 0 && offsetRight >= 99) { + width = 'w-1.5'; + } + if (offsetRight === 0 && offsetLeft >= 99) { + width = 'w-1.5'; + } + if (offsetLeft && offsetRight) { + const variation = offsetLeft - offsetRight; + if (variation > -1 && variation < 1) { + width = 'w-1.5'; + } + } + if (isRTL) { + const aux = roundedRight; + + if (roundedLeft !== '') roundedRight = 'rounded-r'; + else roundedRight = ''; + + if (aux !== '') roundedLeft = 'rounded-l'; + else roundedLeft = ''; + } + const redress = '(0.375rem / 2)'; + return ( +
+ ); + } + return (