Contact.js 1.8 KB

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