-
Notifications
You must be signed in to change notification settings - Fork 454
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
24 changed files
with
419 additions
and
4 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
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,19 @@ | ||
import type { NextPage } from 'next'; | ||
import dynamic from 'next/dynamic'; | ||
import React from 'react'; | ||
|
||
import PageNextJs from 'nextjs/PageNextJs'; | ||
|
||
const TokenTransfers = dynamic(() => import('ui/pages/TokenTransfers'), { ssr: false }); | ||
|
||
const Page: NextPage = () => { | ||
return ( | ||
<PageNextJs pathname="/token-transfers"> | ||
<TokenTransfers/> | ||
</PageNextJs> | ||
); | ||
}; | ||
|
||
export default Page; | ||
|
||
export { base as getServerSideProps } from 'nextjs/getServerSideProps'; |
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
Empty file.
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,14 @@ | ||
import { Box } from '@chakra-ui/react'; | ||
import React from 'react'; | ||
|
||
import { mixTokens } from 'mocks/tokens/tokenTransfer'; | ||
import { test, expect } from 'playwright/lib'; | ||
|
||
import TokenTransfers from './TokenTransfers'; | ||
|
||
test('base view +@mobile', async({ render, mockTextAd, mockApiResponse }) => { | ||
await mockTextAd(); | ||
await mockApiResponse('token_transfers_all', mixTokens, { queryParams: { type: [] } }); | ||
const component = await render(<Box pt={{ base: '106px', lg: 0 }}> <TokenTransfers/> </Box>); | ||
await expect(component).toHaveScreenshot(); | ||
}); |
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,86 @@ | ||
import { Show, Hide } from '@chakra-ui/react'; | ||
import { useRouter } from 'next/router'; | ||
import React from 'react'; | ||
|
||
import type { TokenType } from 'types/api/token'; | ||
|
||
import { getTokenTransfersStub } from 'stubs/token'; | ||
import ActionBar, { ACTION_BAR_HEIGHT_DESKTOP } from 'ui/shared/ActionBar'; | ||
import DataListDisplay from 'ui/shared/DataListDisplay'; | ||
import PopoverFilter from 'ui/shared/filters/PopoverFilter'; | ||
import TokenTypeFilter from 'ui/shared/filters/TokenTypeFilter'; | ||
import PageTitle from 'ui/shared/Page/PageTitle'; | ||
import Pagination from 'ui/shared/pagination/Pagination'; | ||
import useQueryWithPages from 'ui/shared/pagination/useQueryWithPages'; | ||
import { getTokenFilterValue } from 'ui/tokens/utils'; | ||
import TokenTransfersListItem from 'ui/tokenTransfers/TokenTransfersListItem'; | ||
import TokenTransfersTable from 'ui/tokenTransfers/TokenTransfersTable'; | ||
const TokenTransfers = () => { | ||
const router = useRouter(); | ||
const [ typeFilter, setTypeFilter ] = React.useState<Array<TokenType>>(getTokenFilterValue(router.query.type) || []); | ||
|
||
const tokenTransfersQuery = useQueryWithPages({ | ||
resourceName: 'token_transfers_all', | ||
filters: { type: typeFilter }, | ||
options: { | ||
placeholderData: getTokenTransfersStub(), | ||
}, | ||
}); | ||
|
||
const handleTokenTypesChange = React.useCallback((value: Array<TokenType>) => { | ||
tokenTransfersQuery.onFilterChange({ type: value }); | ||
setTypeFilter(value); | ||
}, [ tokenTransfersQuery ]); | ||
|
||
const content = ( | ||
<> | ||
<Show below="lg" ssr={ false }> | ||
{ tokenTransfersQuery.data?.items.map((item, index) => ( | ||
<TokenTransfersListItem | ||
key={ item.block_number + item.log_index + (tokenTransfersQuery.isPlaceholderData ? index : '') } | ||
isLoading={ tokenTransfersQuery.isPlaceholderData } | ||
item={ item } | ||
/> | ||
)) } | ||
</Show> | ||
<Hide below="lg" ssr={ false }> | ||
<TokenTransfersTable | ||
items={ tokenTransfersQuery.data?.items } | ||
top={ tokenTransfersQuery.pagination.isVisible ? ACTION_BAR_HEIGHT_DESKTOP : 0 } | ||
isLoading={ tokenTransfersQuery.isPlaceholderData } | ||
/> | ||
</Hide> | ||
</> | ||
); | ||
|
||
const filter = ( | ||
<PopoverFilter contentProps={{ w: '200px' }} appliedFiltersNum={ typeFilter.length }> | ||
<TokenTypeFilter<TokenType> onChange={ handleTokenTypesChange } defaultValue={ typeFilter } nftOnly={ false }/> | ||
</PopoverFilter> | ||
); | ||
|
||
const actionBar = ( | ||
<ActionBar mt={ -6 }> | ||
{ filter } | ||
<Pagination { ...tokenTransfersQuery.pagination }/> | ||
</ActionBar> | ||
); | ||
|
||
return ( | ||
<> | ||
<PageTitle | ||
title="Token Transfers" | ||
withTextAd | ||
/> | ||
<DataListDisplay | ||
isError={ tokenTransfersQuery.isError } | ||
items={ tokenTransfersQuery.data?.items } | ||
emptyText="There are no token transfers." | ||
content={ content } | ||
actionBar={ actionBar } | ||
/> | ||
</> | ||
); | ||
}; | ||
|
||
export default TokenTransfers; |
Binary file added
BIN
+110 KB
ui/pages/__screenshots__/TokenTransfers.pw.tsx_default_base-view-mobile-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+138 KB
ui/pages/__screenshots__/TokenTransfers.pw.tsx_mobile_base-view-mobile-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-6.29 KB
(88%)
...ut/__screenshots__/Layout.pw.tsx_default_xxl-screen-horizontal-navigation-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-7.44 KB
(88%)
...yout/__screenshots__/Layout.pw.tsx_default_xxl-screen-vertical-navigation-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.