Contact.js 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. import React, { Component } from 'react';
  2. import { View, Text, StyleSheet, Image, Linking } from 'react-native';
  3. import Button from '../../components/Button';
  4. import app from '../../../app.json';
  5. import TextView from '../../components/TextView';
  6. import utils from '../../utils/utils';
  7. export default class Contact extends Component {
  8. constructor(props) {
  9. super(props);
  10. this.state = {
  11. };
  12. }
  13. callPhone() {
  14. Linking.openURL("tel:" + app.modules.support.phone)
  15. }
  16. toEmail() {
  17. Linking.openURL("mailto:" + app.modules.support.fdEmail)
  18. }
  19. callWhatapp() {
  20. Linking.openURL(app.modules.support.whatsapp)
  21. }
  22. render() {
  23. return (
  24. <View style={styles.container}>
  25. <View style={ui.center}>
  26. <Image
  27. style={styles.logo}
  28. resizeMode='contain'
  29. source={require('../../images/about-logo.png')}/>
  30. </View>
  31. <TextView style={styles.labelTitle}>{$t("support.labelOpenTime")}</TextView>
  32. <TextView style={styles.labelText}>{$t("support.labelCallCentreHotline")}</TextView>
  33. <TextView style={styles.contentText}>{$t("support.timeAllDay") + " - " + $t("support.time24Hours")}</TextView>
  34. <TextView style={styles.labelText}>{$t("support.labelWhatsappChat")}</TextView>
  35. <TextView style={styles.contentText}>{$t("support.timeWeekDay") + " - 9:00AM to 5:00PM" }</TextView>
  36. <TextView style={styles.contentText2}>(Except public holidays)</TextView>
  37. { utils.isNotEmpty(app.modules.support.fdEmail) && <>
  38. <TextView style={styles.labelText}>For Feedback</TextView>
  39. <TextView style={styles.contentText}>Please email us at <Text style={ui.link} onPress={() => this.toEmail()}>{app.modules.support.fdEmail}</Text></TextView>
  40. </>}
  41. <View style={ui.flex1}></View>
  42. <Button
  43. text={$t("support.btnCallSupport")}
  44. style={styles.buttonPrimary}
  45. onClick={() => this.callPhone()}
  46. disabled={!app.modules.support.phone}
  47. />
  48. <Button
  49. text={$t("support.btnWhatsapp")}
  50. disabled={!app.modules.support.whatsapp}
  51. onClick={() => this.callWhatapp()}
  52. />
  53. </View>
  54. );
  55. }
  56. }
  57. const styles = StyleSheet.create({
  58. container: {
  59. flex: 1,
  60. padding: 16,
  61. backgroundColor: colorLight
  62. },
  63. logo: {
  64. width: 215,
  65. height: 70,
  66. marginTop: 16,
  67. marginBottom: 12
  68. },
  69. labelTitle: {
  70. color: textPrimary,
  71. fontSize: 20,
  72. fontWeight: 'bold',
  73. paddingTop: 16
  74. },
  75. labelText: {
  76. color: textSecondary,
  77. fontSize: 16,
  78. fontWeight: 'bold',
  79. paddingTop: 16,
  80. paddingBottom: 4,
  81. textDecorationLine: 'underline'
  82. },
  83. contentText: {
  84. color: textSecondary,
  85. fontSize: 16
  86. },
  87. contentText2: {
  88. color: textSecondary,
  89. fontSize: 12
  90. },
  91. buttonPrimary: {
  92. marginBottom: 16,
  93. backgroundColor: colorPrimary
  94. }
  95. })