feat: add digits input, complete signin form

This commit is contained in:
Sajad Mirjalili
2025-07-22 18:42:54 +03:30
parent 83c3f05e68
commit d2efafa5a9
12 changed files with 652 additions and 142 deletions

View File

@@ -0,0 +1,44 @@
import { useTranslation } from 'react-i18next';
import { Box, Button, Typography } from '@mui/material';
import { Edit2 } from 'iconsax-reactjs';
import DigitInput from '@/components/components/DigitsInput';
interface SmsOtpProps {
value: string;
type: 'phone' | 'email';
}
export function SmsOtpForm({ value, type }: SmsOtpProps) {
const { t } = useTranslation('authentication');
return (
<Box sx={{ width: '100%' }}>
<Box
sx={{
display: 'flex',
flexDirection: 'row',
alignItems: 'center',
justifyContent: 'space-between',
gap: 4,
mb: 0.5,
}}
>
<Typography variant="h5">اعتبارسنجی</Typography>
<Button
variant="outlined"
size="large"
sx={{ direction: 'auto', textTransform: 'lowercase' }}
endIcon={<Edit2 />}
>
{value}
</Button>
</Box>
<Typography variant="body2" color="textSecondary">
کد تایید ۴ رقمی به شماره موبایل شما ارسال شد. لطفا آن را وارد کنید.
</Typography>
<DigitInput onChange={(value) => console.log(value)} />
<Button>{t('smsOtp.confirmAndLogin')}</Button>
</Box>
);
}