mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-14 21:27:20 +00:00
feat(core): support one time password (#9798)
This commit is contained in:
@@ -1,25 +0,0 @@
|
||||
import type { HTMLAttributes } from 'react';
|
||||
import { forwardRef } from 'react';
|
||||
|
||||
const formatTime = (time: number): string => {
|
||||
const minutes = Math.floor(time / 60);
|
||||
const seconds = time % 60;
|
||||
|
||||
const formattedMinutes = minutes.toString().padStart(2, '0');
|
||||
const formattedSeconds = seconds.toString().padStart(2, '0');
|
||||
|
||||
return `${formattedMinutes}:${formattedSeconds}`;
|
||||
};
|
||||
|
||||
export const CountDownRender = forwardRef<
|
||||
HTMLDivElement,
|
||||
{ timeLeft: number } & HTMLAttributes<HTMLDivElement>
|
||||
>(({ timeLeft, ...props }, ref) => {
|
||||
return (
|
||||
<div {...props} ref={ref}>
|
||||
{formatTime(timeLeft)}
|
||||
</div>
|
||||
);
|
||||
});
|
||||
|
||||
CountDownRender.displayName = 'CountDownRender';
|
||||
@@ -4,7 +4,6 @@ export * from './auth-page-container';
|
||||
export * from './back-button';
|
||||
export * from './change-email-page';
|
||||
export * from './change-password-page';
|
||||
export * from './count-down-render';
|
||||
export * from './modal-header';
|
||||
export * from './onboarding-page';
|
||||
export * from './password-input';
|
||||
|
||||
Reference in New Issue
Block a user