Commit 9848fdaf authored by tom's avatar tom

styling link item

parent 67dab610
<svg width="24" height="24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M9.293 14.465a1 1 0 0 0 1.414 0l7.778-7.78A1 1 0 0 1 19.899 8.1l-9.192 9.193a1 1 0 0 1-1.414 0l-4.95-4.95a1 1 0 0 1 1.414-1.414l3.536 3.536Z" fill="currentColor"/>
</svg>
\ No newline at end of file
...@@ -12,7 +12,7 @@ const baseStylePopper: SystemStyleObject = { ...@@ -12,7 +12,7 @@ const baseStylePopper: SystemStyleObject = {
}; };
const baseStyleContent: SystemStyleFunction = (props) => { const baseStyleContent: SystemStyleFunction = (props) => {
const bg = mode('white', 'gray.700')(props); const bg = mode('white', 'gray.900')(props);
const shadowColor = mode('gray.200', 'whiteAlpha.300')(props); const shadowColor = mode('gray.200', 'whiteAlpha.300')(props);
return { return {
......
...@@ -22,7 +22,6 @@ const NavLink = ({ text, pathname, icon, isCollapsed }: Props) => { ...@@ -22,7 +22,6 @@ const NavLink = ({ text, pathname, icon, isCollapsed }: Props) => {
return ( return (
<NextLink href={ pathname } passHref> <NextLink href={ pathname } passHref>
<Link <Link
as="li" as="li"
listStyleType="none" listStyleType="none"
......
import { Box } from '@chakra-ui/react'; import { Box, Flex, Icon, Text } from '@chakra-ui/react';
import NextLink from 'next/link';
import React from 'react'; import React from 'react';
import type { NetworkLink } from './types'; import type { NetworkLink } from './types';
import checkIcon from 'icons/check.svg';
import useColors from '../useColors';
type Props = NetworkLink; type Props = NetworkLink;
const NetworkMenuLink = ({ name }: Props) => { const NetworkMenuLink = ({ name, url, icon }: Props) => {
return <Box>{ name }</Box>; const isActive = name === 'Gnosis Chain';
const colors = useColors();
return (
<Box as="li" listStyleType="none">
<NextLink href={ url } passHref>
<Flex
as="a"
px={ 4 }
py={ 2 }
alignItems="center"
cursor="pointer"
borderWidth="1px"
borderColor={ isActive ? colors.border.active : colors.border.default }
borderRadius="base"
color={ isActive ? colors.text.active : colors.text.default }
bgColor={ isActive ? colors.bg.active : colors.bg.default }
_hover={{ color: isActive ? colors.text.active : colors.text.hover }}
>
<Icon
as={ icon }
boxSize="40px"
color="deeppink"
/>
<Text
marginLeft={ 3 }
fontWeight="500"
color="inherit"
>
{ name }
</Text>
{ isActive && (
<Icon
as={ checkIcon }
boxSize="24px"
marginLeft="auto"
/>
) }
</Flex>
</NextLink>
</Box>
);
}; };
export default React.memo(NetworkMenuLink); export default React.memo(NetworkMenuLink);
import { PopoverContent, PopoverBody, Text, Tabs, TabList, TabPanels, TabPanel, Tab } from '@chakra-ui/react'; import { PopoverContent, PopoverBody, Text, Tabs, TabList, TabPanels, TabPanel, Tab, VStack } from '@chakra-ui/react';
import React from 'react'; import React from 'react';
import type { NetworkLink } from './types'; import type { NetworkLink } from './types';
...@@ -42,8 +42,10 @@ const NetworkMenuPopup = () => { ...@@ -42,8 +42,10 @@ const NetworkMenuPopup = () => {
</TabList> </TabList>
<TabPanels> <TabPanels>
{ TABS.map((tab) => ( { TABS.map((tab) => (
<TabPanel key={ tab }> <TabPanel key={ tab } p={ 0 }>
{ LINKS[tab].map((link) => <NetworkMenuLink key={ link.name } { ...link }/>) } <VStack as="ul" spacing={ 2 } alignItems="stretch" mt={ 4 }>
{ LINKS[tab].map((link) => <NetworkMenuLink key={ link.name } { ...link }/>) }
</VStack>
</TabPanel> </TabPanel>
)) } )) }
</TabPanels> </TabPanels>
......
...@@ -11,5 +11,9 @@ export default function useColors() { ...@@ -11,5 +11,9 @@ export default function useColors() {
'default': 'transparent', 'default': 'transparent',
active: useColorModeValue('blue.50', 'gray.800'), active: useColorModeValue('blue.50', 'gray.800'),
}, },
border: {
'default': useColorModeValue('gray.200', 'whiteAlpha.200'),
active: useColorModeValue('blue.50', 'gray.800'),
},
}; };
} }
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