Display buttons above scroll in laconic-wallet approve screens (#72)

* Buttons outside scroll

* Fix ui for signRequest page

* Remove todo
This commit is contained in:
IshaVenikar 2024-04-01 18:00:40 +05:30 committed by GitHub
parent d50cfbfe84
commit 0dea0082b4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 88 additions and 83 deletions

View File

@ -209,6 +209,7 @@ const ApproveTransaction = ({ route }: SignRequestProps) => {
<ActivityIndicator size="large" color="#0000ff" /> <ActivityIndicator size="large" color="#0000ff" />
</View> </View>
) : ( ) : (
<>
<ScrollView contentContainerStyle={styles.appContainer}> <ScrollView contentContainerStyle={styles.appContainer}>
<View style={styles.dappDetails}> <View style={styles.dappDetails}>
{requestIcon && ( {requestIcon && (
@ -243,7 +244,9 @@ const ApproveTransaction = ({ route }: SignRequestProps) => {
label={`Amount ${ label={`Amount ${
network === 'eth' ? '(Wei)' : `(${COSMOS_DENOM})` network === 'eth' ? '(Wei)' : `(${COSMOS_DENOM})`
}`} }`}
data={BigNumber.from(transaction.value?.toString()).toString()} data={BigNumber.from(
transaction.value?.toString(),
).toString()}
/> />
<DataBox <DataBox
label={`Gas Fees ${ label={`Gas Fees ${
@ -256,6 +259,7 @@ const ApproveTransaction = ({ route }: SignRequestProps) => {
)} )}
</View> </View>
)} )}
</ScrollView>
<View style={styles.buttonContainer}> <View style={styles.buttonContainer}>
<Button <Button
mode="contained" mode="contained"
@ -271,7 +275,7 @@ const ApproveTransaction = ({ route }: SignRequestProps) => {
No No
</Button> </Button>
</View> </View>
</ScrollView> </>
)} )}
</> </>
); );

View File

@ -221,6 +221,7 @@ const SignRequest = ({ route }: SignRequestProps) => {
<ActivityIndicator size="large" color="#0000ff" /> <ActivityIndicator size="large" color="#0000ff" />
</View> </View>
) : ( ) : (
<>
<ScrollView contentContainerStyle={styles.appContainer}> <ScrollView contentContainerStyle={styles.appContainer}>
<View style={styles.dappDetails}> <View style={styles.dappDetails}>
{requestIcon && ( {requestIcon && (
@ -252,7 +253,7 @@ const SignRequest = ({ route }: SignRequestProps) => {
<Text variant="bodyLarge">{message}</Text> <Text variant="bodyLarge">{message}</Text>
</View> </View>
)} )}
</ScrollView>
<View style={styles.buttonContainer}> <View style={styles.buttonContainer}>
<Button mode="contained" onPress={signMessageHandler}> <Button mode="contained" onPress={signMessageHandler}>
Yes Yes
@ -264,7 +265,7 @@ const SignRequest = ({ route }: SignRequestProps) => {
No No
</Button> </Button>
</View> </View>
</ScrollView> </>
)} )}
</> </>
); );

View File

@ -125,21 +125,21 @@ const styles = StyleSheet.create({
requestDirectMessage: { requestDirectMessage: {
borderWidth: 1, borderWidth: 1,
borderRadius: 5, borderRadius: 5,
marginTop: 50, marginTop: 20,
height: '40%', marginBottom: 50,
height: 500,
alignItems: 'center', alignItems: 'center',
justifyContent: 'center', justifyContent: 'center',
padding: 8, padding: 8,
}, },
approveTransaction: { approveTransaction: {
height: '40%', height: '40%',
marginBottom: 30,
}, },
// TODO: Fix button position
buttonContainer: { buttonContainer: {
flexDirection: 'row', flexDirection: 'row',
marginLeft: 20, marginLeft: 20,
marginTop: 20, marginBottom: 10,
marginBottom: 150,
justifyContent: 'space-evenly', justifyContent: 'space-evenly',
}, },
badRequestContainer: { badRequestContainer: {