* ui-signer pureComponentify * ui-react pureCompify * Status queue prop * ui-app Button * ui-app InputExtrinsic * apps, app-rpc, ui-app, ui-react * app-extrinsics, app-explorer, apps * fixes for tslint * more linter fixes * Update index.tsx * Update index.tsx * Update Nonce.tsx * Update index.tsx * Update Results.tsx * Update index.tsx * Update Queries.tsx * Update NodeInfo.tsx * Update index.tsx * Update Item.tsx * style fixes * TSLINTs
46 lines
1.0 KiB
TypeScript
46 lines
1.0 KiB
TypeScript
// Copyright 2017-2018 @polkadot/app-storage authors & contributors
|
|
// This software may be modified and distributed under the terms
|
|
// of the ISC license. See the LICENSE file for details.
|
|
|
|
import { I18nProps } from '@polkadot/ui-app/types';
|
|
import { StorageQuery } from './types';
|
|
|
|
import React from 'react';
|
|
|
|
import classes from '@polkadot/ui-app/util/classes';
|
|
|
|
import translate from './translate';
|
|
import Query from './Query';
|
|
|
|
type Props = I18nProps & {
|
|
onRemove: (id: number) => void,
|
|
value?: Array<StorageQuery>
|
|
};
|
|
|
|
class Queries extends React.PureComponent<Props> {
|
|
render () {
|
|
const { className, onRemove, style, value } = this.props;
|
|
|
|
if (!value || !value.length) {
|
|
return null;
|
|
}
|
|
|
|
return (
|
|
<div
|
|
className={classes('storage--Queries', className)}
|
|
style={style}
|
|
>
|
|
{value.map((query) =>
|
|
<Query
|
|
key={query.id}
|
|
onRemove={onRemove}
|
|
value={query}
|
|
/>
|
|
)}
|
|
</div>
|
|
);
|
|
}
|
|
}
|
|
|
|
export default translate(Queries);
|