首页 > 解决方案 > 如何提交报告表单以便发送到 React Native 中的特定电子邮件

问题描述

我正在尝试使用 React Native 为社交媒体应用程序设置报告发布屏幕,用户可以在其中报告不适当或垃圾邮件的帖子。我只想让用户选择一个原因,然后直接发送到特定的电子邮件。到目前为止,这是我在前端所拥有的:

import React from 'react';
import { Text, View, StyleSheet, TouchableOpacity } from 'react-native';

export default function ReportScreen({ navigation }) {
    return (
        <View style={styles.container}>
            <Text style={{ fontSize: 30 }}>Why are you reporting this?</Text>
            <TouchableOpacity
                style={styles.panelButton}
                onPress={() => {
                    this.handleSubmit();
                }}
            >
                <Text style={styles.panelButtonTitle}>It's abusive or harmful</Text>
            </TouchableOpacity>
            <TouchableOpacity
                style={styles.panelButton}
                onPress={() => {
                    this.handleSubmit();
                }}
            >
                <Text style={styles.panelButtonTitle}>
                    It's inappropriate or offensive
                </Text>
            </TouchableOpacity>
            <TouchableOpacity
                style={styles.panelButton}
                onPress={() => {
                    this.handleSubmit();
                }}
            >
                <Text style={styles.panelButtonTitle}>Cancel</Text>
            </TouchableOpacity>
            <Button onPress={() => navigation.goBack()} title="Go Back" />
        </View>
    );
}

标签: reactjsreact-nativeemailsubmit

解决方案


推荐阅读