mirror of
https://github.com/BlueWallet/BlueWallet.git
synced 2025-02-21 14:34:55 +01:00
wip
This commit is contained in:
parent
7f5f460c7f
commit
c5c66bfeb1
3 changed files with 65 additions and 50 deletions
|
@ -437,25 +437,12 @@ const ReceiveDetails = () => {
|
|||
<Button onPress={handleShareButtonPressed} title={loc.receive.details_share} />
|
||||
</BlueCard>
|
||||
</View>
|
||||
<BottomModal ref={bottomModalRef} contentContainerStyle={styles.modalContainerJustify} backgroundColor={colors.modal}>
|
||||
<AmountInput
|
||||
unit={tempCustomUnit}
|
||||
amount={tempCustomAmount || ''}
|
||||
onChangeText={setTempCustomAmount}
|
||||
onAmountUnitChange={setTempCustomUnit}
|
||||
/>
|
||||
<View style={[styles.customAmount, stylesHook.customAmount]}>
|
||||
<TextInput
|
||||
onChangeText={setTempCustomLabel}
|
||||
placeholderTextColor="#81868e"
|
||||
placeholder={loc.receive.details_label}
|
||||
value={tempCustomLabel || ''}
|
||||
numberOfLines={1}
|
||||
style={[styles.customAmountText, stylesHook.customAmountText]}
|
||||
testID="CustomAmountDescription"
|
||||
/>
|
||||
</View>
|
||||
<BlueSpacing20 />
|
||||
</ScrollView>
|
||||
<BottomModal
|
||||
ref={bottomModalRef}
|
||||
contentContainerStyle={styles.modalContainerJustify}
|
||||
backgroundColor={colors.modal}
|
||||
footer={
|
||||
<View style={styles.modalButtonContainer}>
|
||||
<Button
|
||||
testID="CustomAmountResetButton"
|
||||
|
@ -471,9 +458,29 @@ const ReceiveDetails = () => {
|
|||
onPress={createCustomAmountAddress}
|
||||
/>
|
||||
</View>
|
||||
<BlueSpacing20 />
|
||||
</BottomModal>
|
||||
</ScrollView>
|
||||
}
|
||||
>
|
||||
<AmountInput
|
||||
unit={tempCustomUnit}
|
||||
amount={tempCustomAmount || ''}
|
||||
onChangeText={setTempCustomAmount}
|
||||
onAmountUnitChange={setTempCustomUnit}
|
||||
/>
|
||||
<View style={[styles.customAmount, stylesHook.customAmount]}>
|
||||
<TextInput
|
||||
onChangeText={setTempCustomLabel}
|
||||
placeholderTextColor="#81868e"
|
||||
placeholder={loc.receive.details_label}
|
||||
value={tempCustomLabel || ''}
|
||||
numberOfLines={1}
|
||||
style={[styles.customAmountText, stylesHook.customAmountText]}
|
||||
testID="CustomAmountDescription"
|
||||
/>
|
||||
</View>
|
||||
<BlueSpacing20 />
|
||||
|
||||
<BlueSpacing20 />
|
||||
</BottomModal>
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
@ -538,6 +545,8 @@ const styles = StyleSheet.create({
|
|||
modalButtonContainer: {
|
||||
flexDirection: 'row',
|
||||
justifyContent: 'space-between',
|
||||
paddingHorizontal: 16,
|
||||
paddingBottom: 34,
|
||||
},
|
||||
modalButtonSpacing: {
|
||||
width: 16,
|
||||
|
|
|
@ -1248,35 +1248,37 @@ const SendDetails = () => {
|
|||
contentContainerStyle={styles.modalContent}
|
||||
footerDefaultMargins
|
||||
footer={
|
||||
<TouchableOpacity
|
||||
testID="feeCustom"
|
||||
accessibilityRole="button"
|
||||
onPress={async () => {
|
||||
let error = loc.send.fee_satvbyte;
|
||||
while (true) {
|
||||
let fee: number | string;
|
||||
<View style={styles.feeModalFooter}>
|
||||
<TouchableOpacity
|
||||
testID="feeCustom"
|
||||
accessibilityRole="button"
|
||||
onPress={async () => {
|
||||
let error = loc.send.fee_satvbyte;
|
||||
while (true) {
|
||||
let fee: number | string;
|
||||
|
||||
try {
|
||||
fee = await prompt(loc.send.create_fee, error, true, 'numeric');
|
||||
} catch (_) {
|
||||
try {
|
||||
fee = await prompt(loc.send.create_fee, error, true, 'numeric');
|
||||
} catch (_) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!/^\d+$/.test(fee)) {
|
||||
error = loc.send.details_fee_field_is_not_valid;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (Number(fee) < 1) fee = '1';
|
||||
fee = Number(fee).toString(); // this will remove leading zeros if any
|
||||
setCustomFee(fee);
|
||||
feeModalRef.current?.dismiss();
|
||||
return;
|
||||
}
|
||||
|
||||
if (!/^\d+$/.test(fee)) {
|
||||
error = loc.send.details_fee_field_is_not_valid;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (Number(fee) < 1) fee = '1';
|
||||
fee = Number(fee).toString(); // this will remove leading zeros if any
|
||||
setCustomFee(fee);
|
||||
feeModalRef.current?.dismiss();
|
||||
return;
|
||||
}
|
||||
}}
|
||||
>
|
||||
<Text style={[styles.feeModalCustomText, stylesHook.feeModalCustomText]}>{loc.send.fee_custom}</Text>
|
||||
</TouchableOpacity>
|
||||
}}
|
||||
>
|
||||
<Text style={[styles.feeModalCustomText, stylesHook.feeModalCustomText]}>{loc.send.fee_custom}</Text>
|
||||
</TouchableOpacity>
|
||||
</View>
|
||||
}
|
||||
>
|
||||
<View style={styles.paddingTop80}>
|
||||
|
@ -1654,7 +1656,7 @@ const styles = StyleSheet.create({
|
|||
},
|
||||
modalContent: {
|
||||
margin: 22,
|
||||
minHeight: 370,
|
||||
minHeight: 350,
|
||||
},
|
||||
paddingTop80: { paddingTop: 80 },
|
||||
optionsContent: {
|
||||
|
@ -1719,6 +1721,9 @@ const styles = StyleSheet.create({
|
|||
marginRight: 18,
|
||||
marginVertical: 8,
|
||||
},
|
||||
feeModalFooter: {
|
||||
paddingBottom: 50,
|
||||
},
|
||||
memo: {
|
||||
flexDirection: 'row',
|
||||
borderWidth: 1,
|
||||
|
|
|
@ -468,7 +468,8 @@ const styles = StyleSheet.create({
|
|||
},
|
||||
modalContent: {
|
||||
padding: 22,
|
||||
minHeight: 400,
|
||||
paddingTop: 66,
|
||||
minHeight: 420,
|
||||
},
|
||||
empty: {
|
||||
flex: 1,
|
||||
|
|
Loading…
Add table
Reference in a new issue