fix(dashboard): summary section return fixes (#8770)
**What** - open receive Return if only one exists - fix double dashed divider --- FIXES CC-287 CC-361
This commit is contained in:
1 parent
571f0c7629
commit
979f7704ee
1 file changed
+32
-19
+32
-19
@@ -168,26 +168,39 @@ export const OrderSummarySection = ({ order }: OrderSummarySectionProps) => {
|
|||||||
<Total order={order} />
|
<Total order={order} />
|
||||||
|
|
||||||
{(showAllocateButton || showReturns || showPayment || showRefund) && (
|
{(showAllocateButton || showReturns || showPayment || showRefund) && (
|
||||||
<div className="bg-ui-bg-subtle flex items-center justify-end rounded-b-xl px-4 py-4 gap-x-2">
|
<div className="bg-ui-bg-subtle flex items-center justify-end gap-x-2 rounded-b-xl px-4 py-4">
|
||||||
{showReturns && (
|
{showReturns &&
|
||||||
<ButtonMenu
|
(returns.length === 1 ? (
|
||||||
groups={[
|
<Button
|
||||||
{
|
onClick={() =>
|
||||||
actions: returns.map((r) => ({
|
navigate(
|
||||||
label: t("orders.returns.receive.receive", {
|
`/orders/${order.id}/returns/${returns[0].id}/receive`
|
||||||
label: `#${r.id.slice(-7)}`,
|
)
|
||||||
}),
|
}
|
||||||
icon: <ArrowLongRight />,
|
variant="secondary"
|
||||||
to: `/orders/${order.id}/returns/${r.id}/receive`,
|
size="small"
|
||||||
})),
|
>
|
||||||
},
|
|
||||||
]}
|
|
||||||
>
|
|
||||||
<Button variant="secondary" size="small">
|
|
||||||
{t("orders.returns.receive.action")}
|
{t("orders.returns.receive.action")}
|
||||||
</Button>
|
</Button>
|
||||||
</ButtonMenu>
|
) : (
|
||||||
)}
|
<ButtonMenu
|
||||||
|
groups={[
|
||||||
|
{
|
||||||
|
actions: returns.map((r) => ({
|
||||||
|
label: t("orders.returns.receive.receive", {
|
||||||
|
label: `#${r.id.slice(-7)}`,
|
||||||
|
}),
|
||||||
|
icon: <ArrowLongRight />,
|
||||||
|
to: `/orders/${order.id}/returns/${r.id}/receive`,
|
||||||
|
})),
|
||||||
|
},
|
||||||
|
]}
|
||||||
|
>
|
||||||
|
<Button variant="secondary" size="small">
|
||||||
|
{t("orders.returns.receive.action")}
|
||||||
|
</Button>
|
||||||
|
</ButtonMenu>
|
||||||
|
))}
|
||||||
|
|
||||||
{showAllocateButton && (
|
{showAllocateButton && (
|
||||||
<Button
|
<Button
|
||||||
@@ -550,7 +563,7 @@ const ReturnBreakdown = ({
|
|||||||
item && (
|
item && (
|
||||||
<div
|
<div
|
||||||
key={orderReturn.id}
|
key={orderReturn.id}
|
||||||
className="txt-compact-small-plus text-ui-fg-subtle bg-ui-bg-subtle flex flex-row justify-between gap-y-2 border-b-2 border-t-2 border-dotted px-6 py-4"
|
className="txt-compact-small-plus text-ui-fg-subtle bg-ui-bg-subtle flex flex-row justify-between gap-y-2 border-t-2 border-dotted px-6 py-4"
|
||||||
>
|
>
|
||||||
<div className="flex items-center gap-2">
|
<div className="flex items-center gap-2">
|
||||||
<ArrowDownRightMini className="text-ui-fg-muted" />
|
<ArrowDownRightMini className="text-ui-fg-muted" />
|
||||||
|
|||||||
Reference in new issue
Block a user