-
Notifications
You must be signed in to change notification settings - Fork 82
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #804 from tonkeeper/release/4.3.0
Release 4.3.0
- Loading branch information
Showing
206 changed files
with
5,718 additions
and
3,993 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
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 was deleted.
Oops, something went wrong.
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,59 @@ | ||
import React, { memo, useMemo } from 'react'; | ||
import { View } from '$uikit'; | ||
import { NFTCardItem } from './NFTCardItem'; | ||
import { Steezy } from '$styles'; | ||
import { useWindowDimensions } from 'react-native'; | ||
import { useApprovedNfts } from '$hooks/useApprovedNfts'; | ||
import { Screen } from '@tonkeeper/uikit'; | ||
import { t } from '@tonkeeper/shared/i18n'; | ||
|
||
const mockupCardSize = { | ||
width: 114, | ||
height: 166, | ||
}; | ||
|
||
const numColumn = 3; | ||
const heightRatio = mockupCardSize.height / mockupCardSize.width; | ||
|
||
export const Collectibles = memo(() => { | ||
const nfts = useApprovedNfts(); | ||
const dimensions = useWindowDimensions(); | ||
|
||
const size = useMemo(() => { | ||
const width = (dimensions.width - 48) / numColumn; | ||
const height = width * heightRatio; | ||
|
||
return { width, height }; | ||
}, [dimensions.width]); | ||
|
||
return ( | ||
<Screen> | ||
<Screen.LargeHeader title={t('tab_collectibles')} /> | ||
<Screen.FlashList | ||
contentContainerStyle={styles.collectiblesContainer.static} | ||
data={nfts.enabled} | ||
numColumns={3} | ||
columnWrapperStyle={styles.columnWrapper.static} | ||
renderItem={({ item }) => ( | ||
<View style={size}> | ||
<NFTCardItem item={item} /> | ||
</View> | ||
)} | ||
/> | ||
</Screen> | ||
); | ||
}); | ||
|
||
const styles = Steezy.create({ | ||
collectiblesContainer: { | ||
marginHorizontal: 16, | ||
gap: 8, | ||
}, | ||
nftElements: { | ||
flexDirection: 'row', | ||
flexWrap: 'wrap', | ||
}, | ||
columnWrapper: { | ||
gap: 8, | ||
}, | ||
}); |
Oops, something went wrong.