DialogPayPerUse.js 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. import React from 'react';
  2. import { StyleSheet } from 'react-native';
  3. import { Modal } from 'react-native';
  4. import { Text, View } from 'react-native';
  5. import Button from '../../components/Button';
  6. import Dialog from '../../components/Dialog';
  7. import TextView from '../../components/TextView';
  8. const DialogPayPerUse = ({
  9. amount="",
  10. visible,
  11. onClose
  12. }) => (
  13. <Modal
  14. visible={visible}
  15. transparent={true}>
  16. <View style={styles.container}>
  17. <View style={styles.content}>
  18. <TextView style={styles.title}>{$t("payment.titleNote")}</TextView>
  19. <TextView style={styles.message}>{$t("payment.tipsPayPerUseAmount").replace("{mm}", amount)}</TextView>
  20. <View style={ui.flexc}>
  21. <Button
  22. style={styles.cancelButton}
  23. text={$t("nav.cancel")}
  24. textColor={textPrimary}
  25. onClick={() => onClose(false)}/>
  26. <Button
  27. style={styles.confirmButton}
  28. text={$t("nav.confirm")}
  29. borderRadius={0}
  30. onClick={() => onClose(true)}/>
  31. </View>
  32. </View>
  33. </View>
  34. </Modal>
  35. );
  36. export default DialogPayPerUse;
  37. const styles = StyleSheet.create({
  38. container: {
  39. flex: 1,
  40. alignItems: 'center',
  41. justifyContent: 'center',
  42. backgroundColor: 'rgba(0,0,0,.1)'
  43. },
  44. content: {
  45. width: Dialog.dialogWidth,
  46. borderRadius: 4,
  47. overflow: 'hidden',
  48. backgroundColor: colorLight
  49. },
  50. title: {
  51. paddingTop: 16,
  52. paddingLeft: 16,
  53. color: textPrimary,
  54. fontSize: 16,
  55. fontWeight: 'bold'
  56. },
  57. message: {
  58. padding: 16,
  59. color: textPrimary,
  60. fontSize: 14,
  61. paddingTop: 16,
  62. paddingBottom: 32
  63. },
  64. cancelButton: {
  65. flex: 1,
  66. borderColor: '#EEE',
  67. borderWidth: 1,
  68. borderRadius: 0,
  69. backgroundColor: textButton
  70. },
  71. confirmButton: {
  72. flex: 1,
  73. borderColor: colorAccent,
  74. borderWidth: 1,
  75. borderRadius: 0,
  76. backgroundColor: colorAccent
  77. }
  78. })