Add ripple

This commit is contained in:
Vishnu 2023-04-14 13:52:35 +05:30
parent da84f50428
commit f6c2865a75

View file

@ -3,6 +3,7 @@ import { TOTP, HOTP } from 'otpauth';
import { Code } from 'types/authenticator/code';
import TimerProgress from './TimerProgress';
import { t } from 'i18next';
import { ButtonBase } from '@mui/material';
const TOTPDisplay = ({ issuer, account, code, nextCode }) => {
return (
@ -173,19 +174,21 @@ const OTPDisplay = (props: OTPDisplayProps) => {
}, [codeInfo]);
return (
<div
style={{ padding: '8px' }}
onClick={() => {
navigator.clipboard.writeText(code);
}}>
<div style={{ padding: '8px' }}>
<TimerProgress period={codeInfo.period ?? Code.defaultPeriod} />
{codeErr === '' ? (
<TOTPDisplay
issuer={codeInfo.issuer}
account={codeInfo.account}
code={code}
nextCode={nextCode}
/>
<ButtonBase
component="div"
onClick={() => {
navigator.clipboard.writeText(code);
}}>
<TOTPDisplay
issuer={codeInfo.issuer}
account={codeInfo.account}
code={code}
nextCode={nextCode}
/>
</ButtonBase>
) : (
<BadCodeInfo codeInfo={codeInfo} codeErr={codeErr} />
)}