0x0x230x

Untitled

Jul 18th, 2025
26
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.15 KB | None | 0 0
  1. import { PlatformIcon } from '@/components/ui/PlatformIcon';
  2. import { usePrivy } from '@privy-io/expo';
  3. import { Image } from 'expo-image';
  4. import { Linking, Text, View } from 'react-native';
  5.  
  6. export const TwitterSocialCard = () => {
  7. const { user } = usePrivy();
  8.  
  9. const twitter = user?.linked_accounts?.find(
  10. (account) => account.type === 'twitter_oauth',
  11. );
  12.  
  13. if (!twitter) return null;
  14.  
  15. const profilePicture = twitter?.profile_picture_url?.replace(
  16. 'normal',
  17. '400x400',
  18. );
  19. const username = twitter?.username;
  20. const profileUrl = `https://x.com/${username}`;
  21.  
  22. const openTwitter = () => {
  23. if (profileUrl) {
  24. Linking.openURL(profileUrl);
  25. }
  26. };
  27.  
  28. return (
  29. <View className='w-full p-4 rounded-xl items-center'>
  30. <Image
  31. source={{ uri: profilePicture || 'https://placehold.co/100x100' }}
  32. className='w-24 h-24 rounded-full mb-4'
  33. />
  34. <View className='flex-row items-center gap-2'>
  35. <Text className='text-white text-lg font-bold'>@{username}</Text>
  36.  
  37. <PlatformIcon platform='x' size={24} onPress={openTwitter} />
  38. </View>
  39. </View>
  40. );
  41. };
  42.  
Advertisement
Add Comment
Please, Sign In to add comment