removed unused code

This commit is contained in:
nicco 2018-08-30 15:46:59 +02:00
parent a25e8c90c5
commit 57c78c6e9c

View File

@ -1,8 +1,8 @@
import React, {Component} from 'react' import React, { Component } from 'react'
import {StyleSheet, Text, View} from 'react-native' import { StyleSheet, Text, View, Image } from 'react-native'
import * as PushNotification from 'react-native-push-notification' import * as PushNotification from 'react-native-push-notification'
import {Styles} from '../Helper' import { Styles } from '../Helper'
import BG from '../BG' import BG from '../BG'
import QRButton from '../Components/Button' import QRButton from '../Components/Button'
@ -14,29 +14,49 @@ export default class extends Component {
constructor(props) { constructor(props) {
super(props) super(props)
const {navigation} = props const { navigation } = props
const code = navigation.getParam('code', undefined) const code = navigation.getParam('code', undefined)
this.state = {code} this.state = { code }
if (code === undefined) navigation.navigate('scan') if (code === undefined) navigation.navigate('scan')
else PushNotification.localNotification({ else PushNotification.localNotificationSchedule({
id: 0,
title: '🚀 Scan succeded!', title: '🚀 Scan succeded!',
message: `Your super sercret code is: ${code}`, message: `Your super sercret code is: ${code}`,
date: new Date(Date.now() + (5 * 1000))
}) })
} }
render() { render() {
const {navigate} = this.props.navigation const { navigate } = this.props.navigation
return <BG> return <BG>
<View style={Styles.center}> <View style={Styles.center}>
<View> <QRButton text={'Back'} callback={() => navigate('Home')} />
<QRButton text={'Back'} callback={() => navigate('Home')}/> <Text style={{ ...styles.bold, ...styles.space }}>Success</Text>
<Text>{this.state.code}</Text> <Image
</View> resizeMode="contain"
style={styles.image}
source={require('../../assets/images/check.png')}
/>
</View> </View>
</BG> </BG>
} }
} }
const styles = StyleSheet.create({
space: {
paddingTop: 100,
},
bold: {
fontWeight: 'bold',
},
image: {
width: 32,
height: 32,
margin: 16,
},
})