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