-
Notifications
You must be signed in to change notification settings - Fork 102
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
1 parent
14bdc8f
commit d8820fa
Showing
44 changed files
with
674 additions
and
862 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 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
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 - 32) / numColumn - 4; | ||
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, | ||
}, | ||
nftElements: { | ||
flexDirection: 'row', | ||
flexWrap: 'wrap', | ||
}, | ||
columnWrapper: { | ||
gap: 8, | ||
}, | ||
}); |
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,75 @@ | ||
import styled, { RADIUS } from '$styled'; | ||
import { ns } from '$utils'; | ||
import FastImage from 'react-native-fast-image'; | ||
import { Highlight } from '$uikit'; | ||
import { Dimensions } from 'react-native'; | ||
|
||
const deviceWidth = Dimensions.get('window').width; | ||
export const NUM_OF_COLUMNS = Math.trunc(Math.max(2, Math.min(deviceWidth / 171, 3))); | ||
const availableWidth = NUM_OF_COLUMNS === 2 ? (deviceWidth - ns(48)) / 2 : 171; // Padding and margin between NFTs | ||
|
||
export const Wrap = styled.View<{ withMargin: boolean }>` | ||
width: ${availableWidth}px; | ||
margin-right: ${({ withMargin }) => (withMargin ? ns(16) : 0)}px; | ||
margin-bottom: ${ns(16)}px; | ||
`; | ||
|
||
export const Background = styled.View` | ||
background: ${({ theme }) => theme.colors.backgroundSecondary}; | ||
border-radius: ${ns(RADIUS.normal)}px; | ||
position: absolute; | ||
z-index: 0; | ||
top: 0; | ||
left: 0; | ||
right: 0; | ||
bottom: 0; | ||
`; | ||
|
||
export const Pressable = styled(Highlight)` | ||
border-radius: ${ns(RADIUS.normal)}px; | ||
`; | ||
|
||
export const Image = styled(FastImage).attrs({ | ||
resizeMode: 'cover', | ||
})` | ||
position: relative; | ||
z-index: 2; | ||
width: 100%; | ||
height: ${ns(171)}px; | ||
border-top-left-radius: ${ns(RADIUS.normal)}px; | ||
border-top-right-radius: ${ns(RADIUS.normal)}px; | ||
background: ${({ theme }) => theme.colors.backgroundTertiary}; | ||
`; | ||
|
||
export const Badges = styled.View` | ||
position: absolute; | ||
bottom: ${8}px; | ||
right: ${8}px; | ||
flex-direction: row; | ||
align-items: center; | ||
`; | ||
|
||
export const FireBadge = styled.View` | ||
position: absolute; | ||
bottom: ${0}px; | ||
right: ${0}px; | ||
flex-direction: row; | ||
align-items: center; | ||
`; | ||
|
||
export const OnSaleBadge = styled.View` | ||
position: absolute; | ||
top: ${0}px; | ||
right: ${0}px; | ||
flex-direction: row; | ||
align-items: center; | ||
`; | ||
|
||
export const AppearanceBadge = styled.View` | ||
width: ${ns(32)}px; | ||
height: ${ns(32)}px; | ||
border-radius: ${ns(32 / 2)}px; | ||
background: ${({ theme }) => theme.colors.backgroundSecondary}; | ||
align-items: center; | ||
justify-content: center; | ||
`; |
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
5 changes: 0 additions & 5 deletions
5
packages/mobile/src/core/NFTs/AboutCollection/AboutCollection.tsx
This file was deleted.
Oops, something went wrong.
3 changes: 0 additions & 3 deletions
3
packages/mobile/src/core/NFTs/MarketplaceBanner/MarketplaceBanner.interface.ts
This file was deleted.
Oops, something went wrong.
63 changes: 0 additions & 63 deletions
63
packages/mobile/src/core/NFTs/MarketplaceBanner/MarketplaceBanner.style.ts
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.