mirror of
https://github.com/selfxyz/self.git
synced 2026-04-05 03:00:53 -04:00
* 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>
25 lines
748 B
TypeScript
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;
|