ViewWallet.js 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. /**
  2. * 钱包卡片组件
  3. * @邠心vbe on 2025/01/17
  4. */
  5. import React from 'react';
  6. import { StyleSheet } from 'react-native';
  7. import { Text, View } from 'react-native';
  8. import { ElevationObject } from '../../components/Button';
  9. import TextView from '../../components/TextView';
  10. import utils from '../../utils/utils';
  11. const ViewWallet = ({
  12. wallet
  13. }) => (
  14. <View style={styles.cardWallet}>
  15. <View style={ui.flexc}>
  16. <TextView style={styles.walletName}>{wallet.walletTypeName}</TextView>
  17. </View>
  18. <TextView style={styles.walletProvider}>{wallet.walletPrincipalName}</TextView>
  19. <TextView style={styles.walletLabel}>Current Balance:</TextView>
  20. <TextView style={styles.walletBalance}>{wallet.currentBalance}</TextView>
  21. { utils.isNotEmpty(wallet.expiresDate) &&
  22. <TextView style={styles.walletLabel}>Expires {wallet.expiresDate}</TextView>
  23. }
  24. </View>
  25. );
  26. export default ViewWallet;
  27. const styles = StyleSheet.create({
  28. cardWallet: {
  29. height: 182,
  30. margin: 16,
  31. padding: 16,
  32. borderRadius: 16,
  33. ...ElevationObject(2),
  34. backgroundColor: colorAccent
  35. },
  36. walletName: {
  37. color: textLight,
  38. fontSize: 24,
  39. fontWeight: 'bold'
  40. },
  41. walletProvider: {
  42. color: textLight,
  43. fontSize: 20,
  44. },
  45. walletLabel: {
  46. color: textLight,
  47. opacity: .9,
  48. fontSize: 14,
  49. paddingTop: 16
  50. },
  51. walletBalance: {
  52. color: textLight,
  53. fontSize: 20,
  54. paddingTop: 4,
  55. fontWeight: 'bold'
  56. }
  57. })