Copy on "type to confirm" dialog

This commit is contained in:
Gregory Schier
2025-10-28 06:15:44 -07:00
parent 99a6c38632
commit a9e05ae988
2 changed files with 15 additions and 4 deletions

View File

@@ -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>
} }
/> />
)} )}

View File

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