Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into update-banner-close
Browse files Browse the repository at this point in the history
  • Loading branch information
pavanjoshi914 committed Jan 13, 2025
2 parents f581429 + 3a4a063 commit 039aabe
Show file tree
Hide file tree
Showing 35 changed files with 3,504 additions and 750 deletions.
4 changes: 1 addition & 3 deletions src/app/components/CardButton/Group.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,5 @@ export type Props = {
};

export default function CardButtonGroup({ children }: Props) {
return (
<div className="grid gap-5 grid-cols-1 sm:grid-cols-2">{children}</div>
);
return <div className="flex flex-col sm:flex-row gap-5">{children}</div>;
}
6 changes: 3 additions & 3 deletions src/app/components/CardButton/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@ export default function CardButton({
}: Props) {
return (
<button
className="flex flex-col flex-1 text-left border border-gray-200 dark:border-neutral-700 rounded-md p-6 bg-white dark:bg-surface-01dp hover:bg-gray-100 dark:hover:bg-surface-02dp hover:border-gray-300 dark:hover:border-neutral-700 focus:bg-amber-50 dark:focus:bg-surface-02dp cursor-pointer focus:ring-primary focus:border-primary dark:focus:border-primary focus:ring-1 gap-2"
className="flex flex-col flex-1 text-left border border-gray-200 dark:border-neutral-700 rounded-xl p-6 bg-white dark:bg-surface-01dp hover:bg-gray-100 dark:hover:bg-surface-02dp hover:border-gray-300 dark:hover:border-neutral-700 focus:bg-amber-50 dark:focus:bg-surface-02dp cursor-pointer focus:ring-primary focus:border-primary dark:focus:border-primary focus:ring-1 gap-2"
onClick={onClick}
>
<Icon className="w-8 h-8 text-gray-700 dark:text-white" />
<h3 className="font-medium leading-6 text-md text-gray-800 dark:text-neutral-200">
<h3 className="font-medium leading-6 text-sm text-gray-800 dark:text-neutral-200">
{title}
</h3>
<p className="text-gray-600 dark:text-neutral-400 text-sm leading-5">
<p className="text-gray-600 dark:text-neutral-400 text-xs leading-5">
{description}
</p>
</button>
Expand Down
41 changes: 23 additions & 18 deletions src/app/screens/Accounts/GenerateMnemonic/new.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
import Container from "@components/Container";
import { PopiconsDownloadLine, PopiconsKeyLine } from "@popicons/react";
import {
PopiconsDownloadLine,
PopiconsOstrichLine,
PopiconsShieldLine,
} from "@popicons/react";
import { useEffect, useState } from "react";
import { useTranslation } from "react-i18next";
import { Link, useNavigate } from "react-router-dom";
import { useNavigate } from "react-router-dom";
import Button from "~/app/components/Button";
import CardButton from "~/app/components/CardButton";
import CardButtonGroup from "~/app/components/CardButton/Group";
Expand Down Expand Up @@ -43,15 +47,6 @@ function MnemonicExplanation() {

return (
<Container maxWidth="md">
<div className="flex justify-end mt-6 -mb-4 text-xs">
<Link
to="../../nostr/settings"
relative="path"
className="text-blue-600 hover:text-blue-700"
>
{t("nostr")}
</Link>
</div>
<ContentBox>
<div className="flex flex-col gap-4">
<h1 className="font-bold text-2xl dark:text-white">{t("title")}</h1>
Expand All @@ -67,7 +62,7 @@ function MnemonicExplanation() {
<CardButton
title={t("secure.title")}
description={t("secure.description")}
icon={PopiconsKeyLine}
icon={PopiconsShieldLine}
onClick={() => setSelectedCard("backup")}
/>
<CardButton
Expand All @@ -76,6 +71,12 @@ function MnemonicExplanation() {
icon={PopiconsDownloadLine}
onClick={() => setSelectedCard("import")}
/>
<CardButton
title={t("import_nostr.title")}
description={t("import_nostr.description")}
icon={PopiconsOstrichLine}
onClick={() => setSelectedCard("importNostr")}
/>
</CardButtonGroup>
</div>

Expand All @@ -84,13 +85,17 @@ function MnemonicExplanation() {
label={tCommon("actions.next")}
primary
flex
onClick={() =>
selectedCard == "backup"
? hasMnemonic
onClick={() => {
if (selectedCard === "backup") {
hasMnemonic
? navigate("../secret-key/backup")
: navigate("../secret-key/generate")
: navigate("../secret-key/import")
}
: navigate("../secret-key/generate");
} else if (selectedCard === "import") {
navigate("../secret-key/import");
} else if (selectedCard === "importNostr") {
navigate("../nostr/settings");
}
}}
/>
</div>
</ContentBox>
Expand Down
9 changes: 6 additions & 3 deletions src/extension/content-script/batteries/Medium.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,12 @@ const urlMatcher = /^https:\/\/(.+\.)?medium.com\/(\S+)?/;
const battery = (): void => {
const name =
document.querySelector<HTMLHeadingElement>(".pw-author-name")?.innerText;
const description = document.querySelector<HTMLParagraphElement>(
".pw-follower-count ~ p"
)?.textContent;

const description = document
.querySelector(".pw-author-name")
?.parentElement?.parentElement?.querySelector("p")
?.querySelector("span")?.textContent;

if (!name || !description) return;

const match = findLightningAddressInText(description);
Expand Down
26 changes: 12 additions & 14 deletions src/extension/content-script/batteries/Reddit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,30 +4,28 @@ import { findLightningAddressInText, setLightningData } from "./helpers";
const urlMatcher = /^https:\/\/www.reddit\.com\/user\/(\w+).*/;

function battery(): void {
const descriptionElement = document.querySelector<HTMLMetaElement>(
'head > meta[name="description"]'
const descriptionElement = document.querySelector<HTMLElement>(
'p[data-testid="profile-description"]'
);
const imageUrl = document.querySelector<HTMLMetaElement>(
'head > meta[property="og:image"]'
)?.content;

const imageUrl = document.querySelector<HTMLImageElement>(
'img[data-testid="profile-icon"]'
)?.src;

if (!descriptionElement || !imageUrl) {
return;
}

const content = descriptionElement.content.split(/:(.*)/s);
const userName = content[0];
const description =
document.querySelector<HTMLMetaElement>(
`h4 + a[href*='user/${userName.split("/")[1]}'] + div`
)?.textContent ?? content[1].slice(1);
const content = descriptionElement.textContent || "";
const userName =
document.querySelector("aside div h2")?.textContent?.trim() || "";

let match;
let recipient;
// attempt to extract lnurlp: from the description text
if ((match = (description || "").match(/lnurlp:(\S+)/i))) {
if ((match = (content || "").match(/lnurlp:(\S+)/i))) {
recipient = match[1];
} else if ((match = findLightningAddressInText(description))) {
} else if ((match = findLightningAddressInText(content || ""))) {
recipient = match;
}
// if we still did not find anything ignore it.
Expand All @@ -40,7 +38,7 @@ function battery(): void {
method: "lnurl",
address: recipient,
...getOriginData(),
description,
description: content,
icon: imageUrl,
name: userName,
},
Expand Down
27 changes: 27 additions & 0 deletions src/i18n/i18nConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@ import "dayjs/locale/it";
import "dayjs/locale/mr";
import "dayjs/locale/pl";
import "dayjs/locale/pt-br";
import "dayjs/locale/ru";
import "dayjs/locale/si";
import "dayjs/locale/sv";
import "dayjs/locale/ta";
import "dayjs/locale/zh-cn";
import i18n from "i18next";
import LanguageDetector from "i18next-browser-languagedetector";
Expand All @@ -28,7 +31,10 @@ import it from "~/i18n/locales/it/translation.json";
import mr from "~/i18n/locales/mr/translation.json";
import pl from "~/i18n/locales/pl/translation.json";
import pt_BR from "~/i18n/locales/pt_BR/translation.json";
import ru from "~/i18n/locales/ru/translation.json";
import si from "~/i18n/locales/si/translation.json";
import sv from "~/i18n/locales/sv/translation.json";
import ta from "~/i18n/locales/ta/translation.json";
import th from "~/i18n/locales/th/translation.json";
import zh_Hans from "~/i18n/locales/zh_Hans/translation.json";

Expand Down Expand Up @@ -125,6 +131,24 @@ export const resources = {
components: fa.components,
permissions: fa.permissions,
},
si: {
translation: si.translation,
common: si.common,
components: si.components,
permissions: si.permissions,
},
ta: {
translation: ta.translation,
common: ta.common,
components: ta.components,
permissions: ta.permissions,
},
ru: {
translation: ru.translation,
common: ru.common,
components: ru.components,
permissions: ru.permissions,
},
} as const;

// needs to be aligned with `resources`
Expand All @@ -145,6 +169,9 @@ export const supportedLocales = [
{ locale: "mr", label: "मराठी" },
{ locale: "th", label: "ไทย" },
{ locale: "fa", label: "فارسی" },
{ locale: "si", label: "Sinhalese" },
{ locale: "ta", label: "Tamil" },
{ locale: "ru", label: "Russian" },
];

i18n
Expand Down
10 changes: 0 additions & 10 deletions src/i18n/locales/cs/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -98,13 +98,6 @@
"citadel": {
"page": {
"title": "Připojení k uzlu <0>Citadel</0>"
},
"password": {
"label": "Heslo k Citadel"
},
"url": {
"label": "Citadel URL",
"placeholder": "http://citadel.local"
}
},
"umbrel": {
Expand Down Expand Up @@ -571,9 +564,6 @@
},
"umbrel": {
"name": "Umbrel"
},
"citadel": {
"name": "Citadel"
}
}
},
Expand Down
7 changes: 0 additions & 7 deletions src/i18n/locales/da/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -126,13 +126,6 @@
"citadel": {
"page": {
"title": "Opret forbindelse til <0>Citadel</0> node"
},
"password": {
"label": "Citadel adgangskode"
},
"url": {
"label": "Citadel URL",
"placeholder": "http://citadel.local"
}
},
"umbrel": {
Expand Down
34 changes: 20 additions & 14 deletions src/i18n/locales/de/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -107,14 +107,12 @@
"description": "Verbinden mit deiner externen Lightning Wallet oder Node",
"citadel": {
"page": {
"title": "Verbinden mit <0>Citadel</0> Node"
"title": "Verbinden mit <0>Citadel</0> Node",
"instructions": "1. Gehe in deinem Citadel-Bereich deines Nirvati-Dashboards auf <0>Connect wallet</0><1/>2. Wähle den Modus <0>Alby (Tor)</0> oder <0>Alby (Local Network)</0> aus<1/>3. Kopiere die <0>lndconnect URL</0> und füge sie unten ein"
},
"password": {
"label": "Citadel Passwort"
},
"url": {
"label": "Citadel URL",
"placeholder": "http://citadel.local"
"rest_url": {
"label": "lndconnect REST URL",
"placeholder": "lndconnect://yournode:8080?..."
}
},
"raspiblitz": {
Expand Down Expand Up @@ -317,6 +315,9 @@
"connection_failed": "Verbindung fehlgeschlagen. Ist dein Alby Hub online und die App-Verbindung aktiviert?"
}
}
},
"nirvati": {
"title": "Nirvati"
}
},
"unlock": {
Expand Down Expand Up @@ -434,7 +435,9 @@
"description": "Erstelle einen Master Key für Bitcoin, Nostr und Liquid oder importiere ein bestehendes Nostr-Konto."
}
},
"upgrade_account": "Du verwendest die alte LNDHub-Einstellung. <0>Bitte verbinde dich erneut</0> mit deinem Alby-Konto, um Zugang zu den neuesten Funktionen zu erhalten."
"upgrade_account": "Du verwendest die alte LNDHub-Einstellung. <0>Bitte verbinde dich erneut</0> mit deinem Alby-Konto, um Zugang zu den neuesten Funktionen zu erhalten.",
"using_fee_credits": "Schließe deine Einrichtung ab und verbinde deine Geldbörse mit deinem <0>Alby-Konto</0> für unbegrenzte Zahlungen. Bis deine Einrichtung abgeschlossen ist, kannst du bis zu {{max_account_balance}} sats als <1>Gebührenguthaben</1> erhalten",
"using_shared_node": "Die von dir genutzte gemeinsame Wallet wird zugunsten der Alby Hub Wallet veraltet sein. Um weiterhin Zahlungen zu senden und zu empfangen, <0>richte deine Geldbörse</0> bis zum 3. Januar 2025 ein."
},
"allowance_view": {
"sats": "sats",
Expand Down Expand Up @@ -577,14 +580,17 @@
"keys": "Master Key ermöglicht die Interaktion mit Protokollen wie <0>Nostr</0>, <0>Liquid</0> oder <0> der Bitcoin Blockchain</0>",
"nostr_key": "Du kannst jederzeit vorhandene Nostr-Schlüssel importieren und die von Hauptschlüssel erzeugten überschreiben"
},
"nostr": "Ein bestehendes Nostr-Konto importieren",
"secure": {
"title": "Sichere deinen Hauptschlüssel",
"title": "Sicherer Hauptschlüssel",
"description": "Erfahre, was der Hauptschlüssel ist und sichere deine 12-Wörter-Wiederherstellungsphrase"
},
"import": {
"title": "Hast du bereits einen Hauptschlüssel?",
"title": "Hauptschlüssel importieren",
"description": "Gebe deine Wiederherstellungsphrase ein, um den Hauptschlüssel in diese Wallet zu importieren"
},
"import_nostr": {
"title": "Nostr Schlüssel importieren",
"description": "Hast du bereits eine Nostr-Identität? Importiere es, um es mit diesem Konto zu verwenden"
}
},
"inputs": {
Expand Down Expand Up @@ -936,9 +942,6 @@
"umbrel": {
"name": "Umbrel"
},
"citadel": {
"name": "Citadel"
},
"btcpay": {
"name": "BTCPay"
},
Expand All @@ -950,6 +953,9 @@
},
"startos": {
"name": "StartOS"
},
"nirvati": {
"name": "Nirvati"
}
},
"confirm_add_account": {
Expand Down
12 changes: 0 additions & 12 deletions src/i18n/locales/el/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,19 +66,10 @@
}
},
"citadel": {
"url": {
"label": "Citadel URL",
"placeholder": "http://citadel.local"
},
"page": {
"title": "Σύνδεση σε κόμβο <0>Citadel</0>"
},
"password": {
"label": "Κωδικός Citadel"
}
},
"startos": {},
"btcpay": {},
"lnd": {
"page": {
"title": "Σύνδεση στον LND κόμβο σας"
Expand Down Expand Up @@ -153,9 +144,6 @@
"startos": {
"name": "StartOS"
},
"citadel": {
"name": "Citadel"
},
"mynode": {
"name": "myNode"
}
Expand Down
Loading

0 comments on commit 039aabe

Please sign in to comment.