Last active
March 7, 2025 17:39
-
-
Save RodrigoIbarraSanchez/483dfdad3e4d28cd998e3e13bfa58a47 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { View, Text, StyleSheet } from 'react-native'; | |
import React from 'react'; | |
import { UserState } from '../providers/RevenueCatProvider'; | |
interface UserProps { | |
user: UserState; | |
} | |
// Display the user state based on entitlements (previous purchases) | |
const User = ({ user }: UserProps) => { | |
return ( | |
<View style={styles.card}> | |
<Text style={styles.text}>Cookies: {user.cookies}</Text> | |
<Text style={styles.text}> | |
Items: {user.items.length === 0 && 'No Items purchased yet!'} {user.items.join(', ')} | |
</Text> | |
<Text style={styles.text}>Pro Features: {user.pro ? 'True' : 'False'}</Text> | |
</View> | |
); | |
}; | |
const styles = StyleSheet.create({ | |
card: { | |
margin: 20, | |
padding: 20, | |
backgroundColor: '#fff', | |
shadowColor: '#', | |
shadowOffset: { width: -1, height: 2 }, | |
shadowOpacity: 0.2, | |
shadowRadius: 3 | |
}, | |
text: { | |
fontSize: 20, | |
color: '#EA3C4A', | |
paddingVertical: 6 | |
} | |
}); | |
export default User; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment