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;
|
||||
}
|
||||
|
||||
.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 {
|
||||
margin: 0 0 $space-2;
|
||||
padding: 0;
|
||||
|
||||
@@ -281,9 +281,6 @@ export const OrderStatusView = ({
|
||||
refreshedExpiredItemIds.current.add(item.id)
|
||||
void router.invalidate()
|
||||
}, [status.items, now, router])
|
||||
const [expandedItemIds, setExpandedItemIds] = useState<ReadonlySet<number>>(
|
||||
new Set(),
|
||||
)
|
||||
const reduceMotion = useReducedMotion()
|
||||
const collapseTransition = reduceMotion
|
||||
? { duration: 0 }
|
||||
@@ -294,14 +291,6 @@ export const OrderStatusView = ({
|
||||
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 (
|
||||
orderItemId: number,
|
||||
action: () => Promise<void>,
|
||||
@@ -472,10 +461,9 @@ export const OrderStatusView = ({
|
||||
</p>
|
||||
)}
|
||||
<AnimatePresence initial={false}>
|
||||
{(!isSettled(item) || expandedItemIds.has(item.id)) && (
|
||||
{!isSettled(item) && (
|
||||
<motion.div
|
||||
key="timeline"
|
||||
id={`steps-${item.id}`}
|
||||
className={styles.timelineWrapper}
|
||||
initial={{ height: 0, opacity: 0 }}
|
||||
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>
|
||||
)}
|
||||
{item.etaSeconds !== null && (
|
||||
|
||||
Reference in New Issue
Block a user