Skip to content

Commit

Permalink
Add button to the disabled input
Browse files Browse the repository at this point in the history
  • Loading branch information
olegnn committed Aug 30, 2024
1 parent 27c1cfa commit d825d75
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/react-params/src/Param/Text.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import type { Props } from '../types';

import React, { useCallback, useState } from 'react';

import { Input } from '@polkadot/react-components';
import { CopyButton, Input } from '@polkadot/react-components';

import Bare from './Bare';

Expand Down Expand Up @@ -41,7 +41,9 @@ function Text ({ className = '', defaultValue: { value }, isDisabled, isError, l
placeholder='<any string>'
type='text'
withLabel={withLabel}
/>
>
{isDisabled && <CopyButton value={defaultValue} />}
</Input>
</Bare>
);
}
Expand Down
1 change: 1 addition & 0 deletions packages/react-params/src/ParamComp.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import type { ComponentMap, RawParam, RawParamOnChangeValue, RawParams } from '.
import React, { useCallback } from 'react';

import Param from './Param';
import { CopyButton } from '@polkadot/react-components';

interface Props {
defaultValue: RawParam;
Expand Down

0 comments on commit d825d75

Please sign in to comment.