-
Notifications
You must be signed in to change notification settings - Fork 74
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feature(mobile): new Wallet screen (#788)
* feature(mobile): new Wallet screen * feature(mobile): New assets list * fix(mobile): Some optimizations * fixes * fix(mobile): Bring back FinishSetupList * fix(mobile): Bring back liquidTf in list * feature(mobile): Memoize and re-calculate only updated content * fix(mobile): TON Content provider fixes * fix * fix(mobile): Screen header * fix(mobile): Wallet screen fixes * fix(mobile): Design review fixes * fix staking buttons label * jettons -> token * fix spacing * fix text color * fix error after conflict resolve
- Loading branch information
1 parent
d0f28fd
commit f254263
Showing
103 changed files
with
2,077 additions
and
1,836 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 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,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, | ||
}, | ||
}); |
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
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
Oops, something went wrong.