kopia lustrzana https://github.com/bugout-dev/moonstream
change schema of sitemap constanto to be nested
rodzic
e8a0cd0673
commit
d09754ecc7
|
@ -12,11 +12,7 @@ import {
|
|||
chakra,
|
||||
} from "@chakra-ui/react";
|
||||
import RouterLink from "next/link";
|
||||
import {
|
||||
WHITE_LOGO_W_TEXT_URL,
|
||||
ALL_NAV_PATHES,
|
||||
FOOTER_COLUMNS,
|
||||
} from "../core/constants";
|
||||
import { WHITE_LOGO_W_TEXT_URL, SITEMAP } from "../core/constants";
|
||||
import { FaGithub, FaTwitter, FaDiscord } from "react-icons/fa";
|
||||
import moment from "moment";
|
||||
|
||||
|
@ -69,9 +65,9 @@ const Footer = () => (
|
|||
bg={useColorModeValue("blue.900", "gray.900")}
|
||||
color={useColorModeValue("gray.700", "gray.200")}
|
||||
>
|
||||
<Container as={Stack} maxW={"6xl"} py={10}>
|
||||
<Container as={Stack} maxW={"8xl"} py={10}>
|
||||
<SimpleGrid
|
||||
templateColumns={{ sm: "1fr 1fr", md: "2fr 1fr 1fr 2fr" }}
|
||||
templateColumns={{ sm: "1fr 1fr", md: "2fr 1fr 1fr 1fr 1fr" }}
|
||||
spacing={8}
|
||||
>
|
||||
<Stack spacing={6}>
|
||||
|
@ -112,16 +108,30 @@ const Footer = () => (
|
|||
</SocialButton>
|
||||
</Stack>
|
||||
</Stack>
|
||||
{Object.values(FOOTER_COLUMNS).map((columnEnum, colIndex) => {
|
||||
{Object.values(SITEMAP).map((category, colIndex) => {
|
||||
return (
|
||||
<Stack align={"flex-start"} key={`footer-list-column-${colIndex}`}>
|
||||
{ALL_NAV_PATHES.filter(
|
||||
(navPath) => navPath.footerCategory === columnEnum
|
||||
<>
|
||||
<ListHeader>{category.title}</ListHeader>
|
||||
{category.children.map((linkItem, linkItemIndex) => {
|
||||
return (
|
||||
<RouterLink
|
||||
passHref
|
||||
href={linkItem.path}
|
||||
key={`footer-list-link-item-${linkItemIndex}-col-${colIndex}`}
|
||||
>
|
||||
<Link {...LINKS_SIZES}>{linkItem.title}</Link>
|
||||
</RouterLink>
|
||||
);
|
||||
})}
|
||||
</>
|
||||
{/* {SITEMAP.filter(
|
||||
(navPath) => navPath.SiteMapCategory === columnEnum
|
||||
).length > 0 && (
|
||||
<>
|
||||
<ListHeader>{columnEnum}</ListHeader>
|
||||
{ALL_NAV_PATHES.filter(
|
||||
(navPath) => navPath.footerCategory === columnEnum
|
||||
(navPath) => navPath.SiteMapCategory === columnEnum
|
||||
).map((linkItem, linkItemIndex) => {
|
||||
return (
|
||||
<RouterLink
|
||||
|
@ -134,7 +144,7 @@ const Footer = () => (
|
|||
);
|
||||
})}
|
||||
</>
|
||||
)}
|
||||
)} */}
|
||||
</Stack>
|
||||
);
|
||||
})}
|
||||
|
|
|
@ -8,13 +8,17 @@ import {
|
|||
Link,
|
||||
IconButton,
|
||||
Flex,
|
||||
Menu,
|
||||
MenuButton,
|
||||
MenuList,
|
||||
MenuItem,
|
||||
} from "@chakra-ui/react";
|
||||
import { HamburgerIcon } from "@chakra-ui/icons";
|
||||
import { ChevronDownIcon, HamburgerIcon } from "@chakra-ui/icons";
|
||||
import useModals from "../core/hooks/useModals";
|
||||
import UIContext from "../core/providers/UIProvider/context";
|
||||
import ChakraAccountIconButton from "./AccountIconButton";
|
||||
import RouteButton from "./RouteButton";
|
||||
import { ALL_NAV_PATHES, WHITE_LOGO_W_TEXT_URL } from "../core/constants";
|
||||
import { SITEMAP, WHITE_LOGO_W_TEXT_URL } from "../core/constants";
|
||||
import router from "next/router";
|
||||
import { MODAL_TYPES } from "../core/providers/OverlayProvider/constants";
|
||||
|
||||
|
@ -59,21 +63,46 @@ const LandingNavbar = () => {
|
|||
<>
|
||||
<Spacer />
|
||||
<ButtonGroup variant="link" colorScheme="orange" spacing={4} pr={16}>
|
||||
{ALL_NAV_PATHES.map((item, idx) => (
|
||||
<RouteButton
|
||||
key={`${idx}-${item.title}-landing-all-links`}
|
||||
variant="link"
|
||||
href={item.path}
|
||||
color="white"
|
||||
isActive={!!(router.pathname === item.path)}
|
||||
>
|
||||
{item.title}
|
||||
</RouteButton>
|
||||
{SITEMAP.map((item, idx) => (
|
||||
<>
|
||||
{!item.children && (
|
||||
<RouteButton
|
||||
key={`${idx}-${item.title}-landing-all-links`}
|
||||
variant="link"
|
||||
href={item.path}
|
||||
color="white"
|
||||
isActive={!!(router.pathname === item.path)}
|
||||
>
|
||||
{item.title}
|
||||
</RouteButton>
|
||||
)}
|
||||
{item.children && (
|
||||
<Menu>
|
||||
<MenuButton as={Button} rightIcon={<ChevronDownIcon />}>
|
||||
{item.title}
|
||||
</MenuButton>
|
||||
<MenuList>
|
||||
{item.children.map((child, idx) => (
|
||||
<RouterLink
|
||||
key={`${idx}-${item.title}-menu-links`}
|
||||
href={child.path}
|
||||
passHref
|
||||
>
|
||||
<MenuItem as={"a"} m={0}>
|
||||
{child.title}
|
||||
</MenuItem>
|
||||
</RouterLink>
|
||||
))}
|
||||
</MenuList>
|
||||
</Menu>
|
||||
)}
|
||||
</>
|
||||
))}
|
||||
|
||||
{ui.isLoggedIn && (
|
||||
<RouterLink href="/welcome" passHref>
|
||||
<Button
|
||||
alignSelf={"center"}
|
||||
as={Link}
|
||||
colorScheme="orange"
|
||||
variant="outline"
|
||||
|
|
|
@ -15,42 +15,98 @@ export const DEFAULT_METATAGS = {
|
|||
image: `https://s3.amazonaws.com/static.simiotics.com/moonstream/assets/crypto+traders.png`,
|
||||
};
|
||||
|
||||
export const FOOTER_COLUMNS = {
|
||||
NEWS: "News",
|
||||
COMPANY: "Company",
|
||||
PRODUCT: "Product",
|
||||
// export const FOOTER_COLUMNS = {
|
||||
// NEWS: "News",
|
||||
// COMPANY: "Company",
|
||||
// PRODUCT: "Product",
|
||||
// };
|
||||
|
||||
export const SIITEMAP_CATEGORIES = {
|
||||
SOLUTIONS: "Solutions",
|
||||
DEVELOPERS: "Developers",
|
||||
RESOURCES: "Resources",
|
||||
ABOUT: "About",
|
||||
};
|
||||
|
||||
export const ALL_NAV_PATHES = [
|
||||
export const PAGETYPE = {
|
||||
EMPTY: 0,
|
||||
CONTENT: 1,
|
||||
EXTERNAL: 2,
|
||||
};
|
||||
|
||||
export const SITEMAP = [
|
||||
{
|
||||
title: "Product",
|
||||
path: "/product",
|
||||
footerCategory: FOOTER_COLUMNS.PRODUCT,
|
||||
title: "Solutions",
|
||||
path: "/solutions",
|
||||
type: PAGETYPE.EMPTY,
|
||||
children: [
|
||||
{
|
||||
title: "Loyalty",
|
||||
path: "/solutions#loyalty",
|
||||
type: PAGETYPE.CONTENT,
|
||||
},
|
||||
{
|
||||
title: "Engine",
|
||||
path: "/solutions#engine",
|
||||
type: PAGETYPE.CONTENT,
|
||||
},
|
||||
{
|
||||
title: "Analytics",
|
||||
path: "/solutions#analytics",
|
||||
type: PAGETYPE.CONTENT,
|
||||
},
|
||||
{
|
||||
title: "Security",
|
||||
path: "/solutions#security",
|
||||
type: PAGETYPE.CONTENT,
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
title: "Team",
|
||||
path: "/team",
|
||||
footerCategory: FOOTER_COLUMNS.COMPANY,
|
||||
title: "Developers",
|
||||
path: "/developers",
|
||||
type: PAGETYPE.EMPTY,
|
||||
children: [
|
||||
{
|
||||
title: "Docs",
|
||||
path: "/docs",
|
||||
type: PAGETYPE.CONTENT,
|
||||
},
|
||||
{
|
||||
title: "Status",
|
||||
path: "/status",
|
||||
type: PAGETYPE.CONTENT,
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
title: "Docs",
|
||||
path: "/docs",
|
||||
footerCategory: FOOTER_COLUMNS.PRODUCT,
|
||||
title: "Resources",
|
||||
path: "/resources",
|
||||
type: PAGETYPE.EMPTY,
|
||||
children: [
|
||||
{
|
||||
title: "whitepapers",
|
||||
path: "/whitepapers",
|
||||
type: PAGETYPE.CONTENT,
|
||||
},
|
||||
{
|
||||
title: "blog",
|
||||
path: "https://blog.moonstream.to",
|
||||
type: PAGETYPE.EXTERNAL,
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
title: "Whitepapers",
|
||||
path: "/whitepapers",
|
||||
footerCategory: FOOTER_COLUMNS.PRODUCT,
|
||||
},
|
||||
{
|
||||
title: "Blog",
|
||||
path: "https://blog.moonstream.to",
|
||||
footerCategory: FOOTER_COLUMNS.NEWS,
|
||||
},
|
||||
{
|
||||
title: "Status",
|
||||
path: "/status",
|
||||
footerCategory: FOOTER_COLUMNS.PRODUCT,
|
||||
title: "About",
|
||||
path: "/about",
|
||||
type: PAGETYPE.EMPTY,
|
||||
children: [
|
||||
{
|
||||
title: "Team",
|
||||
path: "/team",
|
||||
type: PAGETYPE.CONTENT,
|
||||
},
|
||||
],
|
||||
},
|
||||
];
|
||||
|
||||
|
|
Ładowanie…
Reference in New Issue