Skip to content

Commit

Permalink
Add proximity
Browse files Browse the repository at this point in the history
  • Loading branch information
apricot13 committed Jul 27, 2024
1 parent c1ab601 commit 1bb83d9
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion cypress/e2e/results_list.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ describe("Results list page", () => {
cy.wait("@searchForServices")

cy.get("p").contains(
"Showing 1-20 out of ~2805 results for Example within 20 miles of Example2"
"Showing 1-20 out of ~2805 results for Example within 5 miles of Example2"
)
})

Expand Down
3 changes: 2 additions & 1 deletion src/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -482,7 +482,8 @@ const MainContent = ({
)}{" "}
{coverage && (
<>
within 20 miles of <strong>{coverage}</strong>
within {theme.proximity / 1609.34} miles of{" "}
<strong>{coverage}</strong>
</>
)}
</>
Expand Down
1 change: 1 addition & 0 deletions src/themes/theme_generator.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ const generate_theme = (vars, theme_vars) => {
slug: vars.slug,
title: vars.hasOwnProperty("title") ? vars.title : "",
parentTaxonomySlug: process.env.REACT_APP_PARENT_TAXONOMY_SLUG || false,
proximity: vars.hasOwnProperty("proximity") ? vars.proximity : 5 * 1609.34, // miles x 1609.34 = Distance in meters
resultsPerPage: vars.hasOwnProperty("resultsPerPage")
? vars.resultsPerPage
: 20,
Expand Down

0 comments on commit 1bb83d9

Please sign in to comment.