Commit d5f207f5 authored by isstuev's avatar isstuev

fix

parent d09cd603
...@@ -75,6 +75,10 @@ const variantOutline = defineStyle((props) => { ...@@ -75,6 +75,10 @@ const variantOutline = defineStyle((props) => {
borderColor: props.isActive ? activeBg : 'blue.400', borderColor: props.isActive ? activeBg : 'blue.400',
color: props.isActive ? activeColor : 'blue.400', color: props.isActive ? activeColor : 'blue.400',
}, },
_disabled: {
color,
borderColor,
},
}, },
_disabled: { _disabled: {
opacity: 0.2, opacity: 0.2,
...@@ -83,6 +87,10 @@ const variantOutline = defineStyle((props) => { ...@@ -83,6 +87,10 @@ const variantOutline = defineStyle((props) => {
bg: activeBg, bg: activeBg,
borderColor: activeBg, borderColor: activeBg,
color: activeColor, color: activeColor,
_disabled: {
color,
borderColor,
},
}, },
}; };
}); });
......
...@@ -12,8 +12,7 @@ import { ...@@ -12,8 +12,7 @@ import {
StatArrow, StatArrow,
Portal, Portal,
Link, Link,
Center, Button,
useColorModeValue,
} from '@chakra-ui/react'; } from '@chakra-ui/react';
import React, { useRef } from 'react'; import React, { useRef } from 'react';
...@@ -29,39 +28,33 @@ const TxStateTableItem = ({ txStateItem }: { txStateItem: TTxStateItem }) => { ...@@ -29,39 +28,33 @@ const TxStateTableItem = ({ txStateItem }: { txStateItem: TTxStateItem }) => {
const hasStorageData = Boolean(txStateItem.storage?.length); const hasStorageData = Boolean(txStateItem.storage?.length);
// FIXME: I'm not sure about dark theme colors
const storageCounterBgColor = useColorModeValue('blue.50', 'gray.800');
const storageCounterColor = useColorModeValue('blue.700', 'gray.50');
const storageBorderColor = useColorModeValue('gray.200', 'gray.600');
return ( return (
<> <>
<AccordionItem as="tr" isDisabled={ !hasStorageData } fontWeight={ 500 } border={ 0 }> <AccordionItem as="tr" isDisabled={ !hasStorageData } fontWeight={ 500 } border={ 0 }>
{ ({ isExpanded }) => ( { ({ isExpanded }) => (
<> <>
<Td border={ 0 }> <Td border={ 0 }>
<Flex> <AccordionButton
<Center _hover={{ background: 'unset' }}
background={ isExpanded ? storageCounterBgColor : 'unset' } padding="0"
color={ storageCounterColor } >
width="30px" <Button
height="30px" variant="outline"
borderRadius="6px" borderWidth="1px"
border={ isExpanded ? 'none' : '1px solid' } // button can't be inside button (AccordionButton)
borderColor={ storageBorderColor } as="div"
opacity={ hasStorageData ? 1 : 0.2 } isActive={ isExpanded }
size="sm"
fontWeight={ 400 }
isDisabled={ !hasStorageData }
colorScheme="gray"
// AccordionButton has its own opacity rule when disabled
_disabled={{ opacity: 1 }}
> >
{ txStateItem.storage?.length || '0' } { txStateItem.storage?.length || '0' }
</Center> </Button>
<AccordionButton <AccordionIcon color="blue.600" width="30px"/>
_hover={{ background: 'unset', cursor: 'pointer' }} </AccordionButton>
padding="0"
width="30px"
justifyContent="center"
>
<AccordionIcon color="blue.600"/>
</AccordionButton>
</Flex>
</Td> </Td>
<Td border={ 0 }> <Td border={ 0 }>
<Flex height="30px" alignItems="center"> <Flex height="30px" alignItems="center">
...@@ -73,7 +66,7 @@ const TxStateTableItem = ({ txStateItem }: { txStateItem: TTxStateItem }) => { ...@@ -73,7 +66,7 @@ const TxStateTableItem = ({ txStateItem }: { txStateItem: TTxStateItem }) => {
<Td border={ 0 } isNumeric lineHeight="30px"> <Td border={ 0 } isNumeric lineHeight="30px">
<Box>{ txStateItem.after.balance }</Box> <Box>{ txStateItem.after.balance }</Box>
{ typeof txStateItem.after.nonce !== 'undefined' && ( { typeof txStateItem.after.nonce !== 'undefined' && (
<Flex justifyContent="end">Nonce: <Text fontWeight={ 600 }>{ nbsp + txStateItem.after.nonce }</Text></Flex> <Box justifyContent="end" display="inline-flex">Nonce: <Text fontWeight={ 600 }>{ nbsp + txStateItem.after.nonce }</Text></Box>
) } ) }
</Td> </Td>
<Td border={ 0 } isNumeric lineHeight="30px">{ txStateItem.before.balance }</Td> <Td border={ 0 } isNumeric lineHeight="30px">{ txStateItem.before.balance }</Td>
......
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