diff --git a/packages/react-params/src/Holder.tsx b/packages/react-params/src/Holder.tsx index e5b82702a1..43aa963a67 100644 --- a/packages/react-params/src/Holder.tsx +++ b/packages/react-params/src/Holder.tsx @@ -1,4 +1,4 @@ -// Copyright 2017-2020 @polkadot/react-components authors & contributors +// Copyright 2017-2020 @polkadot/react-params authors & contributors // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. diff --git a/packages/react-params/src/Param/Account.tsx b/packages/react-params/src/Param/Account.tsx index c6101d1f41..cecdc6016b 100644 --- a/packages/react-params/src/Param/Account.tsx +++ b/packages/react-params/src/Param/Account.tsx @@ -1,4 +1,4 @@ -// Copyright 2017-2020 @polkadot/react-components authors & contributors +// Copyright 2017-2020 @polkadot/react-params authors & contributors // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. diff --git a/packages/react-params/src/Param/Amount.tsx b/packages/react-params/src/Param/Amount.tsx index 2844bcc489..f55c5351e2 100644 --- a/packages/react-params/src/Param/Amount.tsx +++ b/packages/react-params/src/Param/Amount.tsx @@ -1,4 +1,4 @@ -// Copyright 2017-2020 @polkadot/react-components authors & contributors +// Copyright 2017-2020 @polkadot/react-params authors & contributors // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. diff --git a/packages/react-params/src/Param/Balance.tsx b/packages/react-params/src/Param/Balance.tsx index 59f04fef30..ad41480832 100644 --- a/packages/react-params/src/Param/Balance.tsx +++ b/packages/react-params/src/Param/Balance.tsx @@ -1,4 +1,4 @@ -// Copyright 2017-2020 @polkadot/react-components authors & contributors +// Copyright 2017-2020 @polkadot/react-params authors & contributors // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. diff --git a/packages/react-params/src/Param/Bare.tsx b/packages/react-params/src/Param/Bare.tsx index be1bfbb4bc..60da1d93cd 100644 --- a/packages/react-params/src/Param/Bare.tsx +++ b/packages/react-params/src/Param/Bare.tsx @@ -1,4 +1,4 @@ -// Copyright 2017-2020 @polkadot/react-components authors & contributors +// Copyright 2017-2020 @polkadot/react-params authors & contributors // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. diff --git a/packages/react-params/src/Param/Base.tsx b/packages/react-params/src/Param/Base.tsx index c9e0ac127e..21c9ca4cd4 100644 --- a/packages/react-params/src/Param/Base.tsx +++ b/packages/react-params/src/Param/Base.tsx @@ -1,4 +1,4 @@ -// Copyright 2017-2020 @polkadot/react-components authors & contributors +// Copyright 2017-2020 @polkadot/react-params authors & contributors // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. diff --git a/packages/react-params/src/Param/BaseBytes.tsx b/packages/react-params/src/Param/BaseBytes.tsx index 28b31c43e8..ac8e769e0b 100644 --- a/packages/react-params/src/Param/BaseBytes.tsx +++ b/packages/react-params/src/Param/BaseBytes.tsx @@ -1,4 +1,4 @@ -// Copyright 2017-2020 @polkadot/react-components authors & contributors +// Copyright 2017-2020 @polkadot/react-params authors & contributors // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. diff --git a/packages/react-params/src/Param/Bool.tsx b/packages/react-params/src/Param/Bool.tsx index a65847bc95..ca2ab8fea8 100644 --- a/packages/react-params/src/Param/Bool.tsx +++ b/packages/react-params/src/Param/Bool.tsx @@ -1,4 +1,4 @@ -// Copyright 2017-2020 @polkadot/react-components authors & contributors +// Copyright 2017-2020 @polkadot/react-params authors & contributors // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. diff --git a/packages/react-params/src/Param/Bytes.tsx b/packages/react-params/src/Param/Bytes.tsx index 0e76d7f881..f08d770a8e 100644 --- a/packages/react-params/src/Param/Bytes.tsx +++ b/packages/react-params/src/Param/Bytes.tsx @@ -1,4 +1,4 @@ -// Copyright 2017-2020 @polkadot/react-components authors & contributors +// Copyright 2017-2020 @polkadot/react-params authors & contributors // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. diff --git a/packages/react-params/src/Param/Call.tsx b/packages/react-params/src/Param/Call.tsx index 6482c4fe39..4a8658099f 100644 --- a/packages/react-params/src/Param/Call.tsx +++ b/packages/react-params/src/Param/Call.tsx @@ -1,4 +1,4 @@ -// Copyright 2017-2020 @polkadot/react-components authors & contributors +// Copyright 2017-2020 @polkadot/react-params authors & contributors // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. diff --git a/packages/react-params/src/Param/Code.tsx b/packages/react-params/src/Param/Code.tsx index 44385e9e88..ecb8fdcf6c 100644 --- a/packages/react-params/src/Param/Code.tsx +++ b/packages/react-params/src/Param/Code.tsx @@ -1,4 +1,4 @@ -// Copyright 2017-2020 @polkadot/react-components authors & contributors +// Copyright 2017-2020 @polkadot/react-params authors & contributors // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. diff --git a/packages/react-params/src/Param/DispatchError.tsx b/packages/react-params/src/Param/DispatchError.tsx index 7a73f0439c..25c6094e51 100644 --- a/packages/react-params/src/Param/DispatchError.tsx +++ b/packages/react-params/src/Param/DispatchError.tsx @@ -1,4 +1,4 @@ -// Copyright 2017-2020 @polkadot/react-components authors & contributors +// Copyright 2017-2020 @polkadot/react-params authors & contributors // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. diff --git a/packages/react-params/src/Param/Enum.tsx b/packages/react-params/src/Param/Enum.tsx index bb20597e6c..eefe4527b0 100644 --- a/packages/react-params/src/Param/Enum.tsx +++ b/packages/react-params/src/Param/Enum.tsx @@ -1,4 +1,4 @@ -// Copyright 2017-2020 @polkadot/react-components authors & contributors +// Copyright 2017-2020 @polkadot/react-params authors & contributors // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. diff --git a/packages/react-params/src/Param/File.tsx b/packages/react-params/src/Param/File.tsx index e495c2ebed..65086772c9 100644 --- a/packages/react-params/src/Param/File.tsx +++ b/packages/react-params/src/Param/File.tsx @@ -1,4 +1,4 @@ -// Copyright 2017-2020 @polkadot/react-components authors & contributors +// Copyright 2017-2020 @polkadot/react-params authors & contributors // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. diff --git a/packages/react-params/src/Param/Hash256.tsx b/packages/react-params/src/Param/Hash256.tsx index 442239776f..585cbfff64 100644 --- a/packages/react-params/src/Param/Hash256.tsx +++ b/packages/react-params/src/Param/Hash256.tsx @@ -1,4 +1,4 @@ -// Copyright 2017-2020 @polkadot/react-components authors & contributors +// Copyright 2017-2020 @polkadot/react-params authors & contributors // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. diff --git a/packages/react-params/src/Param/Hash512.tsx b/packages/react-params/src/Param/Hash512.tsx index c29374fafb..d6a3f0ae0d 100644 --- a/packages/react-params/src/Param/Hash512.tsx +++ b/packages/react-params/src/Param/Hash512.tsx @@ -1,4 +1,4 @@ -// Copyright 2017-2020 @polkadot/react-components authors & contributors +// Copyright 2017-2020 @polkadot/react-params authors & contributors // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. diff --git a/packages/react-params/src/Param/KeyValue.tsx b/packages/react-params/src/Param/KeyValue.tsx index e6442a9e6b..b0e8f48e67 100644 --- a/packages/react-params/src/Param/KeyValue.tsx +++ b/packages/react-params/src/Param/KeyValue.tsx @@ -1,4 +1,4 @@ -// Copyright 2017-2020 @polkadot/react-components authors & contributors +// Copyright 2017-2020 @polkadot/react-params authors & contributors // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. diff --git a/packages/react-params/src/Param/KeyValueArray.tsx b/packages/react-params/src/Param/KeyValueArray.tsx index 9044672c73..1feae19780 100644 --- a/packages/react-params/src/Param/KeyValueArray.tsx +++ b/packages/react-params/src/Param/KeyValueArray.tsx @@ -1,4 +1,4 @@ -// Copyright 2017-2020 @polkadot/react-components authors & contributors +// Copyright 2017-2020 @polkadot/react-params authors & contributors // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. diff --git a/packages/react-params/src/Param/Moment.tsx b/packages/react-params/src/Param/Moment.tsx index 5469cbbe0e..9773c3a597 100644 --- a/packages/react-params/src/Param/Moment.tsx +++ b/packages/react-params/src/Param/Moment.tsx @@ -1,4 +1,4 @@ -// Copyright 2017-2020 @polkadot/react-components authors & contributors +// Copyright 2017-2020 @polkadot/react-params authors & contributors // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. diff --git a/packages/react-params/src/Param/Null.tsx b/packages/react-params/src/Param/Null.tsx index 06ea48877c..4249496aa9 100644 --- a/packages/react-params/src/Param/Null.tsx +++ b/packages/react-params/src/Param/Null.tsx @@ -1,4 +1,4 @@ -// Copyright 2017-2020 @polkadot/react-components authors & contributors +// Copyright 2017-2020 @polkadot/react-params authors & contributors // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. diff --git a/packages/react-params/src/Param/OpaqueCall.tsx b/packages/react-params/src/Param/OpaqueCall.tsx index fe015fae7c..f33337e14c 100644 --- a/packages/react-params/src/Param/OpaqueCall.tsx +++ b/packages/react-params/src/Param/OpaqueCall.tsx @@ -1,4 +1,4 @@ -// Copyright 2017-2020 @polkadot/react-components authors & contributors +// Copyright 2017-2020 @polkadot/react-params authors & contributors // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. diff --git a/packages/react-params/src/Param/Option.tsx b/packages/react-params/src/Param/Option.tsx index d452655040..fe9bc4a7d3 100644 --- a/packages/react-params/src/Param/Option.tsx +++ b/packages/react-params/src/Param/Option.tsx @@ -1,4 +1,4 @@ -// Copyright 2017-2020 @polkadot/react-components authors & contributors +// Copyright 2017-2020 @polkadot/react-params authors & contributors // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. diff --git a/packages/react-params/src/Param/Raw.tsx b/packages/react-params/src/Param/Raw.tsx index 5e5b1132c3..d3f2062ec0 100644 --- a/packages/react-params/src/Param/Raw.tsx +++ b/packages/react-params/src/Param/Raw.tsx @@ -1,4 +1,4 @@ -// Copyright 2017-2020 @polkadot/react-components authors & contributors +// Copyright 2017-2020 @polkadot/react-params authors & contributors // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. diff --git a/packages/react-params/src/Param/Static.tsx b/packages/react-params/src/Param/Static.tsx index b0940a2358..6b9b70c4df 100644 --- a/packages/react-params/src/Param/Static.tsx +++ b/packages/react-params/src/Param/Static.tsx @@ -1,4 +1,4 @@ -// Copyright 2017-2020 @polkadot/react-components authors & contributors +// Copyright 2017-2020 @polkadot/react-params authors & contributors // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. diff --git a/packages/react-params/src/Param/Struct.tsx b/packages/react-params/src/Param/Struct.tsx index 9d2c8844db..fd4805dd5b 100644 --- a/packages/react-params/src/Param/Struct.tsx +++ b/packages/react-params/src/Param/Struct.tsx @@ -1,4 +1,4 @@ -// Copyright 2017-2020 @polkadot/react-components authors & contributors +// Copyright 2017-2020 @polkadot/react-params authors & contributors // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. diff --git a/packages/react-params/src/Param/Text.tsx b/packages/react-params/src/Param/Text.tsx index 2b855140db..3547a3fe16 100644 --- a/packages/react-params/src/Param/Text.tsx +++ b/packages/react-params/src/Param/Text.tsx @@ -1,4 +1,4 @@ -// Copyright 2017-2020 @polkadot/react-components authors & contributors +// Copyright 2017-2020 @polkadot/react-params authors & contributors // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. diff --git a/packages/react-params/src/Param/Tuple.tsx b/packages/react-params/src/Param/Tuple.tsx index f1c2e980c2..3431946d5c 100644 --- a/packages/react-params/src/Param/Tuple.tsx +++ b/packages/react-params/src/Param/Tuple.tsx @@ -1,4 +1,4 @@ -// Copyright 2017-2020 @polkadot/react-components authors & contributors +// Copyright 2017-2020 @polkadot/react-params authors & contributors // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. diff --git a/packages/react-params/src/Param/Unknown.tsx b/packages/react-params/src/Param/Unknown.tsx index 1be8965a3f..9cc9bf7a53 100644 --- a/packages/react-params/src/Param/Unknown.tsx +++ b/packages/react-params/src/Param/Unknown.tsx @@ -1,4 +1,4 @@ -// Copyright 2017-2020 @polkadot/react-components authors & contributors +// Copyright 2017-2020 @polkadot/react-params authors & contributors // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. diff --git a/packages/react-params/src/Param/Vector.tsx b/packages/react-params/src/Param/Vector.tsx index 3b1f238a2e..760440b063 100644 --- a/packages/react-params/src/Param/Vector.tsx +++ b/packages/react-params/src/Param/Vector.tsx @@ -1,4 +1,4 @@ -// Copyright 2017-2020 @polkadot/react-components authors & contributors +// Copyright 2017-2020 @polkadot/react-params authors & contributors // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. diff --git a/packages/react-params/src/Param/VectorFixed.tsx b/packages/react-params/src/Param/VectorFixed.tsx new file mode 100644 index 0000000000..979a747c0c --- /dev/null +++ b/packages/react-params/src/Param/VectorFixed.tsx @@ -0,0 +1,100 @@ +// Copyright 2017-2020 @polkadot/react-params authors & contributors +// This software may be modified and distributed under the terms +// of the Apache-2.0 license. See the LICENSE file for details. + +import { ParamDef, Props, RawParam } from '../types'; + +import React, { useEffect, useState } from 'react'; +import { isUndefined } from '@polkadot/util'; + +import getInitValue from '../initValue'; +import Params from '../'; +import Base from './Base'; +import useParamDefs from './useParamDefs'; + +function generateParam ([{ name, type }]: ParamDef[], index: number): ParamDef { + return { + name: `${index}: ${name || type.type}`, + type + }; +} + +function VectorFixed ({ className = '', defaultValue, isDisabled = false, label, onChange, overrides, type, withLabel }: Props): React.ReactElement | null { + const inputParams = useParamDefs(type); + const [params, setParams] = useState([]); + const [values, setValues] = useState([]); + + // build up the list of parameters we are using + useEffect((): void => { + if (inputParams.length) { + const count = (inputParams[0].length || 1); + const max = isDisabled ? (defaultValue.value as RawParam[] || []).length : count; + const params: ParamDef[] = []; + + for (let index = 0; index < max; index++) { + params.push(generateParam(inputParams, index)); + } + + setParams(params); + } + }, [defaultValue, isDisabled, inputParams]); + + // when !isDisable, generating an input list based on count + useEffect((): void => { + !isDisabled && inputParams.length && + setValues((values): RawParam[] => { + const count = (inputParams[0].length || 1); + + if (values.length === count) { + return values; + } + + while (values.length < count) { + const value = getInitValue(inputParams[0].type); + + values.push({ isValid: !isUndefined(value), value }); + } + + return values.slice(0, count); + }); + }, [inputParams, isDisabled]); + + // when isDisabled, set the values based on the defaultValue input + useEffect((): void => { + isDisabled && + setValues( + (defaultValue.value as RawParam[] || []).map((value: RawParam) => + isUndefined(value) || isUndefined(value.isValid) + ? { isValid: !isUndefined(value), value } + : value + ) + ); + }, [defaultValue, isDisabled]); + + // when our values has changed, alert upstream + useEffect((): void => { + onChange && onChange({ + isValid: values.reduce((result: boolean, { isValid }) => result && isValid, true), + value: values.map(({ value }) => value) + }); + }, [values, onChange]); + + return ( + + + + ); +} + +export default React.memo(VectorFixed); diff --git a/packages/react-params/src/Param/Vote.tsx b/packages/react-params/src/Param/Vote.tsx index 442d6b0d5d..6d4c80c77b 100644 --- a/packages/react-params/src/Param/Vote.tsx +++ b/packages/react-params/src/Param/Vote.tsx @@ -1,4 +1,4 @@ -// Copyright 2017-2020 @polkadot/react-components authors & contributors +// Copyright 2017-2020 @polkadot/react-params authors & contributors // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. diff --git a/packages/react-params/src/Param/VoteThreshold.tsx b/packages/react-params/src/Param/VoteThreshold.tsx index 837d4a30aa..7550c2035a 100644 --- a/packages/react-params/src/Param/VoteThreshold.tsx +++ b/packages/react-params/src/Param/VoteThreshold.tsx @@ -1,4 +1,4 @@ -// Copyright 2017-2020 @polkadot/react-components authors & contributors +// Copyright 2017-2020 @polkadot/react-params authors & contributors // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. diff --git a/packages/react-params/src/Param/findComponent.ts b/packages/react-params/src/Param/findComponent.ts index 34e29b0dc4..5a286c06ac 100644 --- a/packages/react-params/src/Param/findComponent.ts +++ b/packages/react-params/src/Param/findComponent.ts @@ -1,4 +1,4 @@ -// Copyright 2017-2020 @polkadot/react-components authors & contributors +// Copyright 2017-2020 @polkadot/react-params authors & contributors // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. @@ -6,7 +6,7 @@ import { TypeDef, TypeDefInfo } from '@polkadot/types/types'; import { Props, ComponentMap } from '../types'; import { registry } from '@polkadot/react-api'; -import { createType, getTypeDef, SPECIAL_TYPES } from '@polkadot/types'; +import { getTypeDef, SPECIAL_TYPES } from '@polkadot/types'; import { isBn } from '@polkadot/util'; import Account from './Account'; @@ -32,6 +32,7 @@ import Text from './Text'; import Tuple from './Tuple'; import Unknown from './Unknown'; import Vector from './Vector'; +import VectorFixed from './VectorFixed'; import Vote from './Vote'; import VoteThreshold from './VoteThreshold'; @@ -63,6 +64,7 @@ const componentDef: TypeToComponent[] = [ { c: Struct, t: ['Struct'] }, { c: Tuple, t: ['Tuple'] }, { c: Vector, t: ['Vec'] }, + { c: VectorFixed, t: ['VecFixed'] }, { c: Vote, t: ['Vote'] }, { c: VoteThreshold, t: ['VoteThreshold'] }, { c: Unknown, t: ['Unknown'] } @@ -112,6 +114,9 @@ function fromDef ({ displayName, info, sub, type }: TypeDef): string { ? 'Vec' : 'Vec'; + case TypeDefInfo.VecFixed: + return 'VecFixed'; + default: return type; } @@ -121,14 +126,13 @@ export default function findComponent (def: TypeDef, overrides: ComponentMap = { const findOne = (type: string): React.ComponentType | null => overrides[type] || components[type]; const type = fromDef(def); - let Component = findOne(type); if (!Component) { let error: string | null = null; try { - const instance = createType(registry, type as 'u32'); + const instance = registry.createType(type as 'u32'); const raw = getTypeDef(instance.toRawType()); Component = findOne(raw.type); @@ -139,6 +143,8 @@ export default function findComponent (def: TypeDef, overrides: ComponentMap = { return Amount; } else if ([TypeDefInfo.Enum, TypeDefInfo.Struct, TypeDefInfo.Tuple].includes(raw.info)) { return findComponent(raw, overrides); + } else if (raw.info === TypeDefInfo.VecFixed && (raw.sub as TypeDef).type !== 'u8') { + return findComponent(raw, overrides); } } catch (e) { error = (e as Error).message; diff --git a/packages/react-params/src/Param/index.tsx b/packages/react-params/src/Param/index.tsx index e9d1acff2f..fab4cdb1a1 100644 --- a/packages/react-params/src/Param/index.tsx +++ b/packages/react-params/src/Param/index.tsx @@ -1,4 +1,4 @@ -// Copyright 2017-2020 @polkadot/react-components authors & contributors +// Copyright 2017-2020 @polkadot/react-params authors & contributors // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. diff --git a/packages/react-params/src/Param/useParamDefs.ts b/packages/react-params/src/Param/useParamDefs.ts index 17280664fb..5fc8b1f8ff 100644 --- a/packages/react-params/src/Param/useParamDefs.ts +++ b/packages/react-params/src/Param/useParamDefs.ts @@ -1,4 +1,4 @@ -// Copyright 2017-2020 @polkadot/react-components authors & contributors +// Copyright 2017-2020 @polkadot/react-params authors & contributors // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. @@ -31,6 +31,7 @@ export default function useParamDefs (type: TypeDef): ParamDef[] { setParams( (Array.isArray(typeDef.sub) ? typeDef.sub : [typeDef.sub]).map((td): ParamDef => ({ + length: typeDef.length, name: td.name, type: td // expandDef(td) })) diff --git a/packages/react-params/src/ParamComp.tsx b/packages/react-params/src/ParamComp.tsx index cd13ea3bc9..a8a15ed8c0 100644 --- a/packages/react-params/src/ParamComp.tsx +++ b/packages/react-params/src/ParamComp.tsx @@ -1,4 +1,4 @@ -// Copyright 2017-2020 @polkadot/react-components authors & contributors +// Copyright 2017-2020 @polkadot/react-params authors & contributors // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. diff --git a/packages/react-params/src/index.tsx b/packages/react-params/src/index.tsx index 602558bc71..588966e49f 100644 --- a/packages/react-params/src/index.tsx +++ b/packages/react-params/src/index.tsx @@ -1,4 +1,4 @@ -// Copyright 2017-2020 @polkadot/react-components authors & contributors +// Copyright 2017-2020 @polkadot/react-params authors & contributors // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. diff --git a/packages/react-params/src/initValue.ts b/packages/react-params/src/initValue.ts index 95f2db875d..52ecaa40d9 100644 --- a/packages/react-params/src/initValue.ts +++ b/packages/react-params/src/initValue.ts @@ -1,4 +1,4 @@ -// Copyright 2017-2020 @polkadot/react-components authors & contributors +// Copyright 2017-2020 @polkadot/react-params authors & contributors // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. diff --git a/packages/react-params/src/translate.ts b/packages/react-params/src/translate.ts index 5b199a4187..5d34b0acdf 100644 --- a/packages/react-params/src/translate.ts +++ b/packages/react-params/src/translate.ts @@ -1,4 +1,4 @@ -// Copyright 2017-2020 @polkadot/react-components authors & contributors +// Copyright 2017-2020 @polkadot/react-params authors & contributors // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. diff --git a/packages/react-params/src/types.ts b/packages/react-params/src/types.ts index 673551679f..b028d6ab1c 100644 --- a/packages/react-params/src/types.ts +++ b/packages/react-params/src/types.ts @@ -1,4 +1,4 @@ -// Copyright 2017-2020 @polkadot/react-components authors & contributors +// Copyright 2017-2020 @polkadot/react-params authors & contributors // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. @@ -51,6 +51,7 @@ export type Size = 'full' | 'large' | 'medium' | 'small'; export type ComponentMap = Record>; export interface ParamDef { + length?: number; name?: string; type: TypeDef; } diff --git a/packages/react-params/src/valueToText.tsx b/packages/react-params/src/valueToText.tsx index 36056c922b..27af8bc617 100644 --- a/packages/react-params/src/valueToText.tsx +++ b/packages/react-params/src/valueToText.tsx @@ -1,4 +1,4 @@ -// Copyright 2017-2020 @polkadot/react-components authors & contributors +// Copyright 2017-2020 @polkadot/react-params authors & contributors // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. diff --git a/packages/react-params/src/values.ts b/packages/react-params/src/values.ts index b6761adc86..f05c95e164 100644 --- a/packages/react-params/src/values.ts +++ b/packages/react-params/src/values.ts @@ -1,4 +1,4 @@ -// Copyright 2017-2020 @polkadot/react-components authors & contributors +// Copyright 2017-2020 @polkadot/react-params authors & contributors // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details.