Commit 5cb9197b authored by tom's avatar tom

add link to logo

parent 12f23e5b
......@@ -16,9 +16,10 @@ const Burger = () => {
setNetworkMenuVisibility((flag) => !flag);
}, []);
const handleNetworkLogoClick = React.useCallback(() => {
const handleNetworkLogoClick = React.useCallback((event: React.SyntheticEvent) => {
isNetworkMenuOpened && event.preventDefault();
setNetworkMenuVisibility(false);
}, []);
}, [ isNetworkMenuOpened ]);
return (
<>
......
import { Icon, Box, useColorModeValue } from '@chakra-ui/react';
import NextLink from 'next/link';
import React from 'react';
import logoIcon from 'icons/logo.svg';
import useBasePath from 'lib/hooks/useBasePath';
import getDefaultTransitionProps from 'theme/utils/getDefaultTransitionProps';
interface Props {
isCollapsed?: boolean;
onClick?: () => void;
onClick?: (event: React.SyntheticEvent) => void;
}
const NetworkLogo = ({ isCollapsed, onClick }: Props) => {
const logoColor = useColorModeValue('blue.600', 'white');
const href = useBasePath();
return (
<Box
width={ isCollapsed ? '0' : '113px' }
display="inline-flex"
overflow="hidden"
onClick={ onClick }
{ ...getDefaultTransitionProps({ transitionProperty: 'width' }) }
>
<Icon
as={ logoIcon }
width="113px"
height="20px"
color={ logoColor }
{ ...getDefaultTransitionProps() }
/>
</Box>
<NextLink href={ href } passHref>
<Box
as="a"
width={ isCollapsed ? '0' : '113px' }
display="inline-flex"
overflow="hidden"
onClick={ onClick }
{ ...getDefaultTransitionProps({ transitionProperty: 'width' }) }
>
<Icon
as={ logoIcon }
width="113px"
height="20px"
color={ logoColor }
{ ...getDefaultTransitionProps() }
/>
</Box>
</NextLink>
);
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment