Skip to content

Commit 9cb1122

Browse files
committed
Merge branch 'master' into feature/lnc-web
# By Lisa Oppermann (15) and others # Via GitHub (35) and escapedcat (1) * master: (75 commits) fix: remove runcitadel sdk dependency (#1681) chore(deps): update puppeteer to v19 revert(deps): puppeteer and fake-indexdb Update fake-indexeddb to version 4.0.0 Update @types/chrome to version 0.0.200 Update puppeteer to version 19.2.0 fix: publisher link on AllowanceView Translated using Weblate (Italian) Update all development Yarn dependencies (2022-10-29) chore: remove showcases chore: remove topup app fix: align reject/close function params fix: navigate on send Update dayjs to version 1.11.6 fix: disable input fields on Create Invoice #1659 (#1668) Update react-i18next to version 12.0.0 Push buttons to bottom in Send and Receive Screens (#1672) refactor(lnurl): getDetails - avoid typecasting (#1545) style: prettier Translated using Weblate (Italian) ...
2 parents 80cffad + beffbd3 commit 9cb1122

File tree

61 files changed

+3200
-1333
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+3200
-1333
lines changed

.github/ISSUE_TEMPLATE/bug_report.yml

+77
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
name: 🐞 Bug report
2+
description: Create a report to help us improve (use this to report bugs only).
3+
title: "[BUG] <title>"
4+
labels: [🐞 bug]
5+
body:
6+
- type: checkboxes
7+
attributes:
8+
label: Is there an existing issue for this?
9+
description: Please search to see if an issue already exists for the bug you encountered.
10+
options:
11+
- label: I have searched the existing issues
12+
required: true
13+
- type: textarea
14+
attributes:
15+
label: Describe the bug
16+
description: A clear and concise description of what the bug is. Include images if relevant.
17+
placeholder: A bug happened!
18+
validations:
19+
required: true
20+
- type: textarea
21+
attributes:
22+
label: Screenshots [optional]
23+
description: |
24+
Add screenshots to help explain your problem. You can also add a video here.
25+
26+
Tip: You can attach images or video files by clicking this area to highlight it and then dragging files in.
27+
validations:
28+
required: false
29+
- type: textarea
30+
attributes:
31+
label: Steps To Reproduce
32+
description: Steps to reproduce the bug.
33+
placeholder: |
34+
1. Visit '...'
35+
2. Click on '...'
36+
3. Scroll to '...'
37+
4. See error
38+
validations:
39+
required: true
40+
- type: textarea
41+
attributes:
42+
label: Expected behavior
43+
description: A clear and concise description of what you expected to happen
44+
validations:
45+
required: true
46+
- type: textarea
47+
attributes:
48+
label: Alby information
49+
placeholder: |
50+
- Alby Version: [e.g. 1.5.0]
51+
- Alby installed through: [e.g. installed through the browser stores, installed manually]
52+
- Wallet connected with Alby: [e.g. LND, BlueWallet LNDhub]
53+
validations:
54+
required: true
55+
- type: textarea
56+
attributes:
57+
label: Device information
58+
placeholder: |
59+
- OS: [e.g. Windows]
60+
- Browser: [e.g. chrome, safari, firefox]
61+
- Browser Version: [e.g. 22]
62+
validations:
63+
required: false
64+
- type: textarea
65+
attributes:
66+
label: Additional context
67+
description: |
68+
Links? References? Anything that will give us more context about the issue you are encountering!
69+
validations:
70+
required: false
71+
- type: dropdown
72+
id: assign
73+
attributes:
74+
label: Are you working on this?
75+
options:
76+
- "Yes"
77+
- "No"
+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: ✨ Feature request
2+
description: Request a feature you'd like to see in lightning!
3+
title: "[Feature] <title>"
4+
labels: [idea]
5+
body:
6+
- type: markdown
7+
attributes:
8+
value: |
9+
We're always looking for suggestions on how we could improve lightning!
10+
- type: textarea
11+
attributes:
12+
label: Feature description
13+
description: |
14+
Is your feature request related to a problem? A clear and concise description of what the feature is.
15+
validations:
16+
required: true
17+
- type: textarea
18+
attributes:
19+
label: Describe the solution
20+
description: A clear and concise description of what you want to happen.
21+
validations:
22+
required: true
23+
- type: textarea
24+
attributes:
25+
label: Describe alternatives
26+
description: |
27+
A clear and concise description of any alternative solutions or features you have considered.
28+
validations:
29+
required: true
30+
- type: textarea
31+
attributes:
32+
label: Additional context
33+
description: |
34+
Add any other additional context or screenshots about the feature request here.
35+
validations:
36+
required: false
37+
- type: dropdown
38+
id: assign
39+
attributes:
40+
label: Are you working on this?
41+
options:
42+
- "Yes"
43+
- "No"
44+

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -398,7 +398,7 @@ Also we focus on supporting multiple different node backends (non-custodial and
398398

399399
#### What is WebLN?
400400

401-
WebLN is a library and set of specifications for lightning apps and client providers to facilitate communication between apps and users' lightning nodes in a secure way. It provides a programmatic, permissioned interface for letting applications ask users to send payments, generate invoices to receive payments, and much more. [This documentation](https://webln.dev/#/) covers how to use WebLN in your Lightning-driven applications.
401+
WebLN is a library and set of specifications for lightning apps and client providers to facilitate communication between apps and users' lightning nodes in a secure way. It provides a programmatic, permissioned interface for letting applications ask users to send payments, generate invoices to receive payments, and much more. [This documentation](https://webln.guide/) covers how to use WebLN in your Lightning-driven applications.
402402

403403
#### Is there a bounty program and can I contribute?
404404

package.json

+12-13
Original file line numberDiff line numberDiff line change
@@ -50,35 +50,34 @@
5050
"browser-polyfill": "^3.20.2",
5151
"crypto-browserify": "^3.12.0",
5252
"crypto-js": "^4.1.1",
53-
"dayjs": "^1.11.5",
53+
"dayjs": "^1.11.6",
5454
"dexie": "^3.2.2",
5555
"elliptic": "^6.5.4",
56-
"html5-qrcode": "^2.2.1",
56+
"html5-qrcode": "^2.2.3",
5757
"i18next": "^21.10.0",
5858
"i18next-browser-languagedetector": "^6.1.8",
5959
"lodash": "^4.17.21",
6060
"pubsub-js": "^1.9.4",
6161
"react": "^18.2.0",
6262
"react-confetti": "^6.1.0",
6363
"react-dom": "^18.2.0",
64-
"react-i18next": "^11.18.6",
64+
"react-i18next": "^12.0.0",
6565
"react-loading-skeleton": "^3.1.0",
66-
"react-modal": "^3.15.1",
67-
"react-palette": "^1.0.2",
66+
"react-modal": "^3.16.1",
6867
"react-qr-code": "^2.0.8",
6968
"react-router-dom": "^6.4.2",
7069
"react-toastify": "^9.0.8",
7170
"stream": "^0.0.2",
72-
"tailwindcss": "^3.1.8",
71+
"tailwindcss": "^3.2.1",
7372
"uuid": "^9.0.0",
7473
"webextension-polyfill": "^0.10.0",
7574
"zustand": "^3.7.2"
7675
},
7776
"devDependencies": {
7877
"@commitlint/cli": "^17.1.2",
7978
"@commitlint/config-conventional": "^17.1.0",
80-
"@jest/types": "^29.1.2",
81-
"@playwright/test": "^1.26.0",
79+
"@jest/types": "^29.2.1",
80+
"@playwright/test": "^1.27.1",
8281
"@storybook/addon-actions": "^6.5.12",
8382
"@storybook/addon-essentials": "^6.5.12",
8483
"@storybook/addon-links": "^6.5.12",
@@ -92,8 +91,8 @@
9291
"@testing-library/jest-dom": "^5.16.5",
9392
"@testing-library/react": "^13.4.0",
9493
"@testing-library/user-event": "^14.4.3",
95-
"@trivago/prettier-plugin-sort-imports": "^3.3.0",
96-
"@types/chrome": "^0.0.197",
94+
"@trivago/prettier-plugin-sort-imports": "^3.4.0",
95+
"@types/chrome": "^0.0.200",
9796
"@types/crypto-js": "^4.1.1",
9897
"@types/elliptic": "^6.4.14",
9998
"@types/pubsub-js": "^1.8.3",
@@ -117,7 +116,7 @@
117116
"eslint-plugin-import": "^2.26.0",
118117
"eslint-plugin-react": "^7.31.9",
119118
"eslint-plugin-react-hooks": "^4.6.0",
120-
"fake-indexeddb": "^3.1.8",
119+
"fake-indexeddb": "^3.0.0",
121120
"filemanager-webpack-plugin": "^7.0.0",
122121
"html-webpack-plugin": "^5.5.0",
123122
"husky": "^8.0.1",
@@ -127,13 +126,13 @@
127126
"lint-staged": "^13.0.3",
128127
"mini-css-extract-plugin": "^2.6.1",
129128
"msw": "^0.47.4",
130-
"postcss": "^8.4.17",
129+
"postcss": "^8.4.18",
131130
"postcss-cli": "^10.0.0",
132131
"postcss-loader": "^7.0.1",
133132
"pptr-testing-library": "^0.7.0",
134133
"prettier": "^2.7.1",
135134
"process": "^0.11.10",
136-
"puppeteer": "^18.2.1",
135+
"puppeteer": "^19.0.0",
137136
"resolve-url-loader": "^5.0.0",
138137
"sass": "^1.55.0",
139138
"sass-loader": "^13.1.0",

src/app/components/AllowanceMenu/index.test.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import * as SettingsContext from "~/app/context/SettingsContext";
77
import type { Props } from "./index";
88
import AllowanceMenu from "./index";
99

10-
const mockGetFiatValue = jest.fn(() => "$1,22");
10+
const mockGetFiatValue = jest.fn(() => Promise.resolve("$1,22"));
1111

1212
jest.spyOn(SettingsContext, "useSettings").mockReturnValue({
1313
settings: mockSettings,

src/app/components/AllowanceMenu/index.tsx

+7-3
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,12 @@ function AllowanceMenu({ allowance, onEdit, onDelete }: Props) {
3838

3939
useEffect(() => {
4040
if (budget !== "" && showFiat) {
41-
const res = getFiatValue(budget);
42-
setFiatAmount(res);
41+
const getFiat = async () => {
42+
const res = await getFiatValue(budget);
43+
setFiatAmount(res);
44+
};
45+
46+
getFiat();
4347
}
4448
}, [budget, showFiat, getFiatValue]);
4549

@@ -134,7 +138,7 @@ function AllowanceMenu({ allowance, onEdit, onDelete }: Props) {
134138
label={t("new_budget.label")}
135139
min={0}
136140
autoFocus
137-
placeholder={tCommon("sats")}
141+
placeholder={tCommon("sats", { count: 0 })}
138142
value={budget}
139143
hint={t("hint")}
140144
fiatValue={fiatAmount}

src/app/components/BudgetControl/index.tsx

+2-1
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,12 @@ function BudgetControl({
5757

5858
<div>
5959
<DualCurrencyField
60+
autoFocus
6061
fiatValue={fiatAmount}
6162
id="budget"
6263
min={0}
6364
label={t("budget.label")}
64-
placeholder={tCommon("sats")}
65+
placeholder={tCommon("sats", { count: 0 })}
6566
value={budget}
6667
onChange={onBudgetChange}
6768
/>

src/app/components/Button/index.tsx

+55-43
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1+
import { forwardRef } from "react";
2+
import type { Ref } from "react";
3+
import Loading from "~/app/components/Loading";
14
import { classNames } from "~/app/utils/index";
25

3-
import Loading from "../Loading";
4-
56
export type Props = React.ButtonHTMLAttributes<HTMLButtonElement> & {
67
fullWidth?: boolean;
78
halfWidth?: boolean;
@@ -13,44 +14,55 @@ export type Props = React.ButtonHTMLAttributes<HTMLButtonElement> & {
1314
direction?: "row" | "column";
1415
};
1516

16-
export default function Button({
17-
type = "button",
18-
label,
19-
onClick,
20-
disabled,
21-
direction = "row",
22-
icon,
23-
fullWidth = false,
24-
halfWidth = false,
25-
primary = false,
26-
loading = false,
27-
}: Props) {
28-
return (
29-
<button
30-
type={type}
31-
className={classNames(
32-
direction === "row" ? "flex-row" : "flex-col",
33-
fullWidth && "w-full",
34-
halfWidth && "w-1/2 first:mr-2 last:ml-2",
35-
fullWidth || halfWidth ? "px-0 py-2" : "px-7 py-2",
36-
primary
37-
? "bg-orange-bitcoin text-white border border-transparent"
38-
: `bg-white text-gray-700 dark:bg-surface-02dp dark:text-neutral-200 dark:border-neutral-800`,
39-
primary && !disabled && "hover:bg-orange-bitcoin-700",
40-
!primary && !disabled && "hover:bg-gray-50 dark:hover:bg-surface-16dp",
41-
disabled ? "cursor-default opacity-60" : "cursor-pointer",
42-
"inline-flex justify-center items-center font-medium rounded-md shadow focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-orange-bitcoin transition duration-150"
43-
)}
44-
onClick={onClick}
45-
disabled={disabled}
46-
>
47-
{loading && (
48-
<div className={direction === "row" ? "mr-2" : ""}>
49-
<Loading color={primary ? "white" : "black"} />
50-
</div>
51-
)}
52-
{icon}
53-
{label}
54-
</button>
55-
);
56-
}
17+
const Button = forwardRef(
18+
(
19+
{
20+
type = "button",
21+
label,
22+
onClick,
23+
disabled,
24+
direction = "row",
25+
icon,
26+
fullWidth = false,
27+
halfWidth = false,
28+
primary = false,
29+
loading = false,
30+
}: Props,
31+
ref: Ref<HTMLButtonElement>
32+
) => {
33+
return (
34+
<button
35+
ref={ref}
36+
type={type}
37+
className={classNames(
38+
direction === "row" ? "flex-row" : "flex-col",
39+
fullWidth && "w-full",
40+
halfWidth && "w-1/2 first:mr-2 last:ml-2",
41+
fullWidth || halfWidth ? "px-0 py-2" : "px-7 py-2",
42+
primary
43+
? "bg-orange-bitcoin text-white border border-transparent"
44+
: `bg-white text-gray-700 dark:bg-surface-02dp dark:text-neutral-200 dark:border-neutral-800`,
45+
primary && !disabled && "hover:bg-orange-bitcoin-700",
46+
!primary &&
47+
!disabled &&
48+
"hover:bg-gray-50 dark:hover:bg-surface-16dp",
49+
disabled ? "cursor-default opacity-60" : "cursor-pointer",
50+
"inline-flex justify-center items-center font-medium rounded-md shadow focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-orange-bitcoin transition duration-150"
51+
)}
52+
onClick={onClick}
53+
disabled={disabled}
54+
>
55+
{loading && (
56+
<div className={direction === "row" ? "mr-2" : ""}>
57+
<Loading color={primary ? "white" : "black"} />
58+
</div>
59+
)}
60+
{icon}
61+
{label}
62+
</button>
63+
);
64+
}
65+
);
66+
Button.displayName = "Button";
67+
68+
export default Button;

0 commit comments

Comments
 (0)