Add phone field to color request form and database

This commit is contained in:
DaX
2025-08-29 12:41:34 +02:00
parent 9f2dade0e3
commit 6d534352b2
4 changed files with 40 additions and 6 deletions

View File

@@ -13,7 +13,8 @@ export default function ColorRequestModal({ isOpen, onClose }: ColorRequestModal
color_name: '',
material_type: 'PLA',
finish_type: 'Basic',
user_email: ''
user_email: '',
user_phone: ''
});
const [isSubmitting, setIsSubmitting] = useState(false);
const [message, setMessage] = useState<{ type: 'success' | 'error', text: string } | null>(null);
@@ -25,7 +26,8 @@ export default function ColorRequestModal({ isOpen, onClose }: ColorRequestModal
color_name: '',
material_type: 'PLA',
finish_type: 'Basic',
user_email: ''
user_email: '',
user_phone: ''
});
setMessage(null);
}
@@ -184,6 +186,21 @@ export default function ColorRequestModal({ isOpen, onClose }: ColorRequestModal
/>
</div>
<div>
<label htmlFor="user_phone" className="block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1">
Telefon (opciono)
</label>
<input
type="tel"
id="user_phone"
name="user_phone"
value={formData.user_phone}
onChange={handleChange}
className="w-full px-3 py-2 border border-gray-300 dark:border-gray-600 bg-white dark:bg-gray-700 text-gray-900 dark:text-gray-100 rounded-md focus:outline-none focus:ring-2 focus:ring-purple-500 appearance-none"
placeholder="Za kontakt"
/>
</div>
<div className="flex justify-end space-x-3 pt-4">
<button
type="button"