2021-07-13 11:35:46 +00:00
|
|
|
/** @jsxRuntime classic */
|
|
|
|
/** @jsx jsx */
|
|
|
|
import { jsx } from "@emotion/react";
|
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";
|
|
|
|
const ForgotPassword = React.lazy(() => import("./ForgotPassword"));
|
|
|
|
const SignIn = React.lazy(() => import("./SignIn"));
|
|
|
|
const LandingNavbar = React.lazy(() => import("./LandingNavbar"));
|
|
|
|
const AppNavbar = React.lazy(() => import("./AppNavbar"));
|
2021-08-02 11:42:31 +00:00
|
|
|
const HubspotForm = React.lazy(() => import("./HubspotForm"));
|
2021-07-13 11:35:46 +00:00
|
|
|
|
|
|
|
const Navbar = () => {
|
|
|
|
const { modal, toggleModal, isAppView, isLoggedIn } = useContext(UIContext);
|
|
|
|
|
|
|
|
return (
|
|
|
|
<Flex
|
|
|
|
boxShadow={["sm", "md"]}
|
|
|
|
alignItems="center"
|
|
|
|
id="Navbar"
|
2021-08-26 13:18:31 +00:00
|
|
|
minH="3rem"
|
|
|
|
maxH="3rem"
|
2021-07-13 11:35:46 +00:00
|
|
|
bgColor="primary.1200"
|
2021-08-26 13:18:31 +00:00
|
|
|
direction="row"
|
2021-07-13 11:35:46 +00:00
|
|
|
w="100%"
|
|
|
|
overflow="hidden"
|
|
|
|
>
|
|
|
|
<Suspense fallback={""}>
|
2021-09-15 14:58:14 +00:00
|
|
|
{/* {modal === "register" && <SignUp toggleModal={toggleModal} />} */}
|
2021-07-13 11:35:46 +00:00
|
|
|
{modal === "login" && <SignIn toggleModal={toggleModal} />}
|
|
|
|
{modal === "forgot" && <ForgotPassword toggleModal={toggleModal} />}
|
2021-08-02 11:42:31 +00:00
|
|
|
{modal === "hubspot-trader" && (
|
|
|
|
<HubspotForm
|
|
|
|
toggleModal={toggleModal}
|
|
|
|
title={"Join the waitlist"}
|
|
|
|
formId={"29a17405-819b-405d-9563-f75bfb3774e0"}
|
|
|
|
/>
|
|
|
|
)}
|
|
|
|
{modal === "hubspot-fund" && (
|
|
|
|
<HubspotForm
|
|
|
|
toggleModal={toggleModal}
|
|
|
|
title={"Join the waitlist"}
|
|
|
|
formId={"04f0b8df-6b8f-4cd0-871f-4e872523b6f5"}
|
|
|
|
/>
|
|
|
|
)}
|
|
|
|
{modal === "hubspot-developer" && (
|
|
|
|
<HubspotForm
|
|
|
|
toggleModal={toggleModal}
|
|
|
|
title={"Join the waitlist"}
|
|
|
|
formId={"1897f4a1-3a00-475b-9bd5-5ca2725bd720"}
|
|
|
|
/>
|
|
|
|
)}
|
2021-07-13 11:35:46 +00:00
|
|
|
{(!isAppView || !isLoggedIn) && <LandingNavbar />}
|
|
|
|
{isAppView && isLoggedIn && <AppNavbar />}
|
|
|
|
</Suspense>
|
|
|
|
</Flex>
|
|
|
|
);
|
|
|
|
};
|
|
|
|
|
|
|
|
export default Navbar;
|