chore: move copy

This commit is contained in:
asiaznik 2024-03-07 12:17:50 +01:00
parent 46c6e27aec
commit 10e30b9f70
No known key found for this signature in database
GPG Key ID: 4D5C8972A02C52C2
2 changed files with 36 additions and 35 deletions

View File

@ -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

View File

@ -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,7 +86,6 @@ 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}
@ -109,15 +106,5 @@ export const TradingRadio = ({
{label}
</span>
</label>
{value && value !== 'custom' && (
<span className="text-muted">
<CopyWithTooltip text={value}>
<button>
<VegaIcon name={VegaIconNames.COPY} />
</button>
</CopyWithTooltip>
</span>
)}
</span>
);
};