diff --git a/hyperglass/ui/components/Footer/button.tsx b/hyperglass/ui/components/Footer/button.tsx
index 2dd8d40..42b0948 100644
--- a/hyperglass/ui/components/Footer/button.tsx
+++ b/hyperglass/ui/components/Footer/button.tsx
@@ -1,30 +1,29 @@
-import { Button } from '@chakra-ui/react';
-import { AnimatedDiv } from '~/components';
+import { Button, Menu, MenuButton, MenuList } from '@chakra-ui/react';
+import { Markdown } from '~/components';
import type { TFooterButton } from './types';
export const FooterButton = (props: TFooterButton) => {
- const { side, href, ...rest } = props;
-
- let buttonProps = Object();
- if (typeof href !== 'undefined') {
- buttonProps = { href, as: 'a', target: '_blank', rel: 'noopener noreferrer' };
- }
-
+ const { content, title, side, ...rest } = props;
+ const placement = side === 'left' ? 'top-end' : side === 'right' ? 'top-start' : undefined;
return (
-
-
-
+
);
};
diff --git a/hyperglass/ui/components/Footer/content.tsx b/hyperglass/ui/components/Footer/content.tsx
deleted file mode 100644
index 4a3944f..0000000
--- a/hyperglass/ui/components/Footer/content.tsx
+++ /dev/null
@@ -1,28 +0,0 @@
-import { Drawer, DrawerBody, DrawerOverlay, DrawerContent } from '@chakra-ui/react';
-import { Markdown } from '~/components';
-
-import type { TFooterContent } from './types';
-
-export const FooterContent = (props: TFooterContent) => {
- const { isOpen, onClose, content, side = 'left', ...rest } = props;
- return (
-
-
-
-
-
-
-
-
-
- );
-};
diff --git a/hyperglass/ui/components/Footer/footer.tsx b/hyperglass/ui/components/Footer/footer.tsx
index c4b8922..b998963 100644
--- a/hyperglass/ui/components/Footer/footer.tsx
+++ b/hyperglass/ui/components/Footer/footer.tsx
@@ -1,101 +1,56 @@
-import { Box, Flex, useDisclosure } from '@chakra-ui/react';
-import { FiCode } from '@meronex/icons/fi';
-import { GoLinkExternal } from '@meronex/icons/go';
-import stringFormat from 'string-format';
+import dynamic from 'next/dynamic';
+import { Button, Flex, Link } from '@chakra-ui/react';
import { If } from '~/components';
import { useConfig, useColorValue } from '~/context';
+import { useStrf } from '~/hooks';
import { FooterButton } from './button';
-import { FooterContent } from './content';
+
+const CodeIcon = dynamic(() => import('@meronex/icons/fi').then(i => i.FiCode));
+const ExtIcon = dynamic(() => import('@meronex/icons/go').then(i => i.GoLinkExternal));
export const Footer = () => {
const { web, content, primary_asn } = useConfig();
- const help = useDisclosure();
- const terms = useDisclosure();
- const credit = useDisclosure();
const footerBg = useColorValue('blackAlpha.50', 'whiteAlpha.100');
const footerColor = useColorValue('black', 'white');
- const contentBorder = useColorValue('blackAlpha.100', 'whiteAlpha.200');
- const extUrl = web.external_link.url.includes('{primary_asn}')
- ? stringFormat(web.external_link.url, { primary_asn })
- : web.external_link.url ?? '/';
+ const extUrl = useStrf(web.external_link.url, { primary_asn }) ?? '/';
return (
- <>
- {web.help_menu.enable && (
-
- )}
- {web.terms.enable && (
-
- )}
- {web.credit.enable && (
-
- )}
-
-
-
- {web.terms.title}
-
-
-
-
- {web.help_menu.title}
-
-
-
-
-
-
-
-
-
- }>
- {web.external_link.title}
-
-
-
- >
+
+
+
+
+
+
+
+
+
+ } />
+
+
+ }
+ aria-label={web.external_link.title}>
+ {web.external_link.title}
+
+
+
);
};
diff --git a/hyperglass/ui/components/Footer/types.ts b/hyperglass/ui/components/Footer/types.ts
index 5f9fabc..4695ed7 100644
--- a/hyperglass/ui/components/Footer/types.ts
+++ b/hyperglass/ui/components/Footer/types.ts
@@ -1,16 +1,11 @@
-import type { ButtonProps, DrawerProps, DrawerContentProps } from '@chakra-ui/react';
+import type { MenuListProps } from '@chakra-ui/react';
type TFooterSide = 'left' | 'right';
-export interface TFooterButton extends ButtonProps {
+export interface TFooterButton extends Omit {
side: TFooterSide;
- href?: string;
-}
-
-export interface TFooterContent extends Omit, DrawerContentProps {
- isOpen: boolean;
+ title?: MenuListProps['children'];
content: string;
- side: TFooterSide;
}
export type TFooterItems = 'help' | 'credit' | 'terms';
diff --git a/hyperglass/ui/components/Util/animated.ts b/hyperglass/ui/components/Util/animated.ts
index 8c4b41a..43d29ed 100644
--- a/hyperglass/ui/components/Util/animated.ts
+++ b/hyperglass/ui/components/Util/animated.ts
@@ -1,4 +1,5 @@
import { chakra } from '@chakra-ui/react';
import { motion } from 'framer-motion';
-export const AnimatedDiv = chakra(motion.div);
+export const AnimatedDiv = motion.custom(chakra.div);
+export const AnimatedForm = motion.custom(chakra.form);
diff --git a/hyperglass/ui/components/buttons/submit.tsx b/hyperglass/ui/components/buttons/submit.tsx
index 16cb819..56ee636 100644
--- a/hyperglass/ui/components/buttons/submit.tsx
+++ b/hyperglass/ui/components/buttons/submit.tsx
@@ -46,9 +46,9 @@ export const SubmitButton = forwardRef((props, re
} = props;
const _isDisabled = isDisabled || isLoading;
- const bg = useColorValue('primary.500', 'primary.300');
- const bgActive = useColorValue('primary.600', 'primary.400');
- const bgHover = useColorValue('primary.400', 'primary.200');
+ const bg = useColorValue('primary.400', 'primary.500');
+ const bgActive = useColorValue('primary.500', 'primary.600');
+ const bgHover = useColorValue('primary.300', 'primary.400');
const color = useOpposingColor(bg);
const colorActive = useOpposingColor(bgActive);
const colorHover = useOpposingColor(bgHover);
diff --git a/hyperglass/ui/components/debugger.tsx b/hyperglass/ui/components/debugger.tsx
index 52732e7..17125ec 100644
--- a/hyperglass/ui/components/debugger.tsx
+++ b/hyperglass/ui/components/debugger.tsx
@@ -41,12 +41,12 @@ export const Debugger = () => {
position="relative"
justifyContent="center"
borderColor={borderColor}>
- {colorMode.toUpperCase()}
- {mediaSize}
-