Contact.js 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  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. <View style={ui.flex1}></View>
  33. <Button
  34. text={$t("support.btnCallSupport")}
  35. style={styles.buttonPrimary}
  36. onClick={() => this.callPhone()}
  37. disabled={!app.modules.support.phone}
  38. />
  39. <Button
  40. text={$t("support.btnWhatsapp")}
  41. disabled={!app.modules.support.whatsapp}
  42. onClick={() => this.callWhatapp()}
  43. />
  44. </View>
  45. );
  46. }
  47. }
  48. const styles = StyleSheet.create({
  49. container: {
  50. flex: 1,
  51. padding: 16,
  52. backgroundColor: colorLight
  53. },
  54. logo: {
  55. width: 215,
  56. height: 70,
  57. marginTop: 16,
  58. marginBottom: 12
  59. },
  60. labelTitle: {
  61. color: textPrimary,
  62. fontSize: 20,
  63. fontWeight: 'bold',
  64. paddingTop: 16
  65. },
  66. labelText: {
  67. color: textSecondary,
  68. fontSize: 16,
  69. fontWeight: 'bold',
  70. paddingTop: 16,
  71. paddingBottom: 4,
  72. textDecorationLine: 'underline'
  73. },
  74. contentText: {
  75. color: textSecondary,
  76. fontSize: 16
  77. },
  78. buttonPrimary: {
  79. marginBottom: 16,
  80. backgroundColor: colorPrimary
  81. }
  82. })