chore: move copy
This commit is contained in:
parent
46c6e27aec
commit
10e30b9f70
@ -1,4 +1,9 @@
|
|||||||
import { TradingRadio } from '@vegaprotocol/ui-toolkit';
|
import {
|
||||||
|
CopyWithTooltip,
|
||||||
|
TradingRadio,
|
||||||
|
VegaIcon,
|
||||||
|
VegaIconNames,
|
||||||
|
} from '@vegaprotocol/ui-toolkit';
|
||||||
import { useEffect, useState } from 'react';
|
import { useEffect, useState } from 'react';
|
||||||
import { CUSTOM_NODE_KEY } from '../../types';
|
import { CUSTOM_NODE_KEY } from '../../types';
|
||||||
import {
|
import {
|
||||||
@ -127,8 +132,17 @@ export const RowData = ({
|
|||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
{id !== CUSTOM_NODE_KEY && (
|
{id !== CUSTOM_NODE_KEY && (
|
||||||
<div className="break-all" data-testid="node">
|
<div className="break-all flex gap-2" data-testid="node">
|
||||||
<TradingRadio id={`node-url-${id}`} value={url} label={url} />
|
<TradingRadio id={`node-url-${id}`} value={url} label={url} />
|
||||||
|
{url.length > 0 && url !== 'custom' && (
|
||||||
|
<span className="text-muted">
|
||||||
|
<CopyWithTooltip text={url}>
|
||||||
|
<button>
|
||||||
|
<VegaIcon name={VegaIconNames.COPY} />
|
||||||
|
</button>
|
||||||
|
</CopyWithTooltip>
|
||||||
|
</span>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
<LayoutCell
|
<LayoutCell
|
||||||
|
@ -3,8 +3,6 @@ import * as RadioGroupPrimitive from '@radix-ui/react-radio-group';
|
|||||||
import classNames from 'classnames';
|
import classNames from 'classnames';
|
||||||
import type { ReactNode } from 'react';
|
import type { ReactNode } from 'react';
|
||||||
import { labelClasses } from '../checkbox';
|
import { labelClasses } from '../checkbox';
|
||||||
import { CopyWithTooltip } from '../copy-with-tooltip';
|
|
||||||
import { VegaIcon, VegaIconNames } from '../icon';
|
|
||||||
|
|
||||||
export interface TradingRadioGroupProps {
|
export interface TradingRadioGroupProps {
|
||||||
name?: string;
|
name?: string;
|
||||||
@ -88,36 +86,25 @@ export const TradingRadio = ({
|
|||||||
'border-vega-clight-700 dark:border-vega-cdark-700'
|
'border-vega-clight-700 dark:border-vega-cdark-700'
|
||||||
);
|
);
|
||||||
return (
|
return (
|
||||||
<span className="inline-flex gap-2">
|
<label className={wrapperClasses} htmlFor={id}>
|
||||||
<label className={wrapperClasses} htmlFor={id}>
|
<RadioGroupPrimitive.Item
|
||||||
<RadioGroupPrimitive.Item
|
value={value}
|
||||||
value={value}
|
className={itemClasses}
|
||||||
className={itemClasses}
|
id={id}
|
||||||
id={id}
|
data-testid={id}
|
||||||
data-testid={id}
|
disabled={disabled}
|
||||||
disabled={disabled}
|
>
|
||||||
>
|
<RadioGroupPrimitive.Indicator className={indicatorClasses} />
|
||||||
<RadioGroupPrimitive.Indicator className={indicatorClasses} />
|
</RadioGroupPrimitive.Item>
|
||||||
</RadioGroupPrimitive.Item>
|
<span
|
||||||
<span
|
className={
|
||||||
className={
|
disabled
|
||||||
disabled
|
? 'text-vega-clight-200 dark:text-vega-cdark-200'
|
||||||
? 'text-vega-clight-200 dark:text-vega-cdark-200'
|
: 'cursor-pointer'
|
||||||
: 'cursor-pointer'
|
}
|
||||||
}
|
>
|
||||||
>
|
{label}
|
||||||
{label}
|
</span>
|
||||||
</span>
|
</label>
|
||||||
</label>
|
|
||||||
{value && value !== 'custom' && (
|
|
||||||
<span className="text-muted">
|
|
||||||
<CopyWithTooltip text={value}>
|
|
||||||
<button>
|
|
||||||
<VegaIcon name={VegaIconNames.COPY} />
|
|
||||||
</button>
|
|
||||||
</CopyWithTooltip>
|
|
||||||
</span>
|
|
||||||
)}
|
|
||||||
</span>
|
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user