Contact.js 2.4 KB

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