kopia lustrzana https://github.com/bugout-dev/moonstream
Merge pull request #186 from bugout-dev/logo-layout-and-preload-imrpovement
Logo layout and preload imrpovementpull/192/head
commit
333e797a61
|
@ -21,6 +21,7 @@ const DefaultLayout = dynamic(() => import("../src/layouts"), {
|
||||||
});
|
});
|
||||||
import { useRouter } from "next/router";
|
import { useRouter } from "next/router";
|
||||||
import NProgress from "nprogress";
|
import NProgress from "nprogress";
|
||||||
|
import { WHITE_LOGO_W_TEXT_URL } from "../src/core/constants";
|
||||||
|
|
||||||
export default function CachingApp({ Component, pageProps }) {
|
export default function CachingApp({ Component, pageProps }) {
|
||||||
const [queryClient] = useState(new QueryClient());
|
const [queryClient] = useState(new QueryClient());
|
||||||
|
@ -48,6 +49,10 @@ export default function CachingApp({ Component, pageProps }) {
|
||||||
const getLayout =
|
const getLayout =
|
||||||
Component.getLayout || ((page) => <DefaultLayout>{page}</DefaultLayout>);
|
Component.getLayout || ((page) => <DefaultLayout>{page}</DefaultLayout>);
|
||||||
|
|
||||||
|
const headLinks = [
|
||||||
|
{ rel: "preload", as: "image", href: WHITE_LOGO_W_TEXT_URL },
|
||||||
|
];
|
||||||
|
pageProps.preloads && headLinks.push(...pageProps.preloads);
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<style global jsx>{`
|
<style global jsx>{`
|
||||||
|
@ -62,7 +67,7 @@ export default function CachingApp({ Component, pageProps }) {
|
||||||
}
|
}
|
||||||
`}</style>
|
`}</style>
|
||||||
{pageProps.metaTags && <HeadSEO {...pageProps.metaTags} />}
|
{pageProps.metaTags && <HeadSEO {...pageProps.metaTags} />}
|
||||||
{pageProps.preloads && <HeadLinks links={pageProps.preloads} />}
|
<HeadLinks links={headLinks} />
|
||||||
<QueryClientProvider client={queryClient}>
|
<QueryClientProvider client={queryClient}>
|
||||||
<AppContext>{getLayout(<Component {...pageProps} />)}</AppContext>
|
<AppContext>{getLayout(<Component {...pageProps} />)}</AppContext>
|
||||||
</QueryClientProvider>
|
</QueryClientProvider>
|
||||||
|
|
|
@ -1,13 +1,13 @@
|
||||||
import React, { Fragment, useContext } from "react";
|
import React, { Fragment, useContext } from "react";
|
||||||
import RouterLink from "next/link";
|
import RouterLink from "next/link";
|
||||||
import {
|
import {
|
||||||
Flex,
|
|
||||||
Button,
|
Button,
|
||||||
Image,
|
Image,
|
||||||
ButtonGroup,
|
ButtonGroup,
|
||||||
Spacer,
|
Spacer,
|
||||||
Link,
|
Link,
|
||||||
IconButton,
|
IconButton,
|
||||||
|
Flex,
|
||||||
} from "@chakra-ui/react";
|
} from "@chakra-ui/react";
|
||||||
import { HamburgerIcon } from "@chakra-ui/icons";
|
import { HamburgerIcon } from "@chakra-ui/icons";
|
||||||
import useModals from "../core/hooks/useModals";
|
import useModals from "../core/hooks/useModals";
|
||||||
|
@ -21,7 +21,6 @@ const LandingNavbar = () => {
|
||||||
const ui = useContext(UIContext);
|
const ui = useContext(UIContext);
|
||||||
const { toggleModal } = useModals();
|
const { toggleModal } = useModals();
|
||||||
return (
|
return (
|
||||||
<>
|
|
||||||
<>
|
<>
|
||||||
{ui.isMobileView && (
|
{ui.isMobileView && (
|
||||||
<>
|
<>
|
||||||
|
@ -37,17 +36,22 @@ const LandingNavbar = () => {
|
||||||
<Flex
|
<Flex
|
||||||
pl={ui.isMobileView ? 2 : 8}
|
pl={ui.isMobileView ? 2 : 8}
|
||||||
justifySelf="flex-start"
|
justifySelf="flex-start"
|
||||||
h="full"
|
h="100%"
|
||||||
py={1}
|
py={1}
|
||||||
|
flexBasis="200px"
|
||||||
|
flexGrow={1}
|
||||||
|
flexShirnk={1}
|
||||||
|
id="Logo Container"
|
||||||
>
|
>
|
||||||
<RouterLink href="/" passHref>
|
<RouterLink href="/" passHref>
|
||||||
<Link h="full">
|
<Link
|
||||||
<Image
|
as={Image}
|
||||||
|
w="auto"
|
||||||
h="full"
|
h="full"
|
||||||
|
justifyContent="left"
|
||||||
src={WHITE_LOGO_W_TEXT_URL}
|
src={WHITE_LOGO_W_TEXT_URL}
|
||||||
alt="Moonstream logo"
|
alt="Moonstream logo"
|
||||||
/>
|
/>
|
||||||
</Link>
|
|
||||||
</RouterLink>
|
</RouterLink>
|
||||||
</Flex>
|
</Flex>
|
||||||
|
|
||||||
|
@ -108,10 +112,7 @@ const LandingNavbar = () => {
|
||||||
</Button>
|
</Button>
|
||||||
)}
|
)}
|
||||||
{ui.isLoggedIn && (
|
{ui.isLoggedIn && (
|
||||||
<ChakraAccountIconButton
|
<ChakraAccountIconButton variant="link" colorScheme="secondary" />
|
||||||
variant="link"
|
|
||||||
colorScheme="secondary"
|
|
||||||
/>
|
|
||||||
)}
|
)}
|
||||||
</ButtonGroup>
|
</ButtonGroup>
|
||||||
</>
|
</>
|
||||||
|
@ -123,7 +124,6 @@ const LandingNavbar = () => {
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
</>
|
</>
|
||||||
</>
|
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -19,16 +19,11 @@ const Navbar = () => {
|
||||||
boxShadow={["sm", "md"]}
|
boxShadow={["sm", "md"]}
|
||||||
alignItems="center"
|
alignItems="center"
|
||||||
id="Navbar"
|
id="Navbar"
|
||||||
minH={["3rem", "3rem", "3rem", "3rem", "3rem", "3rem"]}
|
minH="3rem"
|
||||||
// overflow="initial"
|
maxH="3rem"
|
||||||
bgColor="primary.1200"
|
bgColor="primary.1200"
|
||||||
// flexWrap="wrap"
|
direction="row"
|
||||||
direction={["row", "row", "row", null, "row"]}
|
|
||||||
// zIndex={100}
|
|
||||||
w="100%"
|
w="100%"
|
||||||
minW="100%"
|
|
||||||
m={0}
|
|
||||||
p={0}
|
|
||||||
overflow="hidden"
|
overflow="hidden"
|
||||||
>
|
>
|
||||||
<Suspense fallback={""}>
|
<Suspense fallback={""}>
|
||||||
|
|
Ładowanie…
Reference in New Issue