forked from cerc-io/laconic-wallet
Display account details in approve transaction page (#118)
* Display account in approve transaction page * Change label
This commit is contained in:
parent
2ccb396889
commit
521776ea3e
@ -178,9 +178,10 @@ const App = (): React.JSX.Element => {
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case COSMOS_METHODS.COSMOS_SEND_TRANSACTION:
|
case COSMOS_METHODS.COSMOS_SEND_TRANSACTION:
|
||||||
|
const { transactionMessage, signer } = request.params;
|
||||||
navigation.navigate('ApproveTransaction', {
|
navigation.navigate('ApproveTransaction', {
|
||||||
transactionMessage: request.params.transactionMessage,
|
transactionMessage,
|
||||||
signer: request.params.signer,
|
signer,
|
||||||
requestEvent,
|
requestEvent,
|
||||||
requestSessionData,
|
requestSessionData,
|
||||||
});
|
});
|
||||||
|
@ -27,6 +27,7 @@ import {
|
|||||||
import { web3wallet } from '../utils/wallet-connect/WalletConnectUtils';
|
import { web3wallet } from '../utils/wallet-connect/WalletConnectUtils';
|
||||||
import { MEMO } from './ApproveTransfer';
|
import { MEMO } from './ApproveTransfer';
|
||||||
import TxErrorDialog from '../components/TxErrorDialog';
|
import TxErrorDialog from '../components/TxErrorDialog';
|
||||||
|
import AccountDetails from '../components/AccountDetails';
|
||||||
|
|
||||||
type ApproveTransactionProps = NativeStackScreenProps<
|
type ApproveTransactionProps = NativeStackScreenProps<
|
||||||
StackParamsList,
|
StackParamsList,
|
||||||
@ -214,7 +215,7 @@ const ApproveTransaction = ({ route }: ApproveTransactionProps) => {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<ScrollView contentContainerStyle={styles.appContainer}>
|
<ScrollView contentContainerStyle={styles.approveTransaction}>
|
||||||
<View style={styles.dappDetails}>
|
<View style={styles.dappDetails}>
|
||||||
{requestIcon && (
|
{requestIcon && (
|
||||||
<>
|
<>
|
||||||
@ -228,18 +229,24 @@ const ApproveTransaction = ({ route }: ApproveTransactionProps) => {
|
|||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
<Text>{requestName}</Text>
|
<Text>{requestName}</Text>
|
||||||
<Text variant="bodyMedium">{requestURL}</Text>
|
<Text variant="bodySmall">{requestURL}</Text>
|
||||||
</View>
|
</View>
|
||||||
<Text style={styles.dataBoxLabel}>TX</Text>
|
<AccountDetails account={account} />
|
||||||
|
<Text variant="bodyLarge" style={styles.transactionLabel}>
|
||||||
|
Message:
|
||||||
|
</Text>
|
||||||
<View style={styles.messageBody}>
|
<View style={styles.messageBody}>
|
||||||
<Text variant="bodyLarge">
|
<Text variant="bodyLarge">
|
||||||
{JSON.stringify(transactionMessage, null, 2)}
|
{JSON.stringify(transactionMessage, null, 2)}
|
||||||
</Text>
|
</Text>
|
||||||
</View>
|
</View>
|
||||||
<>
|
<>
|
||||||
<Text style={styles.dataBoxLabel}>Gas Limit</Text>
|
<Text variant="bodyLarge" style={styles.transactionLabel}>
|
||||||
|
Gas Limit:
|
||||||
|
</Text>
|
||||||
<TextInput
|
<TextInput
|
||||||
mode="outlined"
|
mode="outlined"
|
||||||
|
style={styles.transactionFeesInput}
|
||||||
value={cosmosGasLimit}
|
value={cosmosGasLimit}
|
||||||
onChangeText={value => {
|
onChangeText={value => {
|
||||||
if (IS_NUMBER_REGEX.test(value)) {
|
if (IS_NUMBER_REGEX.test(value)) {
|
||||||
|
@ -213,10 +213,10 @@ const styles = StyleSheet.create({
|
|||||||
},
|
},
|
||||||
messageBody: {
|
messageBody: {
|
||||||
borderWidth: 1,
|
borderWidth: 1,
|
||||||
borderRadius: 10,
|
borderRadius: 6,
|
||||||
paddingVertical: 10,
|
paddingVertical: 10,
|
||||||
paddingHorizontal: 10,
|
paddingHorizontal: 10,
|
||||||
marginVertical: 20,
|
marginVertical: 3,
|
||||||
},
|
},
|
||||||
cameraContainer: {
|
cameraContainer: {
|
||||||
justifyContent: 'center',
|
justifyContent: 'center',
|
||||||
@ -272,6 +272,16 @@ const styles = StyleSheet.create({
|
|||||||
marginVertical: 10,
|
marginVertical: 10,
|
||||||
},
|
},
|
||||||
transactionFeesInput: { marginBottom: 10 },
|
transactionFeesInput: { marginBottom: 10 },
|
||||||
|
approveTransaction: {
|
||||||
|
flexGrow: 1,
|
||||||
|
marginTop: 0,
|
||||||
|
paddingHorizontal: 24,
|
||||||
|
paddingVertical: 5,
|
||||||
|
},
|
||||||
|
transactionLabel: {
|
||||||
|
fontWeight: '700',
|
||||||
|
padding: 8,
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
export default styles;
|
export default styles;
|
||||||
|
Loading…
Reference in New Issue
Block a user