Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: add description to transaction modal, layout fixes #2867

Merged
merged 2 commits into from
Nov 19, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions src/app/components/TransactionsTable/TransactionModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,12 @@ export default function TransactionModal({
content={getFormattedSats(transaction.totalFees)}
/>
)}
{transaction.title && (
<TransactionDetailRow
title={tCommon("description")}
content={transaction.title}
/>
)}
{transaction.publisherLink && transaction.title && (
<TransactionDetailRow
title={tCommon("website")}
Expand Down Expand Up @@ -172,13 +178,13 @@ export default function TransactionModal({
}

const Dt = ({ children }: { children: React.ReactNode }) => (
<dt className="basis-28 text-gray-400 dark:text-neutral-500 text-right">
<dt className="w-28 text-gray-400 dark:text-neutral-500 text-right">
{children}
</dt>
);

const Dd = ({ children }: { children: React.ReactNode }) => (
<dd className="flex-1 text-gray-800 dark:text-neutral-200 break-all whitespace-pre-wrap">
<dd className="text-gray-800 dark:text-neutral-200 break-words whitespace-pre-wrap overflow-hidden">
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

break-words + overflow-hidden breaks long text "aaaaaaaaa...aaaaa" inside of words, but doesn't just break words in-between.

{children}
</dd>
);
Expand All @@ -190,7 +196,7 @@ const TransactionDetailRow = ({
title: React.ReactNode | string;
content: React.ReactNode | string;
}) => (
<div className="flex p-1 text-sm leading-5 space-x-3">
<div className="grid grid-cols-[auto,1fr] p-1 text-sm leading-5 space-x-3">
<Dt>{title}</Dt>
<Dd>{content}</Dd>
</div>
Expand Down
Loading