Updated claim button to match previous design

This commit is contained in:
Nouman Tahir 2022-02-21 10:22:54 +05:00
parent e2b888b8b7
commit 1aa0b45730
3 changed files with 68 additions and 17 deletions

View File

@ -81,7 +81,7 @@
"fill_convert_request": "Convert Executed", "fill_convert_request": "Convert Executed",
"fill_transfer_from_savings": "Savings Executed", "fill_transfer_from_savings": "Savings Executed",
"fill_vesting_withdraw": "PowerDown executed", "fill_vesting_withdraw": "PowerDown executed",
"estm": { "ecency": {
"title": "Points", "title": "Points",
"buy": "GET POINTS" "buy": "GET POINTS"
}, },

View File

@ -25,6 +25,36 @@ export default EStyleSheet.create({
flex:1, flex:1,
} as ViewStyle, } as ViewStyle,
claimContainer:{
flexDirection:'row',
justifyContent:'center',
alignItems:'center',
marginTop:8
} as ViewStyle,
claimBtn:{
flexDirection: 'row',
paddingHorizontal: 16
} as ViewStyle,
claimBtnTitle:{
color: '$pureWhite',
fontSize: 14,
fontWeight: 'bold',
alignSelf: 'center',
} as ViewStyle,
claimIconWrapper: {
backgroundColor: '$pureWhite',
justifyContent: 'center',
alignSelf: 'center',
alignItems: 'center',
borderRadius: 20,
marginLeft: 20,
width: 24,
height: 24,
} as ViewStyle,
logo:{ logo:{
height:24, height:24,
width:24, width:24,

View File

@ -1,25 +1,29 @@
import { View, Text, Dimensions, TouchableOpacity } from 'react-native'; import { View, Text, Dimensions, TouchableOpacity } from 'react-native';
import React, { ComponentType } from 'react'; import React, { ComponentType, Fragment } from 'react';
import styles from './children.styles'; import styles from './children.styles';
import { MainButton, SimpleChart, TextButton } from '../../../components'; import { Icon, MainButton, SimpleChart, TextButton } from '../../../components';
import { COIN_IDS } from '../../../constants/defaultCoins'; import { COIN_IDS } from '../../../constants/defaultCoins';
import { useIntl } from 'react-intl';
import EStyleSheet from 'react-native-extended-stylesheet';
export interface CoinCardProps { export interface CoinCardProps {
chartData:number[] id:string;
name:string, chartData:number[];
notCrypto:boolean, name:string;
symbol:string, notCrypto:boolean;
currencySymbol:string, symbol:string;
changePercent:number, currencySymbol:string;
currentValue:number, changePercent:number;
ownedTokens:number, currentValue:number;
unclaimedRewards:string, ownedTokens:number;
enableBuy?:boolean, unclaimedRewards:string;
enableBuy?:boolean;
footerComponent:ComponentType<any> footerComponent:ComponentType<any>
onPress:()=>void onPress:()=>void
} }
export const CoinCard = ({ export const CoinCard = ({
id,
notCrypto, notCrypto,
chartData, chartData,
name, name,
@ -38,6 +42,8 @@ export const CoinCard = ({
return null return null
} }
const intl = useIntl();
const _renderHeader = ( const _renderHeader = (
<View style={styles.cardHeader}> <View style={styles.cardHeader}>
{/* <View style={styles.logo} /> */} {/* <View style={styles.logo} /> */}
@ -56,11 +62,26 @@ export const CoinCard = ({
const _renderClaimSection = () => { const _renderClaimSection = () => {
if(unclaimedRewards || enableBuy){ if(unclaimedRewards || enableBuy){
const btnTitle = unclaimedRewards const btnTitle = unclaimedRewards
? unclaimedRewards + '\nCLAIM' ? unclaimedRewards
: 'GET MORE' : intl.formatMessage({ id: `wallet.${id}.buy`});
return ( return (
<View style={{flexDirection:'row', justifyContent:'center', alignItems:'center', marginTop:8}}> <View style={styles.claimContainer}>
<MainButton style={{paddingHorizontal:24}} text={btnTitle} onPress={()=>{}} /> <MainButton
isLoading={false}
isDisable={false}
style={styles.claimBtn}
height={50}
onPress={() => {}}
>
<Fragment>
<Text style={styles.claimBtnTitle}>
{btnTitle}
</Text>
<View style={styles.claimIconWrapper}>
<Icon name="add" iconType="MaterialIcons" color={EStyleSheet.value('$primaryBlue')} size={23} />
</View>
</Fragment>
</MainButton>
</View> </View>
) )
} }