Skip to content

Commit

Permalink
show when no receipt by default
Browse files Browse the repository at this point in the history
  • Loading branch information
JulienR1 committed Jan 2, 2024
1 parent bbf3772 commit 02ce465
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions web/src/modules/transactions/detailed-transaction.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,13 @@ export const DetailedTransaction: Component<DetailedTransactionProps> = (props)
}
});

createEffect(() => {
const t = transaction();
if (t && t.receipt == null) {
receiptAccordionControls.setIsOpened(true);
}
});

const dashboardLocation = location.pathname.replace(/transactions\/\d+/, "").replace(/\/$/, "");

const transactionDetails = () => {
Expand Down Expand Up @@ -116,10 +123,7 @@ export const DetailedTransaction: Component<DetailedTransactionProps> = (props)
when={transaction()!.receipt}
fallback={<NoContent message="Aucun reçu n'est associé à cette transaction" />}
>
<div
class="relative mx-auto block max-w-[430px] overflow-hidden md:bg-red-500 lg:max-w-[800px]"
ref={setReceiptCardRef}
>
<div class="relative mx-auto block max-w-[430px] overflow-hidden lg:max-w-[800px]" ref={setReceiptCardRef}>
<A href={transaction()!.receipt!.url!} target="_blank">
<Show
when={transaction()!.receipt!.mime === "application/pdf"}
Expand Down

0 comments on commit 02ce465

Please sign in to comment.