Commit c5e5d90a authored by tom's avatar tom

fix "button in button"

parent f55f8a6c
...@@ -27,6 +27,7 @@ const AddressTxsFilter = ({ onFilterChange, defaultFilter, isActive }: Props) => ...@@ -27,6 +27,7 @@ const AddressTxsFilter = ({ onFilterChange, defaultFilter, isActive }: Props) =>
<FilterButton <FilterButton
isActive={ isOpen || isActive } isActive={ isOpen || isActive }
onClick={ onToggle } onClick={ onToggle }
as="div"
/> />
</MenuButton> </MenuButton>
<MenuList zIndex={ 2 }> <MenuList zIndex={ 2 }>
......
import type { As } from '@chakra-ui/react';
import { Box, Button, Circle, Icon, useColorModeValue } from '@chakra-ui/react'; import { Box, Button, Circle, Icon, useColorModeValue } from '@chakra-ui/react';
import React from 'react'; import React from 'react';
...@@ -9,9 +10,10 @@ interface Props { ...@@ -9,9 +10,10 @@ interface Props {
isActive?: boolean; isActive?: boolean;
appliedFiltersNum?: number; appliedFiltersNum?: number;
onClick: () => void; onClick: () => void;
as?: As;
} }
const FilterButton = ({ isActive, appliedFiltersNum, onClick }: Props, ref: React.ForwardedRef<HTMLButtonElement>) => { const FilterButton = ({ isActive, appliedFiltersNum, onClick, as }: Props, ref: React.ForwardedRef<HTMLButtonElement>) => {
const badgeColor = useColorModeValue('white', 'black'); const badgeColor = useColorModeValue('white', 'black');
const badgeBgColor = useColorModeValue('blue.700', 'gray.50'); const badgeBgColor = useColorModeValue('blue.700', 'gray.50');
...@@ -27,6 +29,7 @@ const FilterButton = ({ isActive, appliedFiltersNum, onClick }: Props, ref: Reac ...@@ -27,6 +29,7 @@ const FilterButton = ({ isActive, appliedFiltersNum, onClick }: Props, ref: Reac
isActive={ isActive } isActive={ isActive }
px={ 1.5 } px={ 1.5 }
flexShrink={ 0 } flexShrink={ 0 }
as={ as }
> >
{ FilterIcon } { FilterIcon }
<Box display={{ base: 'none', lg: 'block' }}>Filter</Box> <Box display={{ base: 'none', lg: 'block' }}>Filter</Box>
......
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