Bump deps (#751)

This commit is contained in:
Jaco
2023-04-14 12:20:04 +03:00
committed by GitHub
parent 798a9fb453
commit b14dc3bcc3
15 changed files with 96 additions and 88 deletions
+5 -5
View File
@@ -11,11 +11,11 @@ import { styled } from './styled.js';
import { createFrames, createImgSize } from './util.js';
interface Props {
className?: string;
size?: string | number;
className?: string | undefined;
size?: string | number | undefined;
skipEncoding?: boolean;
style?: React.CSSProperties;
timerDelay?: number;
style?: React.CSSProperties | undefined;
timerDelay?: number | undefined;
value: Uint8Array;
}
@@ -45,7 +45,7 @@ function getDataUrl (value: Uint8Array): string {
return qr.createDataURL(16, 0);
}
function Display ({ className, size, skipEncoding, style, timerDelay = DEFAULT_FRAME_DELAY, value }: Props): React.ReactElement<Props> | null {
function Display ({ className = '', size, skipEncoding, style = {}, timerDelay = DEFAULT_FRAME_DELAY, value }: Props): React.ReactElement<Props> | null {
const [{ image }, setFrameState] = useState<FrameState>({ frameIdx: 0, frames: [], image: null, valueHash: null });
const timerRef = useRef<TimerState>({ timerDelay, timerId: null });
+5 -5
View File
@@ -8,12 +8,12 @@ import { styled } from './styled.js';
import { createImgSize } from './util.js';
interface Props {
className?: string;
className?: string | undefined;
delay?: number;
onError?: (error: Error) => void;
onError?: undefined | ((error: Error) => void);
onScan: (data: string) => void;
size?: string | number;
style?: React.CSSProperties;
size?: string | number | undefined;
style?: React.CSSProperties | undefined;
}
const DEFAULT_DELAY = 150;
@@ -22,7 +22,7 @@ const DEFAULT_ERROR = (error: Error): void => {
console.error('@polkadot/react-qr:Scan', error.message);
};
function Scan ({ className, delay = DEFAULT_DELAY, onError = DEFAULT_ERROR, onScan, size, style }: Props): React.ReactElement<Props> {
function Scan ({ className = '', delay = DEFAULT_DELAY, onError = DEFAULT_ERROR, onScan, size, style = {} }: Props): React.ReactElement<Props> {
const containerStyle = useMemo(
() => createImgSize(size),
[size]
+1 -1
View File
@@ -12,7 +12,7 @@ interface ScanType {
isAddress: boolean;
content: string;
genesisHash: string;
name?: string;
name?: string | undefined;
}
interface Props {