Merge pull request #989 from esteemapp/bugfix/boostPost

changed minus place and enhanced
This commit is contained in:
uğur erdal 2019-07-31 22:43:12 +03:00 committed by GitHub
commit 693f895768
2 changed files with 77 additions and 76 deletions

View File

@ -43,7 +43,6 @@ class BoostPostScreen extends PureComponent {
SCPath: '',
permlinkSuggestions: [],
isValid: false,
calculatedESTM: 150,
};
this.startActionSheet = React.createRef();
@ -192,85 +191,60 @@ class BoostPostScreen extends PureComponent {
}
/>
<Text style={styles.balanceText}>{`${balance || _balance} ESTM`}</Text>
<Fragment>
<View style={styles.autocomplateLineContainer}>
<View style={styles.autocomplateLabelContainer}>
{
<Text style={styles.autocomplateLabelText}>
{intl.formatMessage({ id: 'promote.permlink' })}
</Text>
}
</View>
<Autocomplete
autoCapitalize="none"
autoCorrect={false}
inputContainerStyle={styles.autocomplate}
data={permlinkSuggestions}
listContainerStyle={styles.autocomplateListContainer}
listStyle={styles.autocomplateList}
onChangeText={text => this._handleOnPermlinkChange(text)}
renderTextInput={() => (
<TextInput
style={styles.input}
onChangeText={text => this._handleOnPermlinkChange(text)}
value={permlink || get(navigationParams, 'permlink', '')}
placeholder={intl.formatMessage({ id: 'promote.permlinkPlaceholder' })}
placeholderTextColor="#c1c5c7"
autoCapitalize="none"
/>
)}
renderItem={({ item }) => (
<TouchableOpacity
key={item}
onPress={() =>
this.setState({
permlink: item,
isValid: true,
permlinkSuggestions: [],
})
}
>
<Text style={styles.autocomplateItemText}>{item}</Text>
</TouchableOpacity>
)}
/>
<View style={styles.autocomplateLineContainer}>
<View style={styles.autocomplateLabelContainer}>
{
<Text style={styles.autocomplateLabelText}>
{intl.formatMessage({ id: 'promote.permlink' })}
</Text>
}
</View>
</Fragment>
<View style={styles.total}>
<Text style={styles.day}>
{`${getESTMPrice(calculatedESTM).toFixed(3)} $ `}
</Text>
<Text style={styles.price}>{`${calculatedESTM} ESTM`}</Text>
<Autocomplete
autoCapitalize="none"
autoCorrect={false}
inputContainerStyle={styles.autocomplate}
data={permlinkSuggestions}
listContainerStyle={styles.autocomplateListContainer}
listStyle={styles.autocomplateList}
onChangeText={this._handleOnPermlinkChange}
renderTextInput={() => (
<TextInput
style={styles.input}
onChangeText={text => this._handleOnPermlinkChange(text)}
value={permlink || get(navigationParams, 'permlink', '')}
placeholder={intl.formatMessage({ id: 'promote.permlinkPlaceholder' })}
placeholderTextColor="#c1c5c7"
autoCapitalize="none"
/>
)}
renderItem={({ item }) => (
<TouchableOpacity
key={item}
onPress={() =>
this.setState({
permlink: item,
isValid: true,
permlinkSuggestions: [],
})
}
>
<Text style={styles.autocomplateItemText}>{item}</Text>
</TouchableOpacity>
)}
/>
</View>
<View
style={{
justifyContent: 'center',
alignItems: 'center',
flexDirection: 'row',
}}
>
<MainButton
style={{ width: 55, height: 55, justifyContent: 'center' }}
isDisable={!(_balance / 50 > factor + 4)}
onPress={() =>
this.setState({
factor: _balance / 50 > factor + 4 ? factor + 1 : factor,
})
}
>
<Icon
size={24}
style={{ color: 'white' }}
iconType="MaterialIcons"
name="add"
/>
</MainButton>
<View style={styles.total}>
<Text style={styles.price}>
{`${getESTMPrice(calculatedESTM).toFixed(3)} $ `}
</Text>
<Text style={styles.esteem}>{`${calculatedESTM} ESTM`}</Text>
</View>
<View style={styles.quickButtonsWrapper}>
<MainButton
style={{ width: 55, height: 55, justifyContent: 'center' }}
style={styles.quickButtons}
isDisable={!(calculatedESTM > 150)}
onPress={() =>
this.setState({
@ -285,6 +259,23 @@ class BoostPostScreen extends PureComponent {
name="minus"
/>
</MainButton>
<MainButton
style={styles.quickButtons}
isDisable={!(_balance / 50 > factor + 4)}
onPress={() =>
this.setState({
factor: _balance / 50 > factor + 4 ? factor + 1 : factor,
})
}
>
<Icon
size={24}
style={{ color: 'white' }}
iconType="MaterialIcons"
name="add"
/>
</MainButton>
</View>
</View>

View File

@ -150,13 +150,23 @@ export default EStyleSheet.create({
justifyContent: 'center',
alignItems: 'center',
},
day: {
price: {
fontSize: 22,
color: '$primaryBlue',
fontWeight: 'bold',
},
price: {
esteem: {
fontSize: 15,
color: '$primaryBlue',
},
quickButtons: {
width: 55,
height: 55,
justifyContent: 'center',
},
quickButtonsWrapper: {
justifyContent: 'center',
alignItems: 'center',
flexDirection: 'row',
},
});