import * as React from 'react'; import {useState, useEffect} from 'react'; import {View, Text, TouchableOpacity, Image, ImageBackground} from 'react-native'; import Theme from '../theme.style'; import Assets from '../assets.manager'; import Icon from '../icons.js'; import DB from '../storage'; import { exp } from 'react-native-reanimated'; const styles = { borderedButton: { padding: 5, borderColor: '#fff', borderRadius: 5, borderWidth: 2, height: 45, width: 130, margin: 5, justifyContent: 'center' }, textBig: { } } class Header extends React.PureComponent { constructor(props) { super(props) this.btnstyle = { marginLeft: 10 }; this.name = '' this.cardnumber = '' this.points = '' } state = { profile: {} } componentDidMount() { this.init() } componentWillUnmount() { } init = async () => { let stored = await DB.profile() this.setState({ profile: stored }) this.name = stored && stored?.data ? stored.data : {} this.cardnumber = stored && stored?.data ? stored.data.card_number : '' this.points = stored && stored?.data ? stored.data.points : '' } openDrawer = () => { this.props.navigation.openDrawer() } render() { return ( this.openDrawer()}> Guest ) } } export default Header;