Skip to content

Commit

Permalink
feat: add confirming pill on dapp shortcut claim item (#4005)
Browse files Browse the repository at this point in the history
### Description

As the title - this is in the design and I missed it earlier.

Also fixes the nft gallery title style. <- unrelated but wanted to
squeeze it in for the release, it's faster this way

### Test plan



https://github.com/valora-inc/wallet/assets/20150449/341050a0-4df8-4df2-a036-ff2e90a960aa

![Simulator Screenshot - iPhone 14 Pro - 2023-07-27 at 09 15
28](https://github.com/valora-inc/wallet/assets/20150449/b86d76f6-784c-4c75-be7b-8be6914a1afa)


### Related issues

- Fixes RET-733

### Backwards compatibility

Y
  • Loading branch information
kathaypacific authored Jul 27, 2023
1 parent 99c01bf commit 6655f3b
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 2 deletions.
3 changes: 2 additions & 1 deletion locales/base/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -1340,7 +1340,8 @@
"claimButton": "Claim",
"claimedLabel": "Claimed",
"rewardLabel": "Available reward",
"claimSuccess": "Success! You claimed a reward"
"claimSuccess": "Success! You claimed a reward",
"confirmingReward": "CONFIRMING"
},
"claimRewardFailure": "There was an error claiming your reward, please try again later"
},
Expand Down
20 changes: 20 additions & 0 deletions src/dapps/DappShortcutsRewards.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,13 @@ function DappShortcutsRewards() {
testID="DappShortcutsRewards/RewardAmountFiat"
/>
)}
{item.status === 'accepting' && (
<View style={styles.chip}>
<Text style={styles.chipText}>
{t('dappShortcuts.claimRewardsScreen.confirmingReward')}
</Text>
</View>
)}
</View>
<Button
onPress={createConfirmClaimRewardHandler(item, claimableValueUsd)}
Expand Down Expand Up @@ -257,6 +264,19 @@ const styles = StyleSheet.create({
claimButton: {
minWidth: 72,
},
chip: {
marginTop: Spacing.Smallest8,
backgroundColor: Colors.onboardingLightBlue,
paddingVertical: 2,
paddingHorizontal: Spacing.Smallest8,
borderRadius: 100,
alignSelf: 'flex-start', // prevent from defaulting to full width of container
},
chipText: {
...fontStyles.xsmall600,
fontSize: 10,
lineHeight: 12,
},
})

export default DappShortcutsRewards
5 changes: 4 additions & 1 deletion src/nfts/NftGallery.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import ValoraAnalytics from 'src/analytics/ValoraAnalytics'
import Touchable from 'src/components/Touchable'
import ImageErrorIcon from 'src/icons/ImageErrorIcon'
import DrawerTopBar from 'src/navigator/DrawerTopBar'
import { styles as headerStyles } from 'src/navigator/Headers'
import { navigate } from 'src/navigator/NavigationService'
import { Screens } from 'src/navigator/Screens'
import NftImage from 'src/nfts/NftImage'
Expand Down Expand Up @@ -38,7 +39,9 @@ export default function NftGallery() {

return (
<SafeAreaView testID="NftGallery" style={styles.container} edges={['top']}>
<DrawerTopBar middleElement={<Text>{t('nftGallery.title')}</Text>} />
<DrawerTopBar
middleElement={<Text style={headerStyles.headerTitle}>{t('nftGallery.title')}</Text>}
/>
{error ? (
<NftsLoadError testID="NftGallery/NftsLoadErrorScreen" />
) : (
Expand Down

0 comments on commit 6655f3b

Please sign in to comment.