Add phone field to color request form and database
This commit is contained in:
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user