Skip to content

Conversation

adrianboros
Copy link
Collaborator

No description provided.

golobitch
golobitch previously approved these changes Sep 27, 2025
golobitch
golobitch previously approved these changes Sep 27, 2025
render() {
return this.state.hasError ? (
<div className="p-6 text-center">
<h2 className="text-xl font-semibold">Something went wrong</h2>
Copy link
Collaborator

Choose a reason for hiding this comment

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

Both these two lines have hardcoded text? Not localized?

))}
{!items.length && (
<div className="px-3 py-6 text-center text-white-60">
No transactions for this date.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Translate

)}
{items.length > 0 && (
<div className="rounded-4xl bg-green-500 mt-6 px-6 py-6 text-center text-white">
<span data-l10n-id="email-report">Email report</span>
Copy link
Collaborator

Choose a reason for hiding this comment

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

Translate

const inputRef = useRef<HTMLSelectElement>(null);

const availableLanguages = [
{ code: "en-US", label: "English" },
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think that this labels should be translated :) ro-RO would be Romanian in English language :)

}
}, []);

useEffect(() => {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can we somehow not duplicate this code? Because I see that this one is quite duplicated

<section className="space-y-2">
<Header />
<div className={`flex flex-col p-4 mt-4 ${0 === focused ? "active-item-bg" : ""}`}>
<span className="">Payment pointer</span>
Copy link
Collaborator

Choose a reason for hiding this comment

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

Translation - Payment pointer

ref={inputRef}
tabIndex={focused === 0 ? 0 : -1}
className="px-2 py-2 flex webkit-fill text-2xl font-semibold border-none rounded-lg "
placeholder="e.g., $example.com/alice"
Copy link
Collaborator

Choose a reason for hiding this comment

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

Translation - placeholder value

{error && <p className="mt-2 text-sm text-red-500">{error}</p>}
</div>
<div className="flex flex-col p-4 mt-4 bg-field ">
<span className="">Currency</span>
Copy link
Collaborator

Choose a reason for hiding this comment

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

Translate

setError("");
}}
>
Delete payment pointer
Copy link
Collaborator

Choose a reason for hiding this comment

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

Translate

ref={inputRef}
className="mt-2 w-full rounded-xl bg-white/10 px-4 py-3 outline-none focus:ring-2 focus:ring-emerald-400 placeholder-white/40"
className="mt-2 border-none py-3 outline-none "
placeholder="e.g., $example.com/alice"
Copy link
Collaborator

Choose a reason for hiding this comment

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

Translate placeholder value

try {
const parsed = JSON.parse(rawData);
if (!parsed || typeof parsed !== "object") {
throw new Error("QR payload must be an object");
Copy link
Collaborator

Choose a reason for hiding this comment

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

Translate error

};

if (typeof paymentPointer !== "string" || paymentPointer.trim() === "") {
throw new Error("paymentPointer missing in QR code");
Copy link
Collaborator

Choose a reason for hiding this comment

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

Translate error

throw new Error("paymentPointer missing in QR code");
}
if (typeof signSec !== "string" || signSec.trim() === "") {
throw new Error("signSec missing in QR code");
Copy link
Collaborator

Choose a reason for hiding this comment

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

Translate error

console.log("[SetupByQR] stored QR settings");
} catch (err) {
const message =
err instanceof Error ? err.message : "Invalid QR configuration payload";
Copy link
Collaborator

Choose a reason for hiding this comment

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

Translate error

const videoEl = videoRef.current;

if (!videoEl) {
setError("Video element not available.");
Copy link
Collaborator

Choose a reason for hiding this comment

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

Translate

const canvas = document.createElement("canvas");
const context = canvas.getContext("2d");
if (!context) {
setError("Unable to access canvas context.");
Copy link
Collaborator

Choose a reason for hiding this comment

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

Translate

setError(
parseError instanceof Error
? parseError.message
: "Unable to process QR",
Copy link
Collaborator

Choose a reason for hiding this comment

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

Translate


const handleError = (err: unknown) => {
const message =
err instanceof Error ? err.message : "Unable to access camera.";
Copy link
Collaborator

Choose a reason for hiding this comment

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

Translate

},
);
} else {
handleError(new Error("Camera API is not available on this device."));
Copy link
Collaborator

Choose a reason for hiding this comment

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

Translate

style={{ minWidth: 0 }}
>
<header className="text-xl font-semibold" data-l10n-id="setup-qr-title">
Setup by QR
Copy link
Collaborator

Choose a reason for hiding this comment

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

Translate

{decodedValue ? (
<div>
<div className="font-semibold" data-l10n-id="setup-qr-result-label">
QR Data
Copy link
Collaborator

Choose a reason for hiding this comment

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

Translate

</div>
) : (
<div className="text-gray-600" data-l10n-id="setup-qr-instructions">
{isScanning
Copy link
Collaborator

Choose a reason for hiding this comment

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

Translate

className="text-sm text-gray-600"
data-l10n-id="setup-qr-no-result"
>
No QR code detected.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Translate

<div className="text-center">
<div className="text-4xl font-extrabold tracking-tight">
<div className="mt-12 pt-8 pb-8">
<img src="/assets/icons/logo.png" alt="Interledger POS" className="mx-auto" />
Copy link
Collaborator

Choose a reason for hiding this comment

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

Translate alt text

<p className="mt-2 text-white/70">
Waiting for an NFC card… keep it in the field until confirmed.
</p>
<Header title="Waiting for Card" />
Copy link
Collaborator

Choose a reason for hiding this comment

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

Translate

</p>
)}

<span data-l10n-id={`statuses-${transactionStatus}-key-message`} className="mt-4 mb-2 px-4 text-xl text-center">Hold card near the reader</span>
Copy link
Collaborator

Choose a reason for hiding this comment

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

Translate

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

Successfully merging this pull request may close these issues.

3 participants