Remove the Steps toggle from cancelled order items
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -191,20 +191,6 @@
|
|||||||
margin: 0 0 $space-2;
|
margin: 0 0 $space-2;
|
||||||
}
|
}
|
||||||
|
|
||||||
.stepsToggle {
|
|
||||||
padding: 0;
|
|
||||||
border: none;
|
|
||||||
background: none;
|
|
||||||
color: $color-text-muted;
|
|
||||||
font-size: 0.85rem;
|
|
||||||
text-decoration: underline;
|
|
||||||
cursor: pointer;
|
|
||||||
|
|
||||||
&:hover {
|
|
||||||
color: $color-primary;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.timeline {
|
.timeline {
|
||||||
margin: 0 0 $space-2;
|
margin: 0 0 $space-2;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
|
|||||||
@@ -281,9 +281,6 @@ export const OrderStatusView = ({
|
|||||||
refreshedExpiredItemIds.current.add(item.id)
|
refreshedExpiredItemIds.current.add(item.id)
|
||||||
void router.invalidate()
|
void router.invalidate()
|
||||||
}, [status.items, now, router])
|
}, [status.items, now, router])
|
||||||
const [expandedItemIds, setExpandedItemIds] = useState<ReadonlySet<number>>(
|
|
||||||
new Set(),
|
|
||||||
)
|
|
||||||
const reduceMotion = useReducedMotion()
|
const reduceMotion = useReducedMotion()
|
||||||
const collapseTransition = reduceMotion
|
const collapseTransition = reduceMotion
|
||||||
? { duration: 0 }
|
? { duration: 0 }
|
||||||
@@ -294,14 +291,6 @@ export const OrderStatusView = ({
|
|||||||
void navigate({ to: '/basket' })
|
void navigate({ to: '/basket' })
|
||||||
}
|
}
|
||||||
|
|
||||||
const toggleSteps = (orderItemId: number) => {
|
|
||||||
setExpandedItemIds((current) => {
|
|
||||||
const next = new Set(current)
|
|
||||||
if (!next.delete(orderItemId)) next.add(orderItemId)
|
|
||||||
return next
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
const runAction = async (
|
const runAction = async (
|
||||||
orderItemId: number,
|
orderItemId: number,
|
||||||
action: () => Promise<void>,
|
action: () => Promise<void>,
|
||||||
@@ -472,10 +461,9 @@ export const OrderStatusView = ({
|
|||||||
</p>
|
</p>
|
||||||
)}
|
)}
|
||||||
<AnimatePresence initial={false}>
|
<AnimatePresence initial={false}>
|
||||||
{(!isSettled(item) || expandedItemIds.has(item.id)) && (
|
{!isSettled(item) && (
|
||||||
<motion.div
|
<motion.div
|
||||||
key="timeline"
|
key="timeline"
|
||||||
id={`steps-${item.id}`}
|
|
||||||
className={styles.timelineWrapper}
|
className={styles.timelineWrapper}
|
||||||
initial={{ height: 0, opacity: 0 }}
|
initial={{ height: 0, opacity: 0 }}
|
||||||
animate={{ height: 'auto', opacity: 1 }}
|
animate={{ height: 'auto', opacity: 1 }}
|
||||||
@@ -529,17 +517,6 @@ export const OrderStatusView = ({
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
{item.status === 'cancelled' && (
|
|
||||||
<button
|
|
||||||
type="button"
|
|
||||||
className={styles.stepsToggle}
|
|
||||||
aria-expanded={expandedItemIds.has(item.id)}
|
|
||||||
aria-controls={`steps-${item.id}`}
|
|
||||||
onClick={() => toggleSteps(item.id)}
|
|
||||||
>
|
|
||||||
{expandedItemIds.has(item.id) ? 'Hide' : 'Steps'}
|
|
||||||
</button>
|
|
||||||
)}
|
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
{item.etaSeconds !== null && (
|
{item.etaSeconds !== null && (
|
||||||
|
|||||||
Reference in New Issue
Block a user