Use MUI dialog component for tx error

This commit is contained in:
IshaVenikar 2024-07-30 12:24:35 +05:30
parent 45638bc031
commit cb1e0a283a
2 changed files with 11 additions and 12 deletions

View File

@ -1,5 +1,5 @@
import React from 'react';
import { Button, Dialog, Portal, Text } from 'react-native-paper';
import { Dialog, DialogTitle, DialogContent, DialogActions, Button, Typography } from '@mui/material';
const TxErrorDialog = ({
error,
@ -11,17 +11,15 @@ const TxErrorDialog = ({
hideDialog: () => void;
}) => {
return (
<Portal>
<Dialog visible={visible} onDismiss={hideDialog}>
<Dialog.Title>Transaction Error</Dialog.Title>
<Dialog.Content>
<Text variant="bodyMedium">{error}</Text>
</Dialog.Content>
<Dialog.Actions>
<Button onPress={hideDialog}>OK</Button>
</Dialog.Actions>
</Dialog>
</Portal>
<Dialog open={visible} onClose={hideDialog}>
<DialogTitle>Transaction Error</DialogTitle>
<DialogContent>
<Typography variant="body1">{error}</Typography>
</DialogContent>
<DialogActions>
<Button onClick={hideDialog}>OK</Button>
</DialogActions>
</Dialog>
);
};

View File

@ -143,6 +143,7 @@ const styles = StyleSheet.create({
buttonContainer: {
flexDirection: 'row',
marginLeft: 20,
marginTop: 10,
marginBottom: 10,
justifyContent: 'space-evenly',
},