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

Display memo in payment flow #156

Closed
rolznz opened this issue Dec 14, 2023 · 3 comments · Fixed by #271
Closed

Display memo in payment flow #156

rolznz opened this issue Dec 14, 2023 · 3 comments · Fixed by #271
Labels
good first issue Good for newcomers

Comments

@rolznz
Copy link
Collaborator

rolznz commented Dec 14, 2023

In bc-send-payment we should show the memo from the invoice if there is one.

@rolznz rolznz added the good first issue Good for newcomers label Dec 14, 2023
@arnavkirti
Copy link
Contributor

Display Memo in Payment Flow

Issue

The payment flow wasn't displaying the memo/description from Lightning invoices, which contains important context about the payment.

Solution

Added memo display functionality to the bc-send-payment component by:

  1. Added a new render function for the memo:
private renderMemo(decodedInvoice: Invoice) {
  if (!decodedInvoice.description) {
    return null;
  }

  return html`
    <p class="text-center mb-6 ${classes['text-neutral-secondary']}">
      ${decodedInvoice.description}
    </p>
  `;
}
  1. Updated the main render method to include the memo display between the heading and payment state:
return html`
  <div class="flex flex-col justify-center items-center font-sans w-full">
    ${this.renderHeading(decodedInvoice)}
    ${this.renderMemo(decodedInvoice)}
    ${paymentStateElement}
  </div>
`;

Benefits

  • Users can now see what they're paying for directly in the payment flow
  • Memo is styled consistently with the rest of the UI
  • Only displays when a description exists in the invoice
  • Maintains the existing component's responsive design

The memo is displayed with secondary text styling to maintain visual hierarchy while providing additional context for the payment.

Should I make a PR for this?

@rolznz
Copy link
Collaborator Author

rolznz commented Feb 5, 2025

@arnavkirti that would be great, thank you!

arnavkirti added a commit to arnavkirti/bitcoin-connect that referenced this issue Feb 5, 2025
@arnavkirti
Copy link
Contributor

I have made a PR with changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants