Comments, appointments adjustments, fixed some issues
This commit is contained in:
@@ -7,6 +7,7 @@ const labelCls = "flex flex-col gap-[0.35rem] text-[0.9rem] font-semibold text-[
|
||||
const inputCls = "px-[0.85rem] py-[0.6rem] border border-[#ddd] rounded-lg text-base outline-none transition-all focus:border-[#e68672] focus:shadow-[0_0_0_3px_rgba(230,134,114,0.2)]";
|
||||
const submitBtnCls = "mt-2 py-3 bg-[#e68672] text-white border-none rounded-lg text-base font-bold cursor-pointer transition-all hover:bg-[#d4705e] active:scale-[0.98] disabled:opacity-60 disabled:cursor-not-allowed";
|
||||
|
||||
//Returns the image path for a store, guessing from the store name if no image is set
|
||||
function getStoreImage(store) {
|
||||
if (store.imageUrl) return store.imageUrl;
|
||||
const name = store.storeName?.toLowerCase() ?? "";
|
||||
@@ -16,6 +17,7 @@ function getStoreImage(store) {
|
||||
return "/images/pet-placeholder.png";
|
||||
}
|
||||
|
||||
//Contact page with a message form on the left and store location cards on the right
|
||||
export default function ContactPage() {
|
||||
const { token } = useAuth();
|
||||
const [locations, setLocations] = useState([]);
|
||||
@@ -28,6 +30,7 @@ export default function ContactPage() {
|
||||
const [sendError, setSendError] = useState(null);
|
||||
const [sendSuccess, setSendSuccess] = useState(false);
|
||||
|
||||
//Loads all store locations when the page first opens
|
||||
useEffect(() => {
|
||||
const params = new URLSearchParams({ page: "0", size: "100", sort: "storeName,asc" });
|
||||
fetch(`/api/v1/stores?${params}`)
|
||||
@@ -40,6 +43,7 @@ export default function ContactPage() {
|
||||
.finally(() => setLoading(false));
|
||||
}, []);
|
||||
|
||||
//Submits the contact form to the backend
|
||||
async function handleSend(e) {
|
||||
e.preventDefault();
|
||||
if (!token) {
|
||||
|
||||
Reference in New Issue
Block a user