updates on the dispatch page under active section
This commit is contained in:
@@ -3870,20 +3870,18 @@ const Dispatch = ({
|
||||
rider is focused (the focused-rider view shows that rider's stats), and
|
||||
also hidden in the Active view when there are no in-progress deliveries,
|
||||
so the empty state isn't topped by a "0 orders / 0 riders" header. */}
|
||||
{!focusedRider && !(isAllActiveView && activeDeliveryCount === 0) && (
|
||||
{!focusedRider && (
|
||||
<div className="sb-header">
|
||||
{!isAllActiveView && (
|
||||
<div className="sb-header-top">
|
||||
<div className="sb-header-title">
|
||||
<span className="sb-title-bar" aria-hidden="true" />
|
||||
<span className="sb-title-text">RIDER DISPATCH</span>
|
||||
</div>
|
||||
<span className="sb-header-scope" title={activeStats.label}>
|
||||
<span className="sb-scope-dot" />
|
||||
{activeStats.label}
|
||||
</span>
|
||||
<div className="sb-header-top">
|
||||
<div className="sb-header-title">
|
||||
<span className="sb-title-bar" aria-hidden="true" />
|
||||
<span className="sb-title-text">RIDER DISPATCH</span>
|
||||
</div>
|
||||
)}
|
||||
<span className="sb-header-scope" title={activeStats.label}>
|
||||
<span className="sb-scope-dot" />
|
||||
{activeStats.label}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div className="sb-header-tiles">
|
||||
<div className="sb-tile sb-tile-orders">
|
||||
@@ -3912,7 +3910,7 @@ const Dispatch = ({
|
||||
</div>
|
||||
*/}
|
||||
|
||||
{(focusedRider || focusedKitchen) ? (
|
||||
{((focusedRider && !isAllActiveView) || focusedKitchen) ? (
|
||||
<div id="route-detail">
|
||||
<button className="rd-back" onClick={() => { handleRiderFocus(null); setFocusedKitchen(null); }}>← Back to {focusedZone ? focusedZone.name : 'list'}</button>
|
||||
{focusedRider ? (
|
||||
@@ -3924,6 +3922,7 @@ const Dispatch = ({
|
||||
const activeOnly = isAllActiveView ? getActiveOrder(focusedRider.orders) : null;
|
||||
const panelOrders = isAllActiveView ? (activeOnly ? [activeOnly] : []) : focusedRider.orders;
|
||||
const totalKm = panelOrders.reduce((s, o) => s + parseFloat(o.actualkms || o.kms || 0), 0);
|
||||
const totalRiderKm = panelOrders.reduce((s, o) => s + parseFloat(o.riderkms || 0), 0);
|
||||
return (
|
||||
<div className="rd-stats-grid">
|
||||
<div className="rd-stat rd-stat-orders">
|
||||
@@ -3936,6 +3935,11 @@ const Dispatch = ({
|
||||
<div className="rd-stat-value">{totalKm.toFixed(1)}<span className="rd-stat-unit">km</span></div>
|
||||
<div className="rd-stat-label">Distance</div>
|
||||
</div>
|
||||
<div className="rd-stat rd-stat-riderkms">
|
||||
<div className="rd-stat-icon"><MdSpeed /></div>
|
||||
<div className="rd-stat-value">{totalRiderKm.toFixed(1)}<span className="rd-stat-unit">km</span></div>
|
||||
<div className="rd-stat-label">Rider KMs</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
})()}
|
||||
|
||||
Reference in New Issue
Block a user