rental price calculation bug, sticky pricing cards on mobile, bigger font app wide, removed delivery options from frontened, searching by location with zipcode works when there's multiple zipcodes in the area,

This commit is contained in:
jackiettran
2025-12-30 00:20:15 -05:00
parent 7dd3aff0f8
commit 546c881701
12 changed files with 254 additions and 222 deletions

View File

@@ -1,60 +0,0 @@
import React from 'react';
interface DeliveryOptionsProps {
pickUpAvailable: boolean;
inPlaceUseAvailable: boolean;
onChange: (e: React.ChangeEvent<HTMLInputElement>) => void;
}
const DeliveryOptions: React.FC<DeliveryOptionsProps> = ({
pickUpAvailable,
inPlaceUseAvailable,
onChange
}) => {
return (
<div className="card mb-4">
<div className="card-body">
<label className="form-label">
How will renters receive this item?
</label>
<div className="form-check">
<input
type="checkbox"
className="form-check-input"
id="pickUpAvailable"
name="pickUpAvailable"
checked={pickUpAvailable}
onChange={onChange}
/>
<label className="form-check-label" htmlFor="pickUpAvailable">
Pick-Up/Drop-off
<div className="small text-muted">
You and the renter coordinate pick-up and drop-off
</div>
</label>
</div>
<div className="form-check">
<input
type="checkbox"
className="form-check-input"
id="inPlaceUseAvailable"
name="inPlaceUseAvailable"
checked={inPlaceUseAvailable}
onChange={onChange}
/>
<label
className="form-check-label"
htmlFor="inPlaceUseAvailable"
>
In-Place Use
<div className="small text-muted">
They use at your location
</div>
</label>
</div>
</div>
</div>
);
};
export default DeliveryOptions;

View File

@@ -1,11 +1,10 @@
import React, { useState } from "react";
import { mapsAPI } from "../services/api";
interface LocationPromptModalProps {
show: boolean;
onClose: () => void;
onLocationSelect: (
location: { lat: number; lng: number } | { city?: string; zipCode?: string }
) => void;
onLocationSelect: (location: { lat: number; lng: number }) => void;
}
const LocationPromptModal: React.FC<LocationPromptModalProps> = ({
@@ -53,15 +52,31 @@ const LocationPromptModal: React.FC<LocationPromptModalProps> = ({
}
};
const handleManualSubmit = () => {
const handleManualSubmit = async () => {
const trimmed = manualLocation.trim();
if (!trimmed) return;
// Check if it looks like a ZIP code
if (/^\d{5}(-\d{4})?$/.test(trimmed)) {
onLocationSelect({ zipCode: trimmed });
} else {
onLocationSelect({ city: trimmed });
setLoading(true);
setError(null);
try {
// Geocode the input (works for both ZIP codes and city names)
const response = await mapsAPI.geocode({
address: trimmed,
componentRestrictions: { country: "US" },
});
const { latitude, longitude } = response.data;
if (latitude && longitude) {
onLocationSelect({ lat: latitude, lng: longitude });
} else {
setError("Could not find that location. Please try a different city or ZIP code.");
}
} catch (err: any) {
setError("Could not find that location. Please try a different city or ZIP code.");
} finally {
setLoading(false);
}
};