mirror of
https://github.com/kingomarnajjar/flex-template-web.git
synced 2026-07-26 06:47:17 +10:00
InboxPage and filtered views: order and sales
This commit is contained in:
parent
1b26ed32f2
commit
068d61b3af
3 changed files with 41 additions and 0 deletions
|
|
@ -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 } />
|
||||
|
||||
|
|
|
|||
25
src/containers/InboxPage/InboxPage.js
Normal file
25
src/containers/InboxPage/InboxPage.js
Normal 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>
|
||||
);
|
||||
};
|
||||
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue