Removed addresses, adjusted contact page

This commit is contained in:
augmentedpotato
2026-04-14 13:31:56 -06:00
parent deccb27213
commit 2d27f95f7d
5 changed files with 86 additions and 50 deletions

View File

@@ -23,7 +23,6 @@ public class StoreController {
} }
@GetMapping @GetMapping
@PreAuthorize("isAuthenticated()")
public ResponseEntity<Page<StoreResponse>> getAllStores( public ResponseEntity<Page<StoreResponse>> getAllStores(
@RequestParam(required = false) String q, @RequestParam(required = false) String q,
Pageable pageable) { Pageable pageable) {
@@ -31,7 +30,6 @@ public class StoreController {
} }
@GetMapping("/{id}") @GetMapping("/{id}")
@PreAuthorize("isAuthenticated()")
public ResponseEntity<StoreResponse> getStoreById(@PathVariable Long id) { public ResponseEntity<StoreResponse> getStoreById(@PathVariable Long id) {
return ResponseEntity.ok(storeService.getStoreById(id)); return ResponseEntity.ok(storeService.getStoreById(id));
} }

View File

@@ -63,6 +63,7 @@ public class SecurityConfig {
.requestMatchers(HttpMethod.GET, "/api/v1/products/**").permitAll() .requestMatchers(HttpMethod.GET, "/api/v1/products/**").permitAll()
.requestMatchers(HttpMethod.GET, "/api/v1/services/**").permitAll() .requestMatchers(HttpMethod.GET, "/api/v1/services/**").permitAll()
.requestMatchers(HttpMethod.GET, "/api/v1/categories/**").permitAll() .requestMatchers(HttpMethod.GET, "/api/v1/categories/**").permitAll()
.requestMatchers(HttpMethod.GET, "/api/v1/stores/**").permitAll()
.requestMatchers(HttpMethod.GET, "/api/v1/dropdowns/pet-species").permitAll() .requestMatchers(HttpMethod.GET, "/api/v1/dropdowns/pet-species").permitAll()
.requestMatchers(HttpMethod.GET, "/api/v1/dropdowns/pet-breeds").permitAll() .requestMatchers(HttpMethod.GET, "/api/v1/dropdowns/pet-breeds").permitAll()
.requestMatchers(HttpMethod.GET, "/api/v1/dropdowns/stores").permitAll() .requestMatchers(HttpMethod.GET, "/api/v1/dropdowns/stores").permitAll()

View File

@@ -1,31 +1,24 @@
const LOCATIONS = [ "use client";
{
name: "Downtown Branch",
address: "123 Main St",
phone: "(123) 456-7890",
email: "downtown@petshop.com",
},
{
name: "North Branch",
address: "456 North Ave",
phone: "(987) 654-3210",
email: "north@petshop.com",
},
{
name: "West Side Store",
address: "789 West Blvd",
phone: "(555) 123-4567",
email: "westside@petshop.com",
},
];
const PERSONNEL = [ import { useState, useEffect } from "react";
{ name: "John Doe", role: "Store Manager" },
{ name: "Sara Smith", role: "Staff" },
{ name: "Michael Johnson", role: "Grooming Team" },
];
export default function ContactPage() { export default function ContactPage() {
const [locations, setLocations] = useState([]);
const [loading, setLoading] = useState(true);
const [error, setError] = useState(null);
useEffect(() => {
const params = new URLSearchParams({ page: "0", size: "100", sort: "storeName,asc" });
fetch(`/api/v1/stores?${params}`)
.then((res) => {
if (!res.ok) throw new Error(`HTTP ${res.status}`);
return res.json();
})
.then((data) => setLocations(data.content ?? []))
.catch((err) => setError(err.message))
.finally(() => setLoading(false));
}, []);
return ( return (
<main className="info-page"> <main className="info-page">
<section className="info-hero"> <section className="info-hero">
@@ -44,28 +37,40 @@ export default function ContactPage() {
<div className="info-card"> <div className="info-card">
<h2>Store Locations</h2> <h2>Store Locations</h2>
<div className="info-card-grid">
{LOCATIONS.map((location) => (
<article key={location.name} className="info-mini-card">
<h3>{location.name}</h3>
<p>{location.address}</p>
<p>{location.phone}</p>
<p>{location.email}</p>
</article>
))}
</div>
</div>
<div className="info-card"> {loading && <p>Loading locations...</p>}
<h2>Store Personnel</h2>
<div className="info-card-grid"> {error && <p style={{ color: "red" }}>Failed to load locations: {error}</p>}
{PERSONNEL.map((person) => (
<article key={person.name} className="info-mini-card"> {!loading && !error && locations.length === 0 && (
<h3>{person.name}</h3> <p>No store locations found.</p>
<p>{person.role}</p> )}
</article>
))} {!loading && !error && locations.length > 0 && (
</div> <div className="info-card-grid">
{locations.map((location) => (
<article key={location.storeId} className="info-mini-card location-card">
<div className="location-card-image-wrapper">
<img
src={location.imageUrl || "/images/pet-placeholder.png"}
alt={location.storeName}
className="location-card-image"
onError={(e) => {
e.currentTarget.onerror = null;
e.currentTarget.src = "/images/pet-placeholder.png";
}}
/>
</div>
<div className="location-card-body">
<h3>{location.storeName}</h3>
<p>{location.address}</p>
<p>{location.phone}</p>
<p>{location.email}</p>
</div>
</article>
))}
</div>
)}
</div> </div>
</section> </section>
</main> </main>

View File

@@ -38,7 +38,7 @@ body {
align-items: center; align-items: center;
flex-wrap: wrap; flex-wrap: wrap;
min-height: 70px; min-height: 70px;
border-radius: 0px 0px 10px 10px; /* border-radius: 0px 0px 10px 10px; */
} }
/* Add padding to body to account for fixed header */ /* Add padding to body to account for fixed header */
@@ -758,6 +758,39 @@ body {
margin-bottom: 0.5rem; margin-bottom: 0.5rem;
} }
.location-card {
padding: 0;
overflow: hidden;
}
.location-card-image-wrapper {
width: 100%;
aspect-ratio: 16 / 9;
overflow: hidden;
background: #eee;
}
.location-card-image {
width: 100%;
height: 100%;
object-fit: cover;
}
.location-card-body {
padding: 1rem;
}
.location-card-body h3 {
margin-top: 0;
margin-bottom: 0.5rem;
}
.location-card-body p {
margin: 0.25rem 0;
font-size: 0.9rem;
color: #555;
}
.products-hero { .products-hero {
text-align: center; text-align: center;
padding: 4rem 2rem 3rem; padding: 4rem 2rem 3rem;

View File

@@ -43,7 +43,6 @@ export default function Footer() {
<ul className="footer-links footer-contact"> <ul className="footer-links footer-contact">
<li>(403) 123-4567</li> <li>(403) 123-4567</li>
<li>support@leonspetstore.com</li> <li>support@leonspetstore.com</li>
<li>123 Street Street, Calgary, Alberta, Canada</li>
</ul> </ul>
</div> </div>