mirror of
https://github.com/pezkuwichain/pezkuwi-ui.git
synced 2026-07-19 23:55:42 +00:00
Bump deps (#751)
This commit is contained in:
@@ -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 });
|
||||
|
||||
|
||||
@@ -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]
|
||||
|
||||
@@ -12,7 +12,7 @@ interface ScanType {
|
||||
isAddress: boolean;
|
||||
content: string;
|
||||
genesisHash: string;
|
||||
name?: string;
|
||||
name?: string | undefined;
|
||||
}
|
||||
|
||||
interface Props {
|
||||
|
||||
Reference in New Issue
Block a user