Skip to content

Commit

Permalink
input and token balance
Browse files Browse the repository at this point in the history
  • Loading branch information
rodrigoncalves committed Mar 21, 2024
1 parent ea77584 commit 9f3e7c1
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 26 deletions.
4 changes: 2 additions & 2 deletions src/components/address/AddressInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ interface StatusObject {
const typeColorMap = new Map([
[Status.ERROR, sharedColors.danger],
[Status.SUCCESS, sharedColors.success],
[Status.INFO, sharedColors.inputLabelColor],
[Status.INFO, sharedColors.text.label],
])

const defaultStatus = { type: Status.READY, value: '' }
Expand Down Expand Up @@ -333,7 +333,7 @@ export const AddressInput = ({
autoCorrect={false}
autoCapitalize={'none'}
placeholder={placeholder}
placeholderTextColor={sharedColors.inputLabelColor}
placeholderTextColor={sharedColors.text.label}
rightIcon={
!(value.address || value.displayAddress)
? {
Expand Down
2 changes: 1 addition & 1 deletion src/components/button/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ export const AppButton = ({
disabledStyle,
accessibilityLabel = '',
onPress,
color = sharedColors.inputInactive,
color = sharedColors.background.secondary,
textColor = sharedColors.text.primary,
textType = 'button1',
backgroundVariety = AppButtonBackgroundVarietyEnum.DEFAULT,
Expand Down
18 changes: 9 additions & 9 deletions src/components/input/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ export const Input = ({
<Icon
name={leftIcon.name}
size={leftIcon.size || defaultIconSize}
color={leftIcon.color || sharedColors.white}
color={leftIcon.color || sharedColors.text.primary}
/>
</AppTouchable>
) : (
Expand Down Expand Up @@ -187,7 +187,7 @@ export const Input = ({
style={styles.rightIcon}
name={'close'}
size={defaultIconSize}
color={sharedColors.white}
color={sharedColors.text.primary}
/>
</AppTouchable>
) : rightIcon && 'name' in rightIcon ? (
Expand All @@ -196,7 +196,7 @@ export const Input = ({
style={styles.rightIcon}
name={rightIcon.name}
size={rightIcon.size || defaultIconSize}
color={rightIcon.color || sharedColors.white}
color={rightIcon.color || sharedColors.text.primary}
/>
</Pressable>
) : (
Expand All @@ -213,23 +213,23 @@ const styles = StyleSheet.create({
flexDirection: 'row',
justifyContent: 'space-between',
alignItems: 'center',
backgroundColor: sharedColors.inputInactive,
backgroundColor: sharedColors.background.secondary,
paddingLeft: 16,
paddingRight: 16,
marginTop: 12,
borderRadius: 10,
minHeight: 80,
}),
containerActive: castStyle.view({
backgroundColor: sharedColors.inputActive,
backgroundColor: sharedColors.input.active,
}),
contentPadding: castStyle.view({
paddingBottom: 18,
}),
label: castStyle.text({
marginTop: 10,
marginBottom: 4,
color: sharedColors.inputLabelColor,
color: sharedColors.text.label,
}),
valueContainer: castStyle.view({
flex: 1,
Expand All @@ -243,17 +243,17 @@ const styles = StyleSheet.create({
marginLeft: 12,
}),
subtitle: castStyle.text({
color: sharedColors.inputLabelColor,
color: sharedColors.text.label,
}),
rightIcon: castStyle.text({
padding: defaultIconSize,
}),
placeholderText: castStyle.text({
flex: 1,
color: sharedColors.inputLabelColor,
color: sharedColors.text.label,
}),
valueText: castStyle.text({
marginTop: 14,
color: sharedColors.white,
color: sharedColors.text.primary,
}),
})
19 changes: 9 additions & 10 deletions src/components/token/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -102,15 +102,15 @@ export const TokenBalance = ({
</View>
)}
{firstValue.symbolType === 'usd' && (
<DollarIcon size={30} color={sharedColors.white} />
<DollarIcon size={30} color={sharedColors.text.primary} />
)}
<TextInput
onChangeText={handleAmountChange}
value={hide ? '\u002A\u002A\u002A\u002A' : firstValueBalance}
keyboardType="numeric"
accessibilityLabel={'Amount.Input'}
placeholder="0"
placeholderTextColor={sharedColors.inputLabelColor}
placeholderTextColor={sharedColors.text.label}
style={[styles.input, sharedStyles.flex]}
editable={editable}
multiline={false}
Expand All @@ -126,15 +126,15 @@ export const TokenBalance = ({
{secondValue?.symbolType === 'usd' && (
<>
{secondValue.symbol === '<' && (
<Typography type="body1" style={styles.subTitle}>
<Typography type="body1" style={styles.secondValue}>
{'<'}
</Typography>
)}
<DollarIcon size={16} color={sharedColors.labelLight} />
<DollarIcon size={16} color={sharedColors.text.label} />
</>
)}
{!isNaN(Number(secondValue?.balance)) && (
<Typography type="body1" style={styles.subTitle}>
<Typography type="body1" style={styles.secondValue}>
{hide
? '\u002A\u002A\u002A\u002A\u002A\u002A'
: secondValue
Expand Down Expand Up @@ -193,7 +193,7 @@ export const TokenBalance = ({
<View style={styles.badge}>
<Icon
name="ios-swap-vertical"
color={sharedColors.white}
color={sharedColors.text.primary}
size={25}
/>
</View>
Expand Down Expand Up @@ -236,9 +236,8 @@ const styles = StyleSheet.create({
width: 20,
height: 20,
}),
subTitle: castStyle.text({
color: sharedColors.subTitle,
opacity: 0.7,
secondValue: castStyle.text({
color: sharedColors.text.label,
}),
error: castStyle.text({
color: sharedColors.dangerLight,
Expand All @@ -250,7 +249,7 @@ const styles = StyleSheet.create({
flexDirection: 'row',
}),
input: castStyle.text({
color: sharedColors.white,
color: sharedColors.text.primary,
fontWeight: '500',
fontSize: 36,
padding: 0,
Expand Down
6 changes: 2 additions & 4 deletions src/screens/send/TransactionForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,6 @@ export const TransactionForm = ({
style={styles.marginTop10}
firstValue={firstBalance}
secondValue={secondBalance}
color={sharedColors.black}
error={hasEnoughBalance ? t('transaction_form_error_balance') : ''}
onSwap={onSwapBalance}
editable
Expand Down Expand Up @@ -440,7 +439,7 @@ export const TransactionForm = ({
<Icon
name={showTxSelector ? 'chevron-up' : 'chevron-down'}
size={20}
color={sharedColors.white}
color={sharedColors.text.primary}
/>
</>
</AppTouchable>
Expand Down Expand Up @@ -513,7 +512,7 @@ export const TransactionForm = ({
hasEnoughBalance
}
color={sharedColors.white}
textColor={sharedColors.black}
textColor={sharedColors.text.secondary}
/>
<AppButton
style={styles.buttonCancel}
Expand All @@ -533,7 +532,6 @@ const styles = StyleSheet.create({
}),
buttonCancel: castStyle.view({
marginTop: 10,
backgroundColor: sharedColors.black,
}),
assetToggleRow: castStyle.view({
flexDirection: 'row',
Expand Down
5 changes: 5 additions & 0 deletions src/shared/constants/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,11 @@ export const sharedColors = {
highlight: '#B8B8B8',
},

input: {
active: '#3A3A3A',
inactive: '#252525',
},

text: {
primary: '#fff',
secondary: '#000',
Expand Down

0 comments on commit 9f3e7c1

Please sign in to comment.