Skip to content

Commit 0c78572

Browse files
committed
fix: render LN data on AllowanceView too
1 parent 30ac79a commit 0c78572

File tree

2 files changed

+16
-9
lines changed

2 files changed

+16
-9
lines changed

src/app/screens/Home/AllowanceView/index.tsx

+15-9
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,14 @@ import { FC, useState, useEffect } from "react";
1212
import { Trans, useTranslation } from "react-i18next";
1313
import { toast } from "react-toastify";
1414
import { useSettings } from "~/app/context/SettingsContext";
15-
import type { Allowance, Transaction } from "~/types";
15+
import { PublisherLnData } from "~/app/screens/Home/PublisherLnData";
16+
import type { Allowance, Transaction, Battery } from "~/types";
1617

1718
dayjs.extend(relativeTime);
1819

1920
type Props = {
2021
allowance: Allowance;
22+
lnDataFromCurrentTab?: Battery[];
2123
onGoBack: () => void;
2224
onEditComplete: () => void;
2325
onDeleteComplete: () => void;
@@ -91,14 +93,18 @@ const AllowanceView: FC<Props> = (props) => {
9193
/>
9294
}
9395
/>
94-
<div className="mx-4">
95-
<PublisherCard
96-
title={props.allowance.name}
97-
image={props.allowance.imageURL}
98-
isCard={true}
99-
isSmall={false}
100-
/>
101-
</div>
96+
{props.lnDataFromCurrentTab?.length ? (
97+
<PublisherLnData lnData={props.lnDataFromCurrentTab[0]} />
98+
) : (
99+
<div className="mx-4">
100+
<PublisherCard
101+
title={props.allowance.name}
102+
image={props.allowance.imageURL}
103+
isCard={true}
104+
isSmall={false}
105+
/>
106+
</div>
107+
)}
102108
<div className="px-4 pb-5">
103109
<div className="flex justify-between items-center py-3">
104110
<dl className="mb-0">

src/app/screens/Home/index.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ const Home: FC = () => {
8888
return (
8989
<AllowanceView
9090
allowance={allowance}
91+
lnDataFromCurrentTab={lnData}
9192
onGoBack={() => setAllowance(null)}
9293
onEditComplete={loadAllowance}
9394
onDeleteComplete={() => setAllowance(null)}

0 commit comments

Comments
 (0)