Files
self/sdk/qrcode/components/StatusBanner.tsx
Kartik Mehta bebaebc872 QR code SDK Redesign (#1536)
* Refactor NFC scanner tests to use a global variable for platform OS, allowing dynamic switching between iOS and Android during tests. This change improves test isolation and avoids hoisting issues with jest.mock.

* Triggering GitHub workflows

* Add status animations and self logos

* Update utilities and styles for statuses

* Remove old LED implementation and occurences

* Update Self QR Code with new design

* Add status banner

* Remove console and use QRcodeSteps in styles

* Add ARIA and use Memo to prevent re-renders

* Add refs for success and error callbacks

* Use ref for self app in qrcode

* Use selfapp ref consistently

* Update connected state animtion

* Skip 'parses Android response' test in nfcScanner

---------

Co-authored-by: Justin Hernandez <justin.hernandez@self.xyz>
Co-authored-by: Javier Cortejoso <javier.cortejoso@gmail.com>
2026-01-21 23:07:24 +10:00

25 lines
748 B
TypeScript

import React, { memo } from 'react';
import selfLogo from '../assets/self-logo.svg';
import { statusBannerLogoStyle, statusBannerStyle } from '../utils/styles.js';
import { getStatusText, QRcodeSteps } from '../utils/utils.js';
interface StatusBannerProps {
proofStep: number;
qrSize: number;
}
const StatusBanner = memo(({ proofStep, qrSize }: StatusBannerProps) => {
const showLogo =
proofStep === QRcodeSteps.DISCONNECTED || proofStep === QRcodeSteps.WAITING_FOR_MOBILE;
return (
<div style={statusBannerStyle(qrSize)} role="status" aria-live="polite">
{showLogo && <img src={selfLogo} alt="Self Logo" style={statusBannerLogoStyle} />}
{getStatusText(proofStep)}
</div>
);
});
export default StatusBanner;