InboxPage and filtered views: order and sales

This commit is contained in:
Vesa Luusua 2017-01-12 19:10:37 +02:00
parent 1b26ed32f2
commit 068d61b3af
3 changed files with 41 additions and 0 deletions

View file

@ -3,6 +3,7 @@ import { Match, Miss, Redirect } from 'react-router';
import {
AuthenticationPage,
CheckoutPage,
InboxPage,
LandingPage,
ListingPage,
ProfilePage,
@ -87,6 +88,19 @@ class Routes extends React.Component {
(props) => <AuthenticationPage { ...props } tab='signup' />
} />
{/* Inbox and filtered views */}
<MatchWhenAuthorized
exactly
pattern="/inbox"
component={ (props) => <InboxPage { ...props } filter="inbox" /> } />
<MatchWhenAuthorized
exactly
pattern="/orders"
component={ (props) => <InboxPage { ...props } filter="orders" /> } />
<MatchWhenAuthorized
exactly
pattern="/sales"
component={ (props) => <InboxPage { ...props } filter="sales" /> } />
<Miss component={ NotFoundPage } />

View file

@ -0,0 +1,25 @@
import React from 'react';
import { Link } from 'react-router';
import { Page } from '../../components';
const toPath = (filter, id) => {
switch(filter) {
case 'orders':
return `/order/${id}`;
case 'sales':
return `/sale/${id}`;
default:
return `/conversation/${id}`;
}
}
export default (props) => {
const { filter } = props;
return (
<Page title={ `${filter} page`}>
<ul>
<li><Link to={ toPath(filter, 1234) }>Single thread</Link></li>
</ul>
</Page>
);
};

View file

@ -1,6 +1,7 @@
import AuthenticationPage from './AuthenticationPage/AuthenticationPage';
import CheckoutPage from './CheckoutPage/CheckoutPage';
import EditProfilePage from './EditProfilePage/EditProfilePage';
import InboxPage from './InboxPage/InboxPage';
import LandingPage from './LandingPage/LandingPage';
import ListingPage from './ListingPage/ListingPage';
import ProfilePage from './ProfilePage/ProfilePage';
@ -11,6 +12,7 @@ export {
AuthenticationPage,
CheckoutPage,
EditProfilePage,
InboxPage,
LandingPage,
ListingPage,
ProfilePage,