feat: implement MobileInput component for standardized mobile number input and update related forms to use it

This commit is contained in:
hamed
2026-06-19 15:28:40 +03:30
parent d910a30a7e
commit da57c554c1
11 changed files with 108 additions and 42 deletions
@@ -3,6 +3,7 @@ import { useQuery, useMutation, useQueryClient } from '@tanstack/react-query';
import { DevicePhoneMobileIcon, CheckCircleIcon, XMarkIcon } from '@heroicons/react/24/outline';
import { api } from '../../lib/api';
import type { ApiResponse } from '../../lib/api';
import { sanitizeMobileInput } from '../../lib/utils';
interface NotificationMobileData {
notification_mobile: string | null;
@@ -126,9 +127,11 @@ export default function NotificationMobileCard({ target }: Props) {
<input
type="tel"
value={newMobile}
onChange={e => setNewMobile(e.target.value)}
placeholder="09XXXXXXXXX"
dir="ltr"
inputMode="numeric"
maxLength={11}
onChange={e => setNewMobile(sanitizeMobileInput(e.target.value))}
placeholder="09XXXXXXXXX"
style={{
width: '100%', maxWidth: 220, height: 38, padding: '0 12px',
borderRadius: 'var(--r-sm)', border: '1px solid var(--border)',