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