This commit is contained in:
2026-10-08 16:57:16 +05:30
parent 8960fb8ebb
commit f91044e61a
2 changed files with 18 additions and 20 deletions

View File

@@ -28,7 +28,14 @@ export function DeliverySlotsEditor({
slots,
onChange,
isDisabled,
/** Shown above the rows. Onboarding and the profile screen say different things. */
/**
* Shown above the rows, and only when a caller asks for it.
*
* No default: onboarding explains what a window is because it is new to the
* person reading, while the shop profile does not, because they are editing
* something they already set. A paragraph that cannot be turned off is one
* every screen has to live with.
*/
intro,
}: {
slots: DeliverySlot[];
@@ -50,12 +57,9 @@ export function DeliverySlotsEditor({
return (
<div>
<Note>
{intro ??
'Customers choose one of these when they order. A window takes orders right up until it ends — after that it disappears for the day and only the later windows are offered.'}
</Note>
{intro ? <Note>{intro}</Note> : null}
<div style={{ display: 'grid', gap: 2, marginTop: 12 }}>
<div style={{ display: 'grid', gap: 4, marginTop: 10 }}>
{ordered.map((slot) => (
<SlotRow
key={slot.slotkey}
@@ -103,8 +107,7 @@ function SlotRow({
display: 'flex',
alignItems: 'center',
gap: 10,
padding: '11px 0',
borderTop: '1px solid var(--color-line, #e0e4ea)',
padding: '7px 0',
// A window that is off stays legible but stops competing for attention.
opacity: isOff ? 0.55 : 1,
}}