-
-
+
Time
= ({
if (!pendingLocation) return;
if (selectionState === 'pickup') {
- setFormData((prev) => ({ ...prev, pickupLocation: pendingLocation }));
+ setFormData((prev: FormData) => ({ ...prev, pickupLocation: pendingLocation }));
setSelectionState('dropoff');
} else if (selectionState === 'dropoff') {
- setFormData((prev) => ({ ...prev, dropoffLocation: pendingLocation }));
+ setFormData((prev: FormData) => ({ ...prev, dropoffLocation: pendingLocation }));
setSelectionState('complete');
}
@@ -213,7 +213,7 @@ const RequestRideDialog: React.FC = ({
* Clears both selected locations and returns to the "pickup" phase.
*/
const resetSelection = () => {
- setFormData((prev) => ({
+ setFormData((prev: FormData) => ({
...prev,
pickupLocation: null,
dropoffLocation: null,
@@ -266,18 +266,18 @@ const RequestRideDialog: React.FC = ({
// Reset selected days when changing repeat type
const handleDateChange =
(field: keyof Pick) =>
- (newDate: Date | null) => {
- setFormData({
- ...formData,
- [field]: newDate,
- });
- };
+ (newDate: Date | null) => {
+ setFormData({
+ ...formData,
+ [field]: newDate,
+ });
+ };
const handleRepeatTypeChange = (
event: React.ChangeEvent
) => {
const value = event.target.value as RepeatOption;
- setFormData((prev) => ({
+ setFormData((prev: FormData) => ({
...prev,
repeatType: value,
selectedDays: value !== 'custom' ? [] : prev.selectedDays,
@@ -288,7 +288,7 @@ const RequestRideDialog: React.FC = ({
event: React.MouseEvent,
newDays: string[]
) => {
- setFormData((prev) => ({
+ setFormData((prev: FormData) => ({
...prev,
selectedDays: newDays.map(
(shortDay) => fullDayNames[shortDay as keyof typeof fullDayNames]
@@ -388,15 +388,15 @@ const RequestRideDialog: React.FC = ({
// Only show map if not using custom locations
const safePickup =
!customPickup &&
- formData.pickupLocation?.lat &&
- formData.pickupLocation?.lng
+ formData.pickupLocation?.lat &&
+ formData.pickupLocation?.lng
? formData.pickupLocation
: null;
const safeDropoff =
!customDropoff &&
- formData.dropoffLocation?.lat &&
- formData.dropoffLocation?.lng
+ formData.dropoffLocation?.lat &&
+ formData.dropoffLocation?.lng
? formData.dropoffLocation
: null;
@@ -438,8 +438,8 @@ const RequestRideDialog: React.FC = ({
formData.pickupLocation || customPickupName
? '#4caf50'
: selectionState === 'pickup'
- ? '#2196f3'
- : '#e0e0e0',
+ ? '#2196f3'
+ : '#e0e0e0',
color: 'white',
fontSize: '12px',
}}
@@ -455,8 +455,8 @@ const RequestRideDialog: React.FC = ({
formData.dropoffLocation || customDropoffName
? '#4caf50'
: selectionState === 'dropoff'
- ? '#2196f3'
- : '#e0e0e0',
+ ? '#2196f3'
+ : '#e0e0e0',
color: 'white',
fontSize: '12px',
}}
@@ -518,15 +518,15 @@ const RequestRideDialog: React.FC = ({
formData.dropoffLocation ||
customPickupName ||
customDropoffName) && (
-
- )}
+
+ )}
{/* Show selected locations */}
@@ -587,17 +587,17 @@ const RequestRideDialog: React.FC
= ({
: 'Or select from dropdown:'}
-
- Pickup Location
+
+ Pickup Location