Contact.js 2.7 KB

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