mirror of
https://github.com/kingomarnajjar/flex-template-web.git
synced 2026-07-29 05:00:43 +10:00
Revert back to inbox tab as path param
Inbox links were broken, and could not simply be fixed by editing the links. The loadData function needs to know the tab as well, and currently it doesn't have the information if the tab isn't in the path params.
This commit is contained in:
parent
389e376abf
commit
afdf009af3
4 changed files with 7 additions and 15 deletions
|
|
@ -32,7 +32,7 @@ const MobileMenu = props => {
|
|||
}
|
||||
|
||||
const inboxLink = (
|
||||
<NamedLink name={currentUserHasListings ? 'InboxSalesPage' : 'InboxOrdersPage'}>
|
||||
<NamedLink name="InboxPage" params={{ tab: currentUserHasListings ? 'sales' : 'orders' }}>
|
||||
<FormattedMessage id="MobileMenu.inboxLink" />
|
||||
</NamedLink>
|
||||
);
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ export const OrderPageComponent = props => {
|
|||
if (isDataAvailable && !isOwnSale) {
|
||||
// eslint-disable-next-line no-console
|
||||
console.error('Tried to access an order that was not owned by the current user');
|
||||
return <NamedRedirect name="InboxOrdersPage" />;
|
||||
return <NamedRedirect name="InboxPage" params={{ tab: 'orders' }} />;
|
||||
}
|
||||
|
||||
const detailsProps = {
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ export const SalePageComponent = props => {
|
|||
if (isDataAvailable && !isOwnSale) {
|
||||
// eslint-disable-next-line no-console
|
||||
console.error('Tried to access a sale that was not owned by the current user');
|
||||
return <NamedRedirect name="InboxSalesPage" />;
|
||||
return <NamedRedirect name="InboxPage" params={{ tab: 'sales' }} />;
|
||||
}
|
||||
|
||||
const detailsProps = {
|
||||
|
|
|
|||
|
|
@ -158,22 +158,14 @@ const routesConfiguration = [
|
|||
auth: true,
|
||||
exact: true,
|
||||
name: 'InboxBasePage',
|
||||
component: () => <NamedRedirect name="InboxSalesPage" />,
|
||||
component: () => <NamedRedirect name="InboxPage" params={{ tab: 'sales' }} />,
|
||||
},
|
||||
{
|
||||
path: '/inbox/sales',
|
||||
path: '/inbox/:tab',
|
||||
auth: true,
|
||||
exact: true,
|
||||
name: 'InboxSalesPage',
|
||||
component: props => <InboxPage {...props} tab="sales" />,
|
||||
loadData: (params, search) => InboxPage.loadData(params, search),
|
||||
},
|
||||
{
|
||||
path: '/inbox/orders',
|
||||
auth: true,
|
||||
exact: true,
|
||||
name: 'InboxOrdersPage',
|
||||
component: props => <InboxPage {...props} tab="orders" />,
|
||||
name: 'InboxPage',
|
||||
component: props => <InboxPage {...props} />,
|
||||
loadData: (params, search) => InboxPage.loadData(params, search),
|
||||
},
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue