|
|
@ -9,10 +9,12 @@ import { |
|
|
|
SafeAreaView, |
|
|
|
SafeAreaView, |
|
|
|
StatusBar, |
|
|
|
StatusBar, |
|
|
|
LayoutAnimation, |
|
|
|
LayoutAnimation, |
|
|
|
Appearance, |
|
|
|
|
|
|
|
} from "react-native"; |
|
|
|
} from "react-native"; |
|
|
|
import { connect } from "react-redux"; |
|
|
|
import { connect } from "react-redux"; |
|
|
|
import { useNavigation } from "@react-navigation/native"; |
|
|
|
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
|
|
|
|
//components
|
|
|
|
import Navbar from "../../components/Navbar"; |
|
|
|
import Navbar from "../../components/Navbar"; |
|
|
@ -21,9 +23,13 @@ import User from "./components/User"; |
|
|
|
import Trophy from "./components/Trophy"; |
|
|
|
import Trophy from "./components/Trophy"; |
|
|
|
import List from "./components/List"; |
|
|
|
import List from "./components/List"; |
|
|
|
|
|
|
|
|
|
|
|
function Profile({}) { |
|
|
|
//style
|
|
|
|
|
|
|
|
import fontSize from "../../constants/fontSize"; |
|
|
|
|
|
|
|
import Colors from "../../constants/Colors"; |
|
|
|
|
|
|
|
import tw from "tailwind-rn"; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function Profile({ mobile, theme, logout }) { |
|
|
|
const navigation = useNavigation(); |
|
|
|
const navigation = useNavigation(); |
|
|
|
const colorScheme = Appearance.getColorScheme(); |
|
|
|
|
|
|
|
const [position, setPosition] = useState("100%"); |
|
|
|
const [position, setPosition] = useState("100%"); |
|
|
|
|
|
|
|
|
|
|
|
useEffect(() => {}, []); |
|
|
|
useEffect(() => {}, []); |
|
|
@ -60,14 +66,64 @@ function Profile({}) { |
|
|
|
<User /> |
|
|
|
<User /> |
|
|
|
<Trophy /> |
|
|
|
<Trophy /> |
|
|
|
<List /> |
|
|
|
<List /> |
|
|
|
|
|
|
|
<Pressable |
|
|
|
|
|
|
|
style={tw(`flex w-full ${mobile ? "mt-0" : "mt-4"}`)} |
|
|
|
|
|
|
|
onPress={() => |
|
|
|
|
|
|
|
asyncAwesomeAlert("", "آیا قصد خروج از حساب کاربری فعلی رو داری؟", { |
|
|
|
|
|
|
|
showCancelButton: true, |
|
|
|
|
|
|
|
onConfirm: () => logout(), |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
> |
|
|
|
|
|
|
|
<View |
|
|
|
|
|
|
|
style={[tw(`flex items-center w-full pb-3 mb-3 flex-row-reverse`)]} |
|
|
|
|
|
|
|
> |
|
|
|
|
|
|
|
<Svg |
|
|
|
|
|
|
|
data-name="vuesax/linear/logout" |
|
|
|
|
|
|
|
xmlns="http://www.w3.org/2000/svg" |
|
|
|
|
|
|
|
width={34.034} |
|
|
|
|
|
|
|
height={34.034} |
|
|
|
|
|
|
|
style={{ transform : [{scale : 0.8}] }} |
|
|
|
|
|
|
|
> |
|
|
|
|
|
|
|
<G |
|
|
|
|
|
|
|
fill="none" |
|
|
|
|
|
|
|
stroke="#ff2020" |
|
|
|
|
|
|
|
strokeLinecap="round" |
|
|
|
|
|
|
|
strokeLinejoin="round" |
|
|
|
|
|
|
|
strokeWidth={2} |
|
|
|
|
|
|
|
> |
|
|
|
|
|
|
|
<Path d="M12.621 10.721c.44-5.105 3.063-7.19 8.806-7.19h.184c6.339 0 8.877 2.538 8.877 8.877v9.246c.001 6.339-2.537 8.877-8.876 8.877h-.185c-5.7 0-8.324-2.056-8.792-7.076" /> |
|
|
|
|
|
|
|
<Path |
|
|
|
|
|
|
|
data-name="Vector" |
|
|
|
|
|
|
|
d="M21.272 17.017H5.134M8.296 12.267l-4.751 4.751 4.751 4.749" |
|
|
|
|
|
|
|
/> |
|
|
|
|
|
|
|
</G> |
|
|
|
|
|
|
|
</Svg> |
|
|
|
|
|
|
|
<Text |
|
|
|
|
|
|
|
style={{ |
|
|
|
|
|
|
|
fontSize: mobile ? fontSize.base : fontSize.xl, |
|
|
|
|
|
|
|
fontFamily: "bold", |
|
|
|
|
|
|
|
color: Colors.theme1[theme].redFF1, |
|
|
|
|
|
|
|
marginRight : 4 |
|
|
|
|
|
|
|
}} |
|
|
|
|
|
|
|
> |
|
|
|
|
|
|
|
خروج از حساب کاربری |
|
|
|
|
|
|
|
</Text> |
|
|
|
|
|
|
|
</View> |
|
|
|
|
|
|
|
</Pressable> |
|
|
|
</ScrollView> |
|
|
|
</ScrollView> |
|
|
|
</SafeAreaView> |
|
|
|
</SafeAreaView> |
|
|
|
); |
|
|
|
); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const mapStateToProps = (state) => ({}); |
|
|
|
const mapStateToProps = (state) => ({ |
|
|
|
|
|
|
|
mobile: state.publicApi.mobile, |
|
|
|
|
|
|
|
theme: state.publicApi.theme, |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
const mapDispatchToProps = {}; |
|
|
|
const mapDispatchToProps = { |
|
|
|
|
|
|
|
logout: user.logout, |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
export default connect(mapStateToProps, mapDispatchToProps)(Profile); |
|
|
|
export default connect(mapStateToProps, mapDispatchToProps)(Profile); |
|
|
|
|
|
|
|
|
|
|
|