Commit 46171bfc authored by Max Alekseenko's avatar Max Alekseenko

remove redundant code

parent 6dd5af69
import { Link, Text, HStack, chakra, shouldForwardProp, useColorModeValue } from '@chakra-ui/react'; import { Link, Text, useColorModeValue } from '@chakra-ui/react';
import NextLink from 'next/link'; import NextLink from 'next/link';
import React from 'react'; import React from 'react';
...@@ -24,6 +24,8 @@ const DeFiDropdownItem = ({ item }: Props) => { ...@@ -24,6 +24,8 @@ const DeFiDropdownItem = ({ item }: Props) => {
w="100%" w="100%"
h="34px" h="34px"
display="flex" display="flex"
alignItems="center"
gap={ 2 }
aria-label={ `${ item.text } link` } aria-label={ `${ item.text } link` }
whiteSpace="nowrap" whiteSpace="nowrap"
color={ useColorModeValue('blackAlpha.800', 'gray.400') } color={ useColorModeValue('blackAlpha.800', 'gray.400') }
...@@ -34,13 +36,11 @@ const DeFiDropdownItem = ({ item }: Props) => { ...@@ -34,13 +36,11 @@ const DeFiDropdownItem = ({ item }: Props) => {
}, },
}} }}
> >
<HStack spacing={ 2 } overflow="hidden">
<IconSvg name={ item.icon } boxSize={ 5 }/> <IconSvg name={ item.icon } boxSize={ 5 }/>
<Text as="span" fontSize="sm"> <Text as="span" fontSize="sm">
<span>{ item.text }</span> <span>{ item.text }</span>
{ !item.dappId && <IconSvg name="arrows/north-east" boxSize={ 4 } color="text_secondary" verticalAlign="middle"/> } { !item.dappId && <IconSvg name="arrows/north-east" boxSize={ 4 } color="text_secondary" verticalAlign="middle"/> }
</Text> </Text>
</HStack>
</Link> </Link>
); );
...@@ -51,16 +51,4 @@ const DeFiDropdownItem = ({ item }: Props) => { ...@@ -51,16 +51,4 @@ const DeFiDropdownItem = ({ item }: Props) => {
) : content; ) : content;
}; };
const DeFiDropdownItemChakra = chakra(DeFiDropdownItem, { export default React.memo(DeFiDropdownItem);
shouldForwardProp: (prop) => {
const isChakraProp = !shouldForwardProp(prop);
if (isChakraProp && prop !== 'px') {
return false;
}
return true;
},
});
export default React.memo(DeFiDropdownItemChakra);
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