import React, { useState, useEffect } from "react"; import { View, Text, ScrollView, Dimensions, StyleSheet, Pressable, SafeAreaView, StatusBar, LayoutAnimation, ActivityIndicator, } from "react-native"; import { connect } from "react-redux"; import { useNavigation } from "@react-navigation/native"; import { asyncAwesomeAlert } from "../../utils/AsyncWrappers"; import { user } from "../../redux/actions"; import Svg, { G, Path } from "react-native-svg"; //components import Navbar from "../../components/Navbar"; import Drawer from "../../components/Drawer"; import User from "./components/User"; import Trophy from "./components/Trophy"; import List from "./components/List"; //style import fontSize from "../../constants/fontSize"; import Colors from "../../constants/Colors"; import tw from "tailwind-rn"; function Profile({ mobile, theme, logout, loading }) { const navigation = useNavigation(); const [position, setPosition] = useState("100%"); useEffect(() => {}, []); const setBoxPosition = () => { LayoutAnimation.configureNext(LayoutAnimation.Presets.easeInEaseOut); setPosition(position === "100%" ? "0%" : "100%"); }; return ( {/* */} asyncAwesomeAlert("", "آیا قصد خروج از حساب کاربری فعلی رو داری؟", { showCancelButton: true, confirmText : 'آره', cancelText: "خیر", onConfirm: () => { navigation.navigate("HomeTab", { screen: "Home" }); logout(); }, }) } > {loading ? ( ) : ( )} خروج از حساب کاربری ); } const mapStateToProps = (state) => ({ mobile: state.publicApi.mobile, theme: state.publicApi.theme, loading: state.user.loading, }); const mapDispatchToProps = { logout: user.logout, }; export default connect(mapStateToProps, mapDispatchToProps)(Profile); const styles = StyleSheet.create({ contentContainerStyle: { paddingBottom: 100, position: "relative", }, container: { flexDirection: "column", paddingVertical: 5, paddingHorizontal: 16, }, });