mirror of
https://github.com/kingomarnajjar/flex-template-web.git
synced 2026-07-26 06:47:17 +10:00
ListingPage url changed from l/:slug-:id syntax to l/:slug/:id
This commit is contained in:
parent
f8333f51a9
commit
63eb5a754c
24 changed files with 29 additions and 38 deletions
|
|
@ -25,7 +25,7 @@ describe('Application', () => {
|
|||
const urlTitles = {
|
||||
'/': 'Landing page',
|
||||
'/s': 'Search page',
|
||||
'/l/1234': 'Listing page with listing id: #1234',
|
||||
'/l/listing-title-slug/1234': 'Listing page with listing id: #1234',
|
||||
'/u/1234': 'Profile page with display name: 1234',
|
||||
'/checkout/1234': 'Checkout page: 1234',
|
||||
'/login': 'Authentication page: login tab',
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ exports[`AuthenticationPage matches snapshot 1`] = `
|
|||
</a>
|
||||
<a
|
||||
className=""
|
||||
href="/l/Bike-Pelago-12345"
|
||||
href="/l/Bike-Pelago/12345"
|
||||
onClick={[Function]}
|
||||
style={Object {}}>
|
||||
Listing page
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ exports[`CheckoutPage matches snapshot 1`] = `
|
|||
</a>
|
||||
<a
|
||||
className=""
|
||||
href="/l/Bike-Pelago-12345"
|
||||
href="/l/Bike-Pelago/12345"
|
||||
onClick={[Function]}
|
||||
style={Object {}}>
|
||||
Listing page
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ exports[`ContactDetailsPage matches snapshot 1`] = `
|
|||
</a>
|
||||
<a
|
||||
className=""
|
||||
href="/l/Bike-Pelago-12345"
|
||||
href="/l/Bike-Pelago/12345"
|
||||
onClick={[Function]}
|
||||
style={Object {}}>
|
||||
Listing page
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ exports[`ConversationPage matches snapshot 1`] = `
|
|||
</a>
|
||||
<a
|
||||
className=""
|
||||
href="/l/Bike-Pelago-12345"
|
||||
href="/l/Bike-Pelago/12345"
|
||||
onClick={[Function]}
|
||||
style={Object {}}>
|
||||
Listing page
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ exports[`EditProfilePage matches snapshot 1`] = `
|
|||
</a>
|
||||
<a
|
||||
className=""
|
||||
href="/l/Bike-Pelago-12345"
|
||||
href="/l/Bike-Pelago/12345"
|
||||
onClick={[Function]}
|
||||
style={Object {}}>
|
||||
Listing page
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ exports[`InboxPage matches snapshot 1`] = `
|
|||
</a>
|
||||
<a
|
||||
className=""
|
||||
href="/l/Bike-Pelago-12345"
|
||||
href="/l/Bike-Pelago/12345"
|
||||
onClick={[Function]}
|
||||
style={Object {}}>
|
||||
Listing page
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ exports[`LandingPage matches snapshot 1`] = `
|
|||
</a>
|
||||
<a
|
||||
className=""
|
||||
href="/l/Bike-Pelago-12345"
|
||||
href="/l/Bike-Pelago/12345"
|
||||
onClick={[Function]}
|
||||
style={Object {}}>
|
||||
Listing page
|
||||
|
|
|
|||
|
|
@ -2,21 +2,12 @@ import React, { PropTypes } from 'react';
|
|||
import { Link } from 'react-router';
|
||||
import { PageLayout } from '../../components';
|
||||
|
||||
const ListingPage = ({ params }) => {
|
||||
// Listing id should be located either in the end of slug
|
||||
// - https://example.com/l/listing-title-as-slug-12345
|
||||
// - https://example.com/l/12345
|
||||
const slugAndId = params.slug.split('-');
|
||||
const id = slugAndId[slugAndId.length - 1];
|
||||
|
||||
// TODO: Fetch data from SDK if no data is passed through props
|
||||
return (
|
||||
<PageLayout title={`Listing page with listing id: #${id}`}>
|
||||
<p>Slug: {params.slug}</p>
|
||||
<Link to={`/checkout/${id}`}><button>Book</button></Link>
|
||||
</PageLayout>
|
||||
);
|
||||
};
|
||||
const ListingPage = ({ params }) => (
|
||||
<PageLayout title={`Listing page with listing id: #${params.id}`}>
|
||||
<p>Slug: {params.slug}</p>
|
||||
<Link to={`/checkout/${params.id}`}><button>Book</button></Link>
|
||||
</PageLayout>
|
||||
);
|
||||
|
||||
const { shape, string } = PropTypes;
|
||||
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ describe('ListingPage', () => {
|
|||
const component = renderer.create(
|
||||
(
|
||||
<BrowserRouter>
|
||||
<ListingPage params={{ slug: 'really-nice-house-1234' }} />
|
||||
<ListingPage params={{ slug: 'really-nice-house-1234', id: 1234 }} />
|
||||
</BrowserRouter>
|
||||
),
|
||||
);
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ exports[`ListingPage matches snapshot 1`] = `
|
|||
</a>
|
||||
<a
|
||||
className=""
|
||||
href="/l/Bike-Pelago-12345"
|
||||
href="/l/Bike-Pelago/12345"
|
||||
onClick={[Function]}
|
||||
style={Object {}}>
|
||||
Listing page
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ exports[`ManageListingsPage matches snapshot 1`] = `
|
|||
</a>
|
||||
<a
|
||||
className=""
|
||||
href="/l/Bike-Pelago-12345"
|
||||
href="/l/Bike-Pelago/12345"
|
||||
onClick={[Function]}
|
||||
style={Object {}}>
|
||||
Listing page
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ exports[`NotFoundPage matches snapshot 1`] = `
|
|||
</a>
|
||||
<a
|
||||
className=""
|
||||
href="/l/Bike-Pelago-12345"
|
||||
href="/l/Bike-Pelago/12345"
|
||||
onClick={[Function]}
|
||||
style={Object {}}>
|
||||
Listing page
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ exports[`NotificationSettingsPage matches snapshot 1`] = `
|
|||
</a>
|
||||
<a
|
||||
className=""
|
||||
href="/l/Bike-Pelago-12345"
|
||||
href="/l/Bike-Pelago/12345"
|
||||
onClick={[Function]}
|
||||
style={Object {}}>
|
||||
Listing page
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ exports[`OrderPage matches snapshot 1`] = `
|
|||
</a>
|
||||
<a
|
||||
className=""
|
||||
href="/l/Bike-Pelago-12345"
|
||||
href="/l/Bike-Pelago/12345"
|
||||
onClick={[Function]}
|
||||
style={Object {}}>
|
||||
Listing page
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ exports[`PasswordChangePage matches snapshot 1`] = `
|
|||
</a>
|
||||
<a
|
||||
className=""
|
||||
href="/l/Bike-Pelago-12345"
|
||||
href="/l/Bike-Pelago/12345"
|
||||
onClick={[Function]}
|
||||
style={Object {}}>
|
||||
Listing page
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ exports[`PasswordForgottenPage matches snapshot 1`] = `
|
|||
</a>
|
||||
<a
|
||||
className=""
|
||||
href="/l/Bike-Pelago-12345"
|
||||
href="/l/Bike-Pelago/12345"
|
||||
onClick={[Function]}
|
||||
style={Object {}}>
|
||||
Listing page
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ exports[`PaymentMethodsPage matches snapshot 1`] = `
|
|||
</a>
|
||||
<a
|
||||
className=""
|
||||
href="/l/Bike-Pelago-12345"
|
||||
href="/l/Bike-Pelago/12345"
|
||||
onClick={[Function]}
|
||||
style={Object {}}>
|
||||
Listing page
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ exports[`PayoutPreferencesPage matches snapshot 1`] = `
|
|||
</a>
|
||||
<a
|
||||
className=""
|
||||
href="/l/Bike-Pelago-12345"
|
||||
href="/l/Bike-Pelago/12345"
|
||||
onClick={[Function]}
|
||||
style={Object {}}>
|
||||
Listing page
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ exports[`ProfilePage matches snapshot 1`] = `
|
|||
</a>
|
||||
<a
|
||||
className=""
|
||||
href="/l/Bike-Pelago-12345"
|
||||
href="/l/Bike-Pelago/12345"
|
||||
onClick={[Function]}
|
||||
style={Object {}}>
|
||||
Listing page
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ exports[`SalesConversationPage matches snapshot 1`] = `
|
|||
</a>
|
||||
<a
|
||||
className=""
|
||||
href="/l/Bike-Pelago-12345"
|
||||
href="/l/Bike-Pelago/12345"
|
||||
onClick={[Function]}
|
||||
style={Object {}}>
|
||||
Listing page
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ exports[`SearchPageComponent matches snapshot 1`] = `
|
|||
</a>
|
||||
<a
|
||||
className=""
|
||||
href="/l/Bike-Pelago-12345"
|
||||
href="/l/Bike-Pelago/12345"
|
||||
onClick={[Function]}
|
||||
style={Object {}}>
|
||||
Listing page
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ exports[`SecurityPage matches snapshot 1`] = `
|
|||
</a>
|
||||
<a
|
||||
className=""
|
||||
href="/l/Bike-Pelago-12345"
|
||||
href="/l/Bike-Pelago/12345"
|
||||
onClick={[Function]}
|
||||
style={Object {}}>
|
||||
Listing page
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ const Topbar = (props, context) => {
|
|||
<div className={css.container}>
|
||||
<Link to="/" {...linkProps}>Home</Link>
|
||||
<Link to="/s" {...linkProps}>Search</Link>
|
||||
<Link to="/l/Bike-Pelago-12345" {...linkProps}>Listing page</Link>
|
||||
<Link to="/l/Bike-Pelago/12345" {...linkProps}>Listing page</Link>
|
||||
<Link to="/u/Bikerrs" {...linkProps}>Profile</Link>
|
||||
<Link to="/u/Bikerrs/edit" {...linkProps}>Edit profile</Link>
|
||||
<Link to="/checkout/lid1234" {...linkProps}>Checkout</Link>
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue