DialogPayPerUse.js 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  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. <Button
  21. text={$t("nav.confirm")}
  22. onClick={() => onClose(true)}/>
  23. <Button
  24. style={styles.cancelButton}
  25. text={$t("nav.cancel")}
  26. textColor={textPrimary}
  27. onClick={() => onClose(false)}/>
  28. </View>
  29. </View>
  30. </Modal>
  31. );
  32. export default DialogPayPerUse;
  33. const styles = StyleSheet.create({
  34. container: {
  35. flex: 1,
  36. alignItems: 'center',
  37. justifyContent: 'center',
  38. backgroundColor: 'rgba(0,0,0,.1)'
  39. },
  40. content: {
  41. width: Dialog.dialogWidth,
  42. padding: 16,
  43. borderRadius: 4,
  44. backgroundColor: colorLight
  45. },
  46. title: {
  47. color: textPrimary,
  48. fontSize: 16,
  49. fontWeight: 'bold'
  50. },
  51. message: {
  52. color: textPrimary,
  53. fontSize: 14,
  54. paddingTop: 16,
  55. paddingBottom: 32
  56. },
  57. cancelButton: {
  58. marginTop: 8,
  59. borderColor: '#EEE',
  60. borderWidth: 1,
  61. backgroundColor: textButton
  62. }
  63. })