Files

17 lines
444 B
TypeScript
Raw Permalink Normal View History

2017-12-18 16:23:31 -05:00
import React from 'react';
2017-12-18 16:23:31 -05:00
import { Query, Param } from './Query';
interface Props {
whenQueryExists: React.ReactElement<any> | null;
}
2017-12-18 18:29:26 -05:00
const params: Param[] = ['to', 'data', 'tokenSymbol', 'value', 'gaslimit', 'limit', 'readOnly'];
2017-12-18 16:23:31 -05:00
export const WhenQueryExists: React.SFC<Props> = ({ whenQueryExists }) => (
<Query
params={params}
2017-12-18 18:29:26 -05:00
withQuery={queries => (Object.values(queries).some(v => !!v) ? whenQueryExists : null)}
2017-12-18 16:23:31 -05:00
/>
);