Skip to content

Commit

Permalink
chore: refactor error handler
Browse files Browse the repository at this point in the history
  • Loading branch information
njokuScript committed Apr 2, 2022
1 parent dd3b26d commit 2119df2
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 76 deletions.
72 changes: 0 additions & 72 deletions src/components/Error.tsx

This file was deleted.

60 changes: 56 additions & 4 deletions src/lazerpay.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,8 @@ import {
PAYMENT_SUCCESS,
} from './constants';
import Loader from './components/Loader';
import { Image, StyleSheet, Text, TouchableOpacity, View } from 'react-native';
import Clipboard from '@react-native-clipboard/clipboard';
//import ErrorFallback from './components/Error';
import { Text } from 'react-native';

const Lazerpay = (props: PaymentProps) => {
const [checkPropsValue, setCheckProps] = useState(false);
Expand Down Expand Up @@ -136,11 +135,64 @@ const Lazerpay = (props: PaymentProps) => {
renderLoading={() => <Loader />}
/>
) : (
// <ErrorFallback onClose={onClose} error />
<Text>Something went wrong</Text>
<>
<View style={styles.container}>
<TouchableOpacity
style={{
padding: 20,
marginRight: -20,
position: 'absolute',
alignItems: 'flex-end',
alignSelf: 'flex-end',
}}
onPress={onClose}
>
<Image
source={require('./assets/close.png')}
style={styles.closeImg}
/>
</TouchableOpacity>
<View style={styles.imgCont}>
<Image
source={require('./assets/warning.png')}
style={styles.img}
resizeMode="contain"
/>
</View>
<Text style={styles.text}>Something went wrong. Try again</Text>
</View>
</>
)}
</SDKWrapper>
);
};

export default Lazerpay;
const styles = StyleSheet.create({
text: {
fontSize: 16,
color: '#727EA3',
fontWeight: '400',
marginTop: 10,
},
closeImg: {
width: 32,
height: 32,
},
container: {
flex: 1,
backgroundColor: '#ffffff',
height: '100%',
width: '100%',
alignItems: 'center',
position: 'absolute',
},
img: {
width: 80,
height: 80,
},
imgCont: {
marginTop: 100,
alignItems: 'center',
},
});

1 comment on commit 2119df2

@vercel
Copy link

@vercel vercel bot commented on 2119df2 Apr 2, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.