2021-07-27 14:42:02 +00:00
|
|
|
import React, { Suspense, useContext } from "react";
|
2021-07-13 11:35:46 +00:00
|
|
|
import { Flex } from "@chakra-ui/react";
|
|
|
|
import UIContext from "../core/providers/UIProvider/context";
|
2021-10-27 12:11:16 +00:00
|
|
|
|
2022-04-21 18:41:07 +00:00
|
|
|
import LandingNavbar from "./LandingNavbar";
|
2021-07-13 11:35:46 +00:00
|
|
|
const AppNavbar = React.lazy(() => import("./AppNavbar"));
|
|
|
|
|
|
|
|
const Navbar = () => {
|
2021-10-27 12:11:16 +00:00
|
|
|
const { isAppView, isLoggedIn } = useContext(UIContext);
|
2021-07-13 11:35:46 +00:00
|
|
|
|
|
|
|
return (
|
|
|
|
<Flex
|
|
|
|
boxShadow={["sm", "md"]}
|
2022-04-21 18:41:07 +00:00
|
|
|
zIndex={1}
|
2021-07-13 11:35:46 +00:00
|
|
|
alignItems="center"
|
|
|
|
id="Navbar"
|
2021-08-26 13:18:31 +00:00
|
|
|
minH="3rem"
|
|
|
|
maxH="3rem"
|
2021-09-21 18:37:48 +00:00
|
|
|
bgColor="blue.1200"
|
2021-08-26 13:18:31 +00:00
|
|
|
direction="row"
|
2021-07-13 11:35:46 +00:00
|
|
|
w="100%"
|
|
|
|
overflow="hidden"
|
2022-04-21 18:41:07 +00:00
|
|
|
position={"fixed"}
|
|
|
|
transition={"0.3s"}
|
|
|
|
top={"0"}
|
2021-07-13 11:35:46 +00:00
|
|
|
>
|
2022-04-21 18:41:07 +00:00
|
|
|
{(!isAppView || !isLoggedIn) && <LandingNavbar />}
|
2021-07-13 11:35:46 +00:00
|
|
|
<Suspense fallback={""}>
|
|
|
|
{isAppView && isLoggedIn && <AppNavbar />}
|
|
|
|
</Suspense>
|
|
|
|
</Flex>
|
|
|
|
);
|
|
|
|
};
|
|
|
|
|
|
|
|
export default Navbar;
|