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

feat: transaction list revamp #2744

Merged
merged 50 commits into from
Nov 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
61e979e
feat: new transaction list
reneaaron Sep 8, 2023
598e356
fix: remove unused badges
reneaaron Sep 8, 2023
034afdb
fix: detail view
reneaaron Sep 8, 2023
ae79520
modify transaction list heading and align it to center at all places
pavanjoshi914 Sep 20, 2023
b61b914
feat: unify transaction list
pavanjoshi914 Sep 21, 2023
62b00ab
feat: redesign sats showcase
pavanjoshi914 Sep 21, 2023
95ec2b0
feat: keep sats word in the currencty converter itself
pavanjoshi914 Sep 22, 2023
b96acbc
feat: add payment hash in transaction model
pavanjoshi914 Sep 25, 2023
5e617df
feat: add show more button
pavanjoshi914 Sep 26, 2023
80a5490
feat: add boostagram details
pavanjoshi914 Sep 26, 2023
314febc
feat: cleanup regex keep same color for now
pavanjoshi914 Sep 26, 2023
ce2980e
chore: resolve conflict
pavanjoshi914 Sep 26, 2023
21df7e3
feat: refactor transaction modal
pavanjoshi914 Sep 27, 2023
2ba13e2
Merge remote-tracking branch 'upstream/master' into feat/transaction-…
pavanjoshi914 Oct 3, 2023
3092cf4
feat: add getTransactions Method
pavanjoshi914 Oct 3, 2023
ef18f75
chore: some improvements
pavanjoshi914 Oct 3, 2023
045a494
Merge remote-tracking branch 'upstream/master' into feat/transaction-…
pavanjoshi914 Oct 4, 2023
4cd5951
chore: proper error handling
pavanjoshi914 Oct 4, 2023
fa27b14
feat: add strokes to the icons
pavanjoshi914 Oct 4, 2023
f5dd239
fix: style improvements
reneaaron Oct 4, 2023
7688615
fix: spacing improvements
reneaaron Oct 9, 2023
4a1eed4
fix: translations & layout improvements
reneaaron Oct 11, 2023
db98c00
fix: translations
reneaaron Oct 11, 2023
e3d799f
Merge branch 'master' into feat/transaction-list
reneaaron Oct 11, 2023
ce6fdad
fix: modal usage, remove headings
reneaaron Oct 11, 2023
f757e35
fix: modal & colors
reneaaron Oct 12, 2023
bf48967
fix: cleanup modal
reneaaron Oct 12, 2023
45c3a4b
Merge remote-tracking branch 'upstream/master' into feat/transaction-…
pavanjoshi914 Oct 17, 2023
221e505
Merge branch 'feat/transaction-list' of https://github.com/getAlby/li…
pavanjoshi914 Oct 17, 2023
65ff245
feat: use new invoices method to fetch all transactions at once
pavanjoshi914 Oct 17, 2023
2a6543a
feat: implement getTransactions method for
pavanjoshi914 Oct 25, 2023
0290101
feat: lnbits get transactions method
pavanjoshi914 Oct 25, 2023
d30059a
feat: cleanup useTransactions hook
pavanjoshi914 Oct 26, 2023
20bf68a
chore: cleanup unused var
pavanjoshi914 Oct 26, 2023
e4b34b6
Merge remote-tracking branch 'upstream/master' into feat/transaction-…
pavanjoshi914 Oct 27, 2023
3aea615
Merge branch 'master' into feat/transaction-list
reneaaron Oct 30, 2023
393c553
fix: break long content w/o whitespaces in modal
reneaaron Oct 30, 2023
52e56a2
fix: remove sorting in hook
reneaaron Oct 30, 2023
88a93ee
fix: prevent duplicate loading of transactions, spacing
reneaaron Oct 30, 2023
32e17a0
fix: add payment hash, cleanup
reneaaron Oct 30, 2023
8d380d8
fix: reset showMore when transaction changes to avoid flicker
reneaaron Oct 31, 2023
e56e496
Merge remote-tracking branch 'upstream/master' into feat/transaction-…
pavanjoshi914 Nov 1, 2023
cb9755e
Merge branch 'feat/transaction-list' of https://github.com/getAlby/li…
pavanjoshi914 Nov 1, 2023
6c784cc
chore: cleaning up
pavanjoshi914 Nov 1, 2023
7984fd5
feat: get rid of invoice type
pavanjoshi914 Nov 1, 2023
ab520d8
feat: rename getTransactions action and message types
pavanjoshi914 Nov 6, 2023
177acf2
feat: filter transactions without isSettled
pavanjoshi914 Nov 6, 2023
9226f65
feat: cleanup connector GetTransactions method
pavanjoshi914 Nov 6, 2023
796fbbb
fix: decode preimage & payment_hash
reneaaron Nov 9, 2023
58cd64d
Merge branch 'master' into feat/transaction-list
reneaaron Nov 9, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
21 changes: 17 additions & 4 deletions src/app/components/Modal/index.tsx
Original file line number Diff line number Diff line change
@@ -1,29 +1,42 @@
import { CrossIcon } from "@bitcoin-design/bitcoin-icons-react/filled";
import ReactModal from "react-modal";

type Props = {
children?: React.ReactNode;
isOpen: boolean;
close: () => void;
title: string;
contentLabel: string;
title?: string;
};

export default function Modal({
children,
isOpen,
close: closeModal,
contentLabel,
title,
}: Props) {
return (
<ReactModal
ariaHideApp={false}
closeTimeoutMS={200}
shouldFocusAfterRender={false}
isOpen={isOpen}
onRequestClose={closeModal}
contentLabel={title}
overlayClassName="bg-black bg-opacity-50 fixed inset-0 flex justify-center items-center p-5"
className="rounded-lg bg-white dark:bg-surface-02dp w-full max-w-md overflow-hidden"
contentLabel={contentLabel}
overlayClassName="bg-black bg-opacity-50 fixed inset-0 flex justify-center items-center cursor-pointer"
className="rounded-lg shadow-xl bg-white dark:bg-surface-02dp w-full max-w-md overflow-hidden relative p-5 cursor-auto mx-5"
style={{ content: { maxHeight: "90vh" } }}
>
{title && (
<h2 className="text-2xl font-bold dark:text-white mb-6">{title}</h2>
)}
<button
onClick={closeModal}
className="absolute right-5 top-5 text-gray-600 dark:text-neutral-400 hover:text-gray-700 dark:hover:text-neutral-300"
>
<CrossIcon className="w-6 h-6" />
</button>
{children}
</ReactModal>
);
Expand Down
2 changes: 1 addition & 1 deletion src/app/components/PaymentSummary/index.test.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import PaymentSummary, { Props } from "@components/PaymentSummary";
import { render, screen, act } from "@testing-library/react";
import { act, render, screen } from "@testing-library/react";
import { I18nextProvider } from "react-i18next";
import { BrowserRouter } from "react-router-dom";
import { settingsFixture as mockSettings } from "~/../tests/fixtures/settings";
Expand Down
136 changes: 61 additions & 75 deletions src/app/components/SitePreferences/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { CrossIcon } from "@bitcoin-design/bitcoin-icons-react/outline";
import Button from "@components/Button";
import Hyperlink from "@components/Hyperlink";
import Setting from "@components/Setting";
Expand Down Expand Up @@ -179,95 +178,82 @@ function SitePreferences({ launcherType, allowance, onEdit, onDelete }: Props) {
<Modal
isOpen={modalIsOpen}
close={closeModal}
title={t("edit_allowance.screen_reader")}
contentLabel={t("edit_allowance.screen_reader")}
title={t("edit_allowance.title")}
>
<div className="p-5 flex justify-between dark:bg-surface-02dp">
<h2 className="text-2xl font-bold dark:text-white">
{t("edit_allowance.title")}
</h2>
<button onClick={closeModal}>
<CrossIcon className="w-6 h-6 dark:text-white" />
</button>
</div>

<form
onSubmit={(e: FormEvent) => {
e.preventDefault();
updateAllowance();
}}
>
<div
style={{ maxHeight: "calc(90vh - 154px)", overflowY: "auto" }}
className="p-5 border-t border-b border-gray-200 dark:bg-surface-02dp dark:border-neutral-700"
>
<div className="pb-4 border-b border-gray-200 dark:border-neutral-700">
<DualCurrencyField
id="budget"
label={t("new_budget.label")}
min={0}
autoFocus
placeholder={tCommon("sats", { count: 0 })}
value={budget}
hint={t("hint")}
fiatValue={fiatAmount}
onChange={(e) => setBudget(e.target.value)}
<div className="pb-4 border-b border-gray-200 dark:border-neutral-700">
<DualCurrencyField
id="budget"
label={t("new_budget.label")}
min={0}
autoFocus
placeholder={tCommon("sats", { count: 0 })}
value={budget}
hint={t("hint")}
fiatValue={fiatAmount}
onChange={(e) => setBudget(e.target.value)}
/>
</div>
<div className={hasPermissions ? "pb-4" : ""}>
<Setting
title={t("enable_login.title")}
subtitle={t("enable_login.subtitle")}
>
<Toggle
checked={lnurlAuth}
onChange={() => setLnurlAuth(!lnurlAuth)}
/>
</div>
<div className={hasPermissions ? "pb-4" : ""}>
<Setting
title={t("enable_login.title")}
subtitle={t("enable_login.subtitle")}
>
<Toggle
checked={lnurlAuth}
onChange={() => setLnurlAuth(!lnurlAuth)}
/>
</Setting>
</div>
</Setting>
</div>

{hasPermissions && (
{hasPermissions && (
<div>
<h2 className="pt-4 text-lg text-gray-900 font-bold dark:text-white">
{t("edit_permissions")}
</h2>
<div>
<h2 className="pt-4 text-lg text-gray-900 font-bold dark:text-white">
{t("edit_permissions")}
</h2>
<div>
{permissions.map((permission) => (
<Fragment key={permission.id}>
<Setting
title={permission.method}
subtitle={tPermissions(
permission.method
.toLowerCase()
.split("/")
.slice(-2)
.join(".") as unknown as TemplateStringsArray
)}
/* split the method at "/", take the last two items in
{permissions.map((permission) => (
<Fragment key={permission.id}>
<Setting
title={permission.method}
subtitle={tPermissions(
permission.method
.toLowerCase()
.split("/")
.slice(-2)
.join(".") as unknown as TemplateStringsArray
)}
/* split the method at "/", take the last two items in
the array and join them with "." to get the i18n string
webln/lnd/getinfo -> lnd.getinfo
nostr/nip04decrypt --> nostr.nip04decrypt */
>
<Toggle
checked={permission.enabled}
onChange={() => {
setPermissions(
permissions.map((prm) =>
prm.id === permission.id
? { ...prm, enabled: !prm.enabled }
: prm
)
);
}}
/>
</Setting>
</Fragment>
))}
</div>
>
<Toggle
checked={permission.enabled}
onChange={() => {
setPermissions(
permissions.map((prm) =>
prm.id === permission.id
? { ...prm, enabled: !prm.enabled }
: prm
)
);
}}
/>
</Setting>
</Fragment>
))}
</div>
)}
</div>
</div>
)}

<div className="flex justify-between items-center p-5 dark:bg-surface-02dp">
<div className="mt-6 flex justify-between items-center dark:bg-surface-02dp">
<Hyperlink
onClick={async () => {
if (window.confirm(t("confirm_delete"))) {
Expand Down