-
Notifications
You must be signed in to change notification settings - Fork 463
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
19 changed files
with
469 additions
and
103 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import type { AdvancedFilterResponseItem } from 'types/api/advancedFilter'; | ||
|
||
import { ADDRESS_PARAMS } from './addressParams'; | ||
import { TX_HASH } from './tx'; | ||
|
||
export const ADVANCED_FILTER_ITEM: AdvancedFilterResponseItem = { | ||
Check failure on line 6 in stubs/advancedFilter.ts GitHub Actions / Code quality
|
||
fee: '215504444616317', | ||
from: ADDRESS_PARAMS, | ||
hash: TX_HASH, | ||
method: 'approve', | ||
timestamp: '2022-11-11T11:11:11.000000Z', | ||
to: ADDRESS_PARAMS, | ||
token: null, | ||
total: null, | ||
type: 'coin_transfer', | ||
value: '42000420000000000000', | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
import { | ||
Popover, | ||
PopoverTrigger, | ||
PopoverContent, | ||
PopoverBody, | ||
useDisclosure, | ||
IconButton, | ||
chakra, | ||
} from '@chakra-ui/react'; | ||
import React from 'react'; | ||
|
||
import IconSvg from 'ui/shared/IconSvg'; | ||
|
||
interface Props { | ||
columnName: string; | ||
isActive?: boolean; | ||
isLoading?: boolean; | ||
className?: string; | ||
children: React.ReactNode; | ||
} | ||
|
||
const ColumnFilterWrapper = ({ columnName, isActive, className, children, isLoading }: Props) => { | ||
const { isOpen, onToggle, onClose } = useDisclosure(); | ||
|
||
const child = React.Children.only(children) as React.ReactElement & { | ||
ref?: React.Ref<React.ReactNode>; | ||
}; | ||
|
||
const modifiedChildren = React.cloneElement( | ||
child, | ||
{ onClose }, | ||
); | ||
|
||
return ( | ||
<Popover isOpen={ isOpen } onClose={ onClose } placement="bottom-start" isLazy lazyBehavior="unmount"> | ||
<PopoverTrigger> | ||
<IconButton | ||
onClick={ onToggle } | ||
aria-label={ `filter by ${ columnName }` } | ||
variant="ghost" | ||
w="30px" | ||
h="30px" | ||
icon={ <IconSvg name="filter" w="20px" h="20px"/> } | ||
isActive={ isActive } | ||
isDisabled={ isLoading } | ||
/> | ||
</PopoverTrigger> | ||
<PopoverContent className={ className }> | ||
<PopoverBody px={ 4 } py={ 6 } display="flex" flexDir="column" rowGap={ 5 }> | ||
{ modifiedChildren } | ||
</PopoverBody> | ||
</PopoverContent> | ||
</Popover> | ||
); | ||
}; | ||
|
||
export default chakra(ColumnFilterWrapper); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.