mirror of
https://github.com/status-im/MyCrypto.git
synced 2025-02-17 05:26:36 +00:00
26 lines
468 B
TypeScript
26 lines
468 B
TypeScript
|
import React from 'react';
|
||
|
import { Query, Param } from './Query';
|
||
|
|
||
|
interface Props {
|
||
|
whenQueryExists: React.ReactElement<any> | null;
|
||
|
}
|
||
|
|
||
|
const params: Param[] = [
|
||
|
'to',
|
||
|
'data',
|
||
|
'tokenSymbol',
|
||
|
'value',
|
||
|
'gaslimit',
|
||
|
'limit',
|
||
|
'readOnly'
|
||
|
];
|
||
|
|
||
|
export const WhenQueryExists: React.SFC<Props> = ({ whenQueryExists }) => (
|
||
|
<Query
|
||
|
params={params}
|
||
|
withQuery={queries =>
|
||
|
Object.values(queries).some(v => !!v) ? whenQueryExists : null
|
||
|
}
|
||
|
/>
|
||
|
);
|