mirror of
https://github.com/kingomarnajjar/flex-template-web.git
synced 2026-07-26 06:47:17 +10:00
SearchPage.js improvements
This commit is contained in:
parent
aae1c1b419
commit
12582f1e5d
4 changed files with 11 additions and 5 deletions
|
|
@ -34,8 +34,8 @@ describe('Application', () => {
|
|||
|
||||
it('server renders pages that do not require authentication', () => {
|
||||
const urlTitles = {
|
||||
'/s': 'Saunatime | search saunas everywhere',
|
||||
'/': 'Book saunas everywhere | Saunatime',
|
||||
'/s': 'Search results for map search | Saunatime',
|
||||
'/l/listing-title-slug/1234': 'Loading listing…',
|
||||
'/u/1234': 'Profile page with display name: 1234',
|
||||
'/login': 'Login',
|
||||
|
|
|
|||
|
|
@ -236,7 +236,12 @@ export class SearchPageComponent extends Component {
|
|||
// Schema for search engines (helps them to understand what this page is about)
|
||||
// http://schema.org
|
||||
// We are using JSON-LD format
|
||||
const schemaTitle = intl.formatMessage({ id: 'SearchPage.schemaTitle' });
|
||||
const siteTitle = config.siteTitle;
|
||||
const searchAddress = address || intl.formatMessage({ id: 'SearchPage.schemaMapSearch' });
|
||||
const schemaTitle = intl.formatMessage(
|
||||
{ id: 'SearchPage.schemaTitle' },
|
||||
{ searchAddress, siteTitle }
|
||||
);
|
||||
const schemaDescription = intl.formatMessage({ id: 'SearchPage.schemaDescription' });
|
||||
const schemaListings = listings.map((l, i) => {
|
||||
const title = l.attributes.title;
|
||||
|
|
@ -253,7 +258,7 @@ export class SearchPageComponent extends Component {
|
|||
});
|
||||
const schemaMainEntity = JSON.stringify({
|
||||
'@type': 'ItemList',
|
||||
name: address,
|
||||
name: searchAddress,
|
||||
itemListOrder: 'http://schema.org/ItemListOrderAscending',
|
||||
itemListElement: schemaListings,
|
||||
});
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ exports[`SearchPageComponent matches snapshot 1`] = `
|
|||
\"@type\": \"SearchResultsPage\",
|
||||
\"description\": \"SearchPage.schemaDescription\",
|
||||
\"name\": \"SearchPage.schemaTitle\",
|
||||
\"mainEntity\": [{\"@type\":\"ItemList\",\"itemListOrder\":\"http://schema.org/ItemListOrderAscending\",\"itemListElement\":[]}]
|
||||
\"mainEntity\": [{\"@type\":\"ItemList\",\"name\":\"SearchPage.schemaMapSearch\",\"itemListOrder\":\"http://schema.org/ItemListOrderAscending\",\"itemListElement\":[]}]
|
||||
}
|
||||
"
|
||||
scrollingDisabled={false}
|
||||
|
|
|
|||
|
|
@ -408,8 +408,9 @@
|
|||
"SearchPage.loadingResults": "Loading search results…",
|
||||
"SearchPage.noResults": "Could not find any listings.",
|
||||
"SearchPage.openMapView": "Map view",
|
||||
"SearchPage.schemaMapSearch": "map search",
|
||||
"SearchPage.schemaDescription": "Showing search results",
|
||||
"SearchPage.schemaTitle": "Saunatime | search saunas everywhere",
|
||||
"SearchPage.schemaTitle": "Search results for {searchAddress} | {siteTitle}",
|
||||
"SearchPage.searchError": "Search failed. Please try again.",
|
||||
"SearchResultsPanel.nextPage": "Next page",
|
||||
"SearchResultsPanel.previousPage": "Previous page",
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue