mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-04-25 10:18:31 +02:00
Copy on "type to confirm" dialog
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
import type { Color } from '@yaakapp-internal/plugins';
|
import type { Color } from '@yaakapp-internal/plugins';
|
||||||
import type { FormEvent } from 'react';
|
import type { FormEvent } from 'react';
|
||||||
import { useState } from 'react';
|
import { useState } from 'react';
|
||||||
|
import { CopyIconButton } from '../CopyIconButton';
|
||||||
import { Button } from './Button';
|
import { Button } from './Button';
|
||||||
import { PlainInput } from './PlainInput';
|
import { PlainInput } from './PlainInput';
|
||||||
import { HStack } from './Stacks';
|
import { HStack } from './Stacks';
|
||||||
@@ -42,10 +43,20 @@ export function Confirm({
|
|||||||
<PlainInput
|
<PlainInput
|
||||||
autoFocus
|
autoFocus
|
||||||
onChange={setConfirm}
|
onChange={setConfirm}
|
||||||
|
placeholder={requireTyping}
|
||||||
label={
|
label={
|
||||||
<>
|
<div className="flex items-center justify-between">
|
||||||
Type <strong className="!select-auto cursor-auto">{requireTyping}</strong> to confirm
|
<p>
|
||||||
</>
|
Type <strong>{requireTyping}</strong> to confirm
|
||||||
|
</p>
|
||||||
|
<CopyIconButton
|
||||||
|
text={requireTyping}
|
||||||
|
title="Copy name"
|
||||||
|
className="text-text-subtlest ml-auto"
|
||||||
|
iconSize="sm"
|
||||||
|
size="2xs"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ export function Label({
|
|||||||
)}
|
)}
|
||||||
{...props}
|
{...props}
|
||||||
>
|
>
|
||||||
<span>
|
<span className="inline-block w-full">
|
||||||
{children}
|
{children}
|
||||||
{required === true && <span className="text-text-subtlest">*</span>}
|
{required === true && <span className="text-text-subtlest">*</span>}
|
||||||
</span>
|
</span>
|
||||||
|
|||||||
Reference in New Issue
Block a user