reza fixed logout position in profile

master
Reza_ashrafi 2 years ago
parent df7e093737
commit 92e988a168
  1. 11
      navigation/index.js
  2. 39
      src/screens/Profile/components/User.js
  3. 66
      src/screens/Profile/index.js
  4. 2
      src/screens/QR/index.js
  5. 2
      src/screens/QR/layouts/Scan/index.js

@ -473,16 +473,7 @@ const Navigation = ({ getStatus, isLogin, userProducts, ltr, setLTR }) => {
<Stack.Screen name="Login" component={Login} />
<Stack.Screen name="Rules" component={Rules} />
<Stack.Screen name="Otp" component={Otp} />
<Stack.Screen
name="Root"
component={
BottomTabNavigator
// count={
// userProducts.filter((product) => product.condition < 2)
// .length
// }
}
/>
<Stack.Screen name="Root" component={BottomTabNavigator} />
<Stack.Screen name="QR" component={QR} />
<Stack.Screen name="Orders" component={OrdersFollowUp} />
<Stack.Screen name="Order" component={OrderDetails} />

@ -100,9 +100,9 @@ const User = ({ user, mobile, theme, logout }) => {
>
<View
style={[
tw(`flex items-center w-full pb-3 mb-3 flex-row-reverse`),
tw(`flex items-center w-full pb-3 mb-3 flex-row-reverse pt-2`),
{
borderBottomWidth: 1,
borderTopWidth: 1,
borderColor: Colors.theme1[theme].grayE3,
},
]}
@ -129,36 +129,6 @@ const User = ({ user, mobile, theme, logout }) => {
</Text>
</View>
</Pressable>
<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`),
]}
>
<Text
style={{
fontSize: mobile ? fontSize.base : fontSize.xl,
fontFamily: "bold",
color: Colors.theme1[theme].redFF1,
}}
>
خروج از حساب کاربری
</Text>
</View>
</Pressable>
</View>
)}
</View>
@ -171,8 +141,5 @@ const mapStateToProps = (state) => ({
theme: state.publicApi.theme,
});
const mapDispatchToProps = {
logout : user.logout
}
export default connect(mapStateToProps, mapDispatchToProps)(User);
export default connect(mapStateToProps)(User);

@ -9,10 +9,12 @@ import {
SafeAreaView,
StatusBar,
LayoutAnimation,
Appearance,
} 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";
@ -21,9 +23,13 @@ import User from "./components/User";
import Trophy from "./components/Trophy";
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 colorScheme = Appearance.getColorScheme();
const [position, setPosition] = useState("100%");
useEffect(() => {}, []);
@ -60,14 +66,64 @@ function Profile({}) {
<User />
<Trophy />
<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>
</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);

@ -6,7 +6,7 @@ import {
Dimensions,
StatusBar,
} from "react-native";
import Scan from "./Scan";
import Scan from "./layouts/Scan";
const width = Dimensions.get("window").width;
function QR({ }) {

@ -18,7 +18,7 @@ import Colors from "../../../../constants/Colors";
const { width, height } = Dimensions.get("screen");
//assets
import laptopImage from "../assets/laptop.png";
import laptopImage from "../../assets/laptop.png";
function Scan({ theme, route }) {
const { page } = route.params;

Loading…
Cancel
Save