Commit 146b4369 authored by tom goriunov's avatar tom goriunov Committed by GitHub

Fix drawer backdrop and filters on address tx tab (#2670)

fix drawer backdrop and filters on address tx tab
parent 3cac00de
...@@ -7,15 +7,17 @@ interface DrawerContentProps extends ChakraDrawer.ContentProps { ...@@ -7,15 +7,17 @@ interface DrawerContentProps extends ChakraDrawer.ContentProps {
portalled?: boolean; portalled?: boolean;
portalRef?: React.RefObject<HTMLElement>; portalRef?: React.RefObject<HTMLElement>;
offset?: ChakraDrawer.ContentProps['padding']; offset?: ChakraDrawer.ContentProps['padding'];
backdrop?: boolean;
} }
export const DrawerContent = React.forwardRef< export const DrawerContent = React.forwardRef<
HTMLDivElement, HTMLDivElement,
DrawerContentProps DrawerContentProps
>(function DrawerContent(props, ref) { >(function DrawerContent(props, ref) {
const { children, portalled = true, portalRef, offset, ...rest } = props; const { children, portalled = true, portalRef, offset, backdrop = true, ...rest } = props;
return ( return (
<Portal disabled={ !portalled } container={ portalRef }> <Portal disabled={ !portalled } container={ portalRef }>
{ backdrop && <ChakraDrawer.Backdrop/> }
<ChakraDrawer.Positioner padding={ offset }> <ChakraDrawer.Positioner padding={ offset }>
<ChakraDrawer.Content ref={ ref } { ...rest } asChild={ false }> <ChakraDrawer.Content ref={ ref } { ...rest } asChild={ false }>
{ children } { children }
...@@ -45,8 +47,8 @@ export const DrawerCloseTrigger = React.forwardRef< ...@@ -45,8 +47,8 @@ export const DrawerCloseTrigger = React.forwardRef<
const EMPTY_ELEMENT = () => null; const EMPTY_ELEMENT = () => null;
export const DrawerRoot = (props: ChakraDrawer.RootProps) => { export const DrawerRoot = (props: ChakraDrawer.RootProps) => {
const { initialFocusEl = EMPTY_ELEMENT, ...rest } = props; const { initialFocusEl = EMPTY_ELEMENT, lazyMount = true, unmountOnExit = true, ...rest } = props;
return <ChakraDrawer.Root { ...rest } initialFocusEl={ initialFocusEl }/>; return <ChakraDrawer.Root { ...rest } initialFocusEl={ initialFocusEl } lazyMount={ lazyMount } unmountOnExit={ unmountOnExit }/>;
}; };
export const DrawerTrigger = (props: ChakraDrawer.TriggerProps) => { export const DrawerTrigger = (props: ChakraDrawer.TriggerProps) => {
...@@ -57,7 +59,6 @@ export const DrawerTrigger = (props: ChakraDrawer.TriggerProps) => { ...@@ -57,7 +59,6 @@ export const DrawerTrigger = (props: ChakraDrawer.TriggerProps) => {
export const DrawerFooter = ChakraDrawer.Footer; export const DrawerFooter = ChakraDrawer.Footer;
export const DrawerHeader = ChakraDrawer.Header; export const DrawerHeader = ChakraDrawer.Header;
export const DrawerBody = ChakraDrawer.Body; export const DrawerBody = ChakraDrawer.Body;
export const DrawerBackdrop = ChakraDrawer.Backdrop;
export const DrawerDescription = ChakraDrawer.Description; export const DrawerDescription = ChakraDrawer.Description;
export const DrawerTitle = ChakraDrawer.Title; export const DrawerTitle = ChakraDrawer.Title;
export const DrawerActionTrigger = ChakraDrawer.ActionTrigger; export const DrawerActionTrigger = ChakraDrawer.ActionTrigger;
...@@ -184,7 +184,7 @@ const AddressTxs = ({ overloadCount = OVERLOAD_COUNT, shouldRender = true, isQue ...@@ -184,7 +184,7 @@ const AddressTxs = ({ overloadCount = OVERLOAD_COUNT, shouldRender = true, isQue
return ( return (
<> <>
{ !isMobile && addressTxsQuery.pagination.isVisible && ( { !isMobile && (
<ActionBar> <ActionBar>
{ filter } { filter }
{ currentAddress && csvExportLink } { currentAddress && csvExportLink }
......
...@@ -2,7 +2,7 @@ import { Box, Flex } from '@chakra-ui/react'; ...@@ -2,7 +2,7 @@ import { Box, Flex } from '@chakra-ui/react';
import React from 'react'; import React from 'react';
import config from 'configs/app'; import config from 'configs/app';
import { DrawerBackdrop, DrawerBody, DrawerContent, DrawerRoot, DrawerTrigger } from 'toolkit/chakra/drawer'; import { DrawerBody, DrawerContent, DrawerRoot, DrawerTrigger } from 'toolkit/chakra/drawer';
import { IconButton } from 'toolkit/chakra/icon-button'; import { IconButton } from 'toolkit/chakra/icon-button';
import { useDisclosure } from 'toolkit/hooks/useDisclosure'; import { useDisclosure } from 'toolkit/hooks/useDisclosure';
import IconSvg from 'ui/shared/IconSvg'; import IconSvg from 'ui/shared/IconSvg';
...@@ -35,8 +35,8 @@ const Burger = ({ isMarketplaceAppPage }: Props) => { ...@@ -35,8 +35,8 @@ const Burger = ({ isMarketplaceAppPage }: Props) => {
open={ open } open={ open }
onOpenChange={ onOpenChange } onOpenChange={ onOpenChange }
placement="start" placement="start"
lazyMount={ false }
> >
<DrawerBackdrop/>
<DrawerTrigger> <DrawerTrigger>
<IconButton onClick={ onOpen } p={ 2 } aria-label="Menu button"> <IconButton onClick={ onOpen } p={ 2 } aria-label="Menu button">
<IconSvg <IconSvg
...@@ -48,7 +48,7 @@ const Burger = ({ isMarketplaceAppPage }: Props) => { ...@@ -48,7 +48,7 @@ const Burger = ({ isMarketplaceAppPage }: Props) => {
</IconButton> </IconButton>
</DrawerTrigger> </DrawerTrigger>
<DrawerContent > <DrawerContent >
<DrawerBody display="flex" flexDirection="column" overflow="hidden"> <DrawerBody display="flex" flexDirection="column" overflowX="hidden" overflowY="auto">
<TestnetBadge alignSelf="flex-start"/> <TestnetBadge alignSelf="flex-start"/>
<Flex alignItems="center" justifyContent="space-between"> <Flex alignItems="center" justifyContent="space-between">
<NetworkLogo onClick={ handleNetworkLogoClick }/> <NetworkLogo onClick={ handleNetworkLogoClick }/>
......
...@@ -6,7 +6,7 @@ import type { Screen } from 'ui/snippets/auth/types'; ...@@ -6,7 +6,7 @@ import type { Screen } from 'ui/snippets/auth/types';
import config from 'configs/app'; import config from 'configs/app';
import * as mixpanel from 'lib/mixpanel'; import * as mixpanel from 'lib/mixpanel';
import useAccount from 'lib/web3/useAccount'; import useAccount from 'lib/web3/useAccount';
import { DrawerBackdrop, DrawerBody, DrawerContent, DrawerRoot, DrawerTrigger } from 'toolkit/chakra/drawer'; import { DrawerBody, DrawerContent, DrawerRoot, DrawerTrigger } from 'toolkit/chakra/drawer';
import { useDisclosure } from 'toolkit/hooks/useDisclosure'; import { useDisclosure } from 'toolkit/hooks/useDisclosure';
import AuthModal from 'ui/snippets/auth/AuthModal'; import AuthModal from 'ui/snippets/auth/AuthModal';
import useProfileQuery from 'ui/snippets/auth/useProfileQuery'; import useProfileQuery from 'ui/snippets/auth/useProfileQuery';
...@@ -74,7 +74,6 @@ const UserProfileMobile = () => { ...@@ -74,7 +74,6 @@ const UserProfileMobile = () => {
open={ profileMenu.open } open={ profileMenu.open }
onOpenChange={ handleProfileMenuOpenChange } onOpenChange={ handleProfileMenuOpenChange }
> >
<DrawerBackdrop/>
<DrawerTrigger> <DrawerTrigger>
<UserProfileButton <UserProfileButton
profileQuery={ profileQuery } profileQuery={ profileQuery }
......
...@@ -3,7 +3,7 @@ import React from 'react'; ...@@ -3,7 +3,7 @@ import React from 'react';
import { useMarketplaceContext } from 'lib/contexts/marketplace'; import { useMarketplaceContext } from 'lib/contexts/marketplace';
import useWeb3AccountWithDomain from 'lib/web3/useAccountWithDomain'; import useWeb3AccountWithDomain from 'lib/web3/useAccountWithDomain';
import useWeb3Wallet from 'lib/web3/useWallet'; import useWeb3Wallet from 'lib/web3/useWallet';
import { DrawerTrigger, DrawerRoot, DrawerBackdrop, DrawerContent, DrawerBody } from 'toolkit/chakra/drawer'; import { DrawerTrigger, DrawerRoot, DrawerContent, DrawerBody } from 'toolkit/chakra/drawer';
import { useDisclosure } from 'toolkit/hooks/useDisclosure'; import { useDisclosure } from 'toolkit/hooks/useDisclosure';
import UserWalletButton from './UserWalletButton'; import UserWalletButton from './UserWalletButton';
...@@ -48,7 +48,6 @@ const UserWalletMobile = () => { ...@@ -48,7 +48,6 @@ const UserWalletMobile = () => {
open={ walletMenu.open } open={ walletMenu.open }
onOpenChange={ handleOpenChange } onOpenChange={ handleOpenChange }
> >
<DrawerBackdrop/>
<DrawerTrigger> <DrawerTrigger>
<UserWalletButton <UserWalletButton
variant="header" variant="header"
......
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