Contact.js 1.7 KB

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