* feat: improve 2fa styles based on feedback * fix: preferences panes and dialogs electron compatibility * fix: no horizontal line when opening two factor activation * feat: improve two factor activation styles * feat: further 2fa style improvements * feat: padding 2fa widgets * feat: add padding between QR code and content * feat: refresh 2fa after passcode confirmation * feat: don't autocomplete passwords for DecoratedInput
24 lines
606 B
TypeScript
24 lines
606 B
TypeScript
import { FunctionComponent } from 'preact';
|
|
|
|
import { IconButton } from '../../../components/IconButton';
|
|
|
|
import { useState } from 'preact/hooks';
|
|
|
|
export const CopyButton: FunctionComponent<{ copyValue: string }> = ({
|
|
copyValue: secretKey,
|
|
}) => {
|
|
const [isCopied, setCopied] = useState(false);
|
|
return (
|
|
<IconButton
|
|
focusable={false}
|
|
title="Copy to clipboard"
|
|
icon={isCopied ? 'check' : 'copy'}
|
|
className={isCopied ? 'success' : undefined}
|
|
onClick={() => {
|
|
navigator?.clipboard?.writeText(secretKey);
|
|
setCopied(() => true);
|
|
}}
|
|
/>
|
|
);
|
|
};
|