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:
Frane Polić authored and GitHub committed 2024-08-27 06:53:13 +00:00
1 parent 571f0c7629
commit 979f7704ee
1 file changed
+17 -4
@@ -168,8 +168,21 @@ 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 &&
(returns.length === 1 ? (
<Button
onClick={() =>
navigate(
`/orders/${order.id}/returns/${returns[0].id}/receive`
)
}
variant="secondary"
size="small"
>
{t("orders.returns.receive.action")}
</Button>
) : (
<ButtonMenu <ButtonMenu
groups={[ groups={[
{ {
@@ -187,7 +200,7 @@ export const OrderSummarySection = ({ order }: OrderSummarySectionProps) => {
{t("orders.returns.receive.action")} {t("orders.returns.receive.action")}
</Button> </Button>
</ButtonMenu> </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" />