mirror of
https://github.com/pezkuwichain/pezkuwi-ui.git
synced 2026-07-22 18:25:42 +00:00
@@ -2,8 +2,6 @@
|
||||
// This software may be modified and distributed under the terms
|
||||
// of the Apache-2.0 license. See the LICENSE file for details.
|
||||
|
||||
import { BaseProps } from './types';
|
||||
|
||||
import React, { useEffect, useRef, useState } from 'react';
|
||||
import styled from 'styled-components';
|
||||
import { xxhashAsHex } from '@polkadot/util-crypto';
|
||||
@@ -11,8 +9,11 @@ import { xxhashAsHex } from '@polkadot/util-crypto';
|
||||
import qrcode from './qrcode';
|
||||
import { createFrames, createImgSize } from './util';
|
||||
|
||||
interface Props extends BaseProps {
|
||||
interface Props {
|
||||
className?: string;
|
||||
size?: string | number;
|
||||
skipEncoding?: boolean;
|
||||
style?: React.CSSProperties;
|
||||
value: Uint8Array;
|
||||
}
|
||||
|
||||
|
||||
@@ -2,16 +2,17 @@
|
||||
// This software may be modified and distributed under the terms
|
||||
// of the Apache-2.0 license. See the LICENSE file for details.
|
||||
|
||||
import { BaseProps } from './types';
|
||||
|
||||
import React, { useEffect, useState } from 'react';
|
||||
|
||||
import { createAddressPayload } from './util';
|
||||
import QrDisplay from './Display';
|
||||
|
||||
interface Props extends BaseProps {
|
||||
interface Props {
|
||||
address: string;
|
||||
genesisHash: string;
|
||||
className?: string;
|
||||
size?: string | number;
|
||||
style?: React.CSSProperties;
|
||||
}
|
||||
|
||||
function DisplayExtrinsic ({ address, className, genesisHash, size, style }: Props): React.ReactElement<Props> | null {
|
||||
|
||||
@@ -2,18 +2,19 @@
|
||||
// This software may be modified and distributed under the terms
|
||||
// of the Apache-2.0 license. See the LICENSE file for details.
|
||||
|
||||
import { BaseProps } from './types';
|
||||
|
||||
import React, { useEffect, useState } from 'react';
|
||||
|
||||
import { createSignPayload } from './util';
|
||||
import QrDisplay from './Display';
|
||||
|
||||
interface Props extends BaseProps {
|
||||
interface Props {
|
||||
address: string;
|
||||
className?: string;
|
||||
cmd: number;
|
||||
genesisHash: Uint8Array | string;
|
||||
payload: Uint8Array;
|
||||
size?: string | number;
|
||||
style?: React.CSSProperties;
|
||||
}
|
||||
|
||||
function DisplayPayload ({ address, className, cmd, genesisHash, payload, size, style }: Props): React.ReactElement<Props> | null {
|
||||
|
||||
@@ -6,12 +6,14 @@ import { NetworkSpecsStruct } from '@polkadot/ui-settings';
|
||||
|
||||
import React, { useEffect, useState } from 'react';
|
||||
import QrDisplay from './Display';
|
||||
import { BaseProps } from './types';
|
||||
|
||||
import { encodeString } from './util';
|
||||
|
||||
interface Props extends BaseProps {
|
||||
interface Props {
|
||||
className?: string;
|
||||
networkSpecs: NetworkSpecsStruct;
|
||||
size?: string | number;
|
||||
style?: React.CSSProperties;
|
||||
}
|
||||
|
||||
function DisplayNetworkSpecs ({ className, networkSpecs, size, style }: Props): React.ReactElement<Props> | null {
|
||||
|
||||
@@ -2,18 +2,19 @@
|
||||
// This software may be modified and distributed under the terms
|
||||
// of the Apache-2.0 license. See the LICENSE file for details.
|
||||
|
||||
import { BaseProps } from './types';
|
||||
|
||||
import React, { useCallback, useEffect, useState } from 'react';
|
||||
import Reader from 'react-qr-reader';
|
||||
import styled from 'styled-components';
|
||||
|
||||
import { createImgSize } from './util';
|
||||
|
||||
interface Props extends BaseProps {
|
||||
interface Props {
|
||||
className?: string;
|
||||
delay?: number;
|
||||
onError?: (error: Error) => void;
|
||||
onScan: (data: string) => void;
|
||||
size?: string | number;
|
||||
style?: React.CSSProperties;
|
||||
}
|
||||
|
||||
const DEFAULT_DELAY = 150;
|
||||
|
||||
@@ -2,8 +2,6 @@
|
||||
// This software may be modified and distributed under the terms
|
||||
// of the Apache-2.0 license. See the LICENSE file for details.
|
||||
|
||||
import { BaseProps } from './types';
|
||||
|
||||
import React, { useCallback } from 'react';
|
||||
import { assert } from '@polkadot/util';
|
||||
import { decodeAddress } from '@polkadot/util-crypto';
|
||||
@@ -18,9 +16,12 @@ interface ScanType {
|
||||
name?: string;
|
||||
}
|
||||
|
||||
interface Props extends BaseProps {
|
||||
interface Props {
|
||||
className?: string;
|
||||
onError?: (error: Error) => void;
|
||||
onScan: (scanned: ScanType) => void;
|
||||
size?: string | number;
|
||||
style?: React.CSSProperties;
|
||||
}
|
||||
|
||||
function ScanAddress ({ className, onError, onScan, size, style }: Props): React.ReactElement<Props> {
|
||||
|
||||
@@ -2,8 +2,6 @@
|
||||
// This software may be modified and distributed under the terms
|
||||
// of the Apache-2.0 license. See the LICENSE file for details.
|
||||
|
||||
import { BaseProps } from './types';
|
||||
|
||||
import React, { useCallback } from 'react';
|
||||
|
||||
import QrScan from './Scan';
|
||||
@@ -12,9 +10,12 @@ interface ScanType {
|
||||
signature: string;
|
||||
}
|
||||
|
||||
interface Props extends BaseProps {
|
||||
interface Props {
|
||||
className?: string;
|
||||
onError?: (error: Error) => void;
|
||||
onScan: (scanned: ScanType) => void;
|
||||
size?: string | number;
|
||||
style?: React.CSSProperties;
|
||||
}
|
||||
|
||||
function ScanSignature ({ className, onError, onScan, size, style }: Props): React.ReactElement<Props> {
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
// Copyright 2017-2020 @polkadot/react-qr authors & contributors
|
||||
// This software may be modified and distributed under the terms
|
||||
// of the Apache-2.0 license. See the LICENSE file for details.
|
||||
|
||||
export interface BaseProps {
|
||||
className?: string;
|
||||
size?: string | number;
|
||||
style?: Record<string, string | number>;
|
||||
}
|
||||
Reference in New Issue
Block a user