Redirect when signed in and going to sign in page.

This commit is contained in:
Patrick Fic
2019-12-06 19:19:22 -08:00
parent 3d6bafe436
commit 570f2549da
13 changed files with 63 additions and 33 deletions

View File

@@ -23,7 +23,7 @@ class Header extends Component {
{navItems.map(navItem => (
<Menu.Item key={navItem.title}>
<Link to={navItem.path}>
<Icon type={navItem.icontype} />
{navItem.icontype ? <Icon type={navItem.icontype} /> : null}
{navItem.title}
</Link>
</Menu.Item>

View File

@@ -27,6 +27,7 @@ const HeaderContainer = ({ landingHeader }) => {
if (loading) return <Spin />;
if (error) return <Alert message={error.message} />;
const parsedNavItems = JSON.parse(data.masterdata_by_pk.value);
console.log("::1", landingHeader);
return (
<Header
selectedNavItem={selectedNavItem}

View File

@@ -1,9 +1,10 @@
import React from "react";
import HeaderContainer from "../header/header.container";
export default function ManageShop() {
return (
<div>
<HeaderContainer />
This is the manage shop component.
</div>
);

View File

@@ -1,27 +1,7 @@
import React from "react";
import { Query } from "react-apollo";
import { gql } from "apollo-boost";
import { Alert } from "antd";
import Spin from '../loading-spinner/loading-spinner.component'
import ManageShop from "./manage-shop.component";
const GET_NAV_ITEMS = gql`
query nav_items {
masterdata_by_pk(key: "NAV_ITEMS") {
value
}
}
`;
const ManageShopContainer = () => (
<Query query={GET_NAV_ITEMS}>
{({ loading, error, data }) => {
if (loading) return <Spin />;
if (error) return <Alert message={error.message} />;
return <ManageShop />;
}}
</Query>
);
const ManageShopContainer = () => <ManageShop />;
export default ManageShopContainer;