reza fixed home tablet mode

master
Reza_ashrafi 3 years ago
parent d1f46bd12e
commit a4427c3961
  1. 1
      App.js
  2. 18
      eas.json
  3. 2
      src/components/CustomTextInput.js
  4. 14
      src/components/Drawer.js
  5. 2
      src/components/Header.js
  6. 34
      src/components/Progress.js
  7. 1
      src/redux/reducers/public.js
  8. 168
      src/screens/Activation/index.js
  9. 2
      src/screens/Address/index.js
  10. 2
      src/screens/Blogs/layouts/Target.js
  11. 10
      src/screens/Contact/Box.js
  12. 20
      src/screens/Home/components/Blogs.js
  13. 16
      src/screens/Home/components/Header.js
  14. 14
      src/screens/Home/components/Scroll.js
  15. 15
      src/screens/Home/components/Videos.js
  16. 16
      src/screens/Home/index.js
  17. 170
      src/screens/Login/index.js
  18. 19
      src/screens/Otp/index.js
  19. 54
      src/screens/Profile/components/User.js

@ -12,6 +12,7 @@ const App = () => {
light : require("./assets/fonts/Farsi/Light.ttf"), light : require("./assets/fonts/Farsi/Light.ttf"),
regular: require("./assets/fonts/Farsi/Regular.ttf"), regular: require("./assets/fonts/Farsi/Regular.ttf"),
bold: require("./assets/fonts/Farsi/Medium.ttf"), bold: require("./assets/fonts/Farsi/Medium.ttf"),
demi: require("./assets/fonts/Farsi/DemiBold.ttf"),
}); });
if (!fontsLoaded) { if (!fontsLoaded) {

@ -0,0 +1,18 @@
{
"cli": {
"version": ">= 0.47.0"
},
"build": {
"development": {
"developmentClient": true,
"distribution": "internal"
},
"preview": {
"distribution": "internal"
},
"production": {}
},
"submit": {
"production": {}
}
}

@ -36,7 +36,7 @@ const FloatingLabelInput = ({
fontFamily: "regular", fontFamily: "regular",
top: !isFocused ? "50%" : 1, top: !isFocused ? "50%" : 1,
fontSize: !isFocused ? fontSize.tiny : fontSize.sm, fontSize: !isFocused ? fontSize.tiny : fontSize.sm,
transform: [{ translateY: -width / 35 }], transform: [{ translateY: -fontSize.lg }],
color: !isFocused color: !isFocused
? Colors.theme1[colorScheme].gray2077 ? Colors.theme1[colorScheme].gray2077
: Colors.theme1[colorScheme].green79, : Colors.theme1[colorScheme].green79,

@ -48,13 +48,6 @@ const Drawer = ({ position, setBoxPosition, user = JSON.parse(user) }) => {
toast: "", toast: "",
message: "", message: "",
}, },
{
name: "پروفایل",
route: "Profile",
icon: <AntDesign name="profile" size={23} color={"#555555"} />,
toast: "",
message: "",
},
{ {
name: "واقعیت افزوده", name: "واقعیت افزوده",
route: "AR", route: "AR",
@ -69,13 +62,6 @@ const Drawer = ({ position, setBoxPosition, user = JSON.parse(user) }) => {
toast: "", toast: "",
message: "", message: "",
}, },
{
name: "سبد خرید",
route: "ShoppingCart",
icon: <Ionicons name="cart" size={23} color={"#555555"} />,
toast: "",
message: "",
},
{ {
name: "سوالات متداول", name: "سوالات متداول",
route: "Faq", route: "Faq",

@ -26,7 +26,7 @@ export default function Header({ title, description, background }) {
</Text> </Text>
<Text <Text
style={[ style={[
{ color: "#86A0B9", fontSize: fontSize.sm, fontFamily: "light" }, { color: "#86A0B9", fontSize: fontSize.tiny, fontFamily: "regular" },
]} ]}
> >
{description} {description}

@ -1,35 +1,41 @@
import React, {useState, useEffect} from 'react'; import React, { useState, useEffect } from "react";
import {View, Appearance } from 'react-native'; import { View, Appearance } from "react-native";
import tw from 'tailwind-rn'; import tw from "tailwind-rn";
import Colors from "../constants/Colors"; import Colors from "../constants/Colors";
//Color //Color
import Color from '../constants/Colors'; import Color from "../constants/Colors";
function Progress({percent, alignItems}) { function Progress({ percent, alignItems }) {
const colorScheme = Appearance.getColorScheme(); const colorScheme = Appearance.getColorScheme();
const [delayPercent, setDelayPercent] = useState(0); const [delayPercent, setDelayPercent] = useState(0);
useEffect(() => { useEffect(() => {
setTimeout(() => { if (percent) {
setDelayPercent(() => percent); setTimeout(() => {
}, 1000); setDelayPercent(() => percent);
}, 1000);
}
}, [percent]); }, [percent]);
return ( return (
<View <View
style={[ style={[
tw(`w-full h-1.5 rounded-full overflow-hidden my-3 flex ${alignItems}`), tw(
{backgroundColor: Colors.theme1[colorScheme].green79 + '22'}, `w-full h-1.5 rounded-full overflow-hidden my-3 flex ${alignItems}`
]}> ),
{ backgroundColor: Colors.theme1[colorScheme].green79 + "22" },
]}
>
<View <View
style={[ style={[
tw('h-full rounded-full'), tw("h-full rounded-full"),
{ {
backgroundColor: Color.theme1[colorScheme].greenCF, backgroundColor: Color.theme1[colorScheme].greenCF,
width: percent + '%', width: percent + "%",
// backgroundColor: Color.theme1.light.blue4, // backgroundColor: Color.theme1.light.blue4,
}, },
]}></View> ]}
></View>
</View> </View>
); );
} }

@ -5,6 +5,7 @@ const width = Dimensions.get("window").width;
const initialState = { const initialState = {
// isDark: (await AsyncStorage.getItem("isDark")) || false, // isDark: (await AsyncStorage.getItem("isDark")) || false,
mobile : width < 720,
homeData: [], homeData: [],
newProducts: [], newProducts: [],
levels: [], levels: [],

File diff suppressed because one or more lines are too long

@ -47,7 +47,7 @@ const Address = ({
setPhase, setPhase,
cityLoading, cityLoading,
}) => { }) => {
const profilePage = route.params.type === "profile"; const profilePage = route.params?.type === "profile";
const colorScheme = Appearance.getColorScheme(); const colorScheme = Appearance.getColorScheme();
const navigation = useNavigation(); const navigation = useNavigation();
const [addressFields, setAddressFields] = useState({}); const [addressFields, setAddressFields] = useState({});

@ -152,7 +152,7 @@ const Target = ({ blogs }) => {
return ( return (
<View style={tw("flex flex-col")}> <View style={tw("flex flex-col")}>
<Large blog={blogs[0]} /> <Large blog={blogs[0]} />
<View style={tw("flex flex-row justify-between mt-3")}> <View style={tw("flex flex-row justify-between mt-4")}>
{blogs?.slice(1, 3).map((blog, index) => ( {blogs?.slice(1, 3).map((blog, index) => (
<Small blog={blog} key={index} /> <Small blog={blog} key={index} />
))} ))}

@ -1,8 +1,10 @@
import { View, Text, Image, TouchableOpacity } from "react-native"; import { View, Text, Image, TouchableOpacity, Platform } from "react-native";
import React from "react"; import React from "react";
import tw from "tailwind-rn"; import tw from "tailwind-rn";
import fontSize from "../../constants/fontSize"; import fontSize from "../../constants/fontSize";
const ios = Platform.OS === "ios";
const Box = ({ info }) => { const Box = ({ info }) => {
return ( return (
<TouchableOpacity <TouchableOpacity
@ -22,6 +24,7 @@ const Box = ({ info }) => {
fontFamily: "bold", fontFamily: "bold",
fontSize: fontSize.lg, fontSize: fontSize.lg,
color: info.title.color, color: info.title.color,
textAlign : ios ? "right" : "auto",
}} }}
> >
{info.title.text} {info.title.text}
@ -33,6 +36,7 @@ const Box = ({ info }) => {
fontFamily: "light", fontFamily: "light",
fontSize: fontSize.sm, fontSize: fontSize.sm,
color: info.description.color, color: info.description.color,
textAlign : ios ? "right" : "auto",
}, },
]} ]}
> >
@ -40,9 +44,9 @@ const Box = ({ info }) => {
</Text> </Text>
<Text <Text
style={[ style={[
tw("self-start mt-2"), tw("self-start mt-2.5"),
{ {
fontFamily: "bold", fontFamily: "demi",
fontSize: fontSize.sm, fontSize: fontSize.sm,
color: info?.link?.color, color: info?.link?.color,
}, },

@ -8,7 +8,7 @@ import {
FlatList, FlatList,
Pressable, Pressable,
Appearance, Appearance,
Platform Platform,
} from "react-native"; } from "react-native";
import { connect } from "react-redux"; import { connect } from "react-redux";
import Svg, { G, Path } from "react-native-svg"; import Svg, { G, Path } from "react-native-svg";
@ -27,14 +27,14 @@ import userImage from "../assets/user.png";
const { width } = Dimensions.get("window"); const { width } = Dimensions.get("window");
const ios = Platform.OS === "ios"; const ios = Platform.OS === "ios";
function Blogs({ blogs }) { function Blogs({ blogs, mobile }) {
const colorScheme = Appearance.getColorScheme(); const colorScheme = Appearance.getColorScheme();
const Blog = ({ blog }) => { const Blog = ({ blog }) => {
return ( return (
<Pressable <Pressable
style={[ style={[
tw("rounded-md ml-3 rounded-md relative"), tw("rounded-md ml-3 rounded-md relative"),
{ width: width / 1.5 }, { width: mobile ? width / 1.5 : width / 2.2 },
]} ]}
// onPress={() => navigation.navigate('Product')} // onPress={() => navigation.navigate('Product')}
> >
@ -42,7 +42,10 @@ function Blogs({ blogs }) {
source={{ uri: `https://dnvn.ir/api/v1/file/${blog.fileIds}` }} source={{ uri: `https://dnvn.ir/api/v1/file/${blog.fileIds}` }}
style={[ style={[
tw("rounded-md"), tw("rounded-md"),
{ width: "100%", height: ((width / 1.5) * 9) / 16 }, {
width: "100%",
height: ((mobile ? width / 1.5 : width / 2.2) * 9) / 16,
},
]} ]}
/> />
<View <View
@ -55,7 +58,7 @@ function Blogs({ blogs }) {
shadowOpacity: 0.8, shadowOpacity: 0.8,
shadowRadius: 2, shadowRadius: 2,
elevation: 5, elevation: 5,
minHeight : 70 minHeight: 70,
}, },
]} ]}
> >
@ -65,7 +68,7 @@ function Blogs({ blogs }) {
{ {
color: Colors.theme1[colorScheme].gray20, color: Colors.theme1[colorScheme].gray20,
fontFamily: "bold", fontFamily: "bold",
fontSize: fontSize.tiny, fontSize: mobile ? fontSize.tiny : fontSize.lg,
textAlign: ios ? "right" : "auto", textAlign: ios ? "right" : "auto",
}, },
]} ]}
@ -83,7 +86,7 @@ function Blogs({ blogs }) {
{ {
color: Colors.theme1[colorScheme].gray20, color: Colors.theme1[colorScheme].gray20,
fontFamily: "regular", fontFamily: "regular",
fontSize: fontSize.sm, fontSize: mobile ? fontSize.sm : fontSize.base,
}, },
]} ]}
> >
@ -97,7 +100,7 @@ function Blogs({ blogs }) {
{ {
color: Colors.theme1[colorScheme].gray20, color: Colors.theme1[colorScheme].gray20,
fontFamily: "regular", fontFamily: "regular",
fontSize: fontSize.sm, fontSize: mobile ? fontSize.sm : fontSize.base,
}, },
]} ]}
> >
@ -150,5 +153,6 @@ function Blogs({ blogs }) {
const mapStateToProps = (state) => ({ const mapStateToProps = (state) => ({
// features: state.publicApi.home?.features, // features: state.publicApi.home?.features,
mobile: state.publicApi.mobile,
}); });
export default connect(mapStateToProps, {})(Blogs); export default connect(mapStateToProps, {})(Blogs);

@ -2,23 +2,25 @@ import React from "react";
import { View, Text, Pressable, Appearance } from "react-native"; import { View, Text, Pressable, Appearance } from "react-native";
import { Entypo } from "@expo/vector-icons"; import { Entypo } from "@expo/vector-icons";
import { useNavigation } from "@react-navigation/native"; import { useNavigation } from "@react-navigation/native";
import {connect} from 'react-redux';
import fontSize from "../../../constants/fontSize"; import fontSize from "../../../constants/fontSize";
import tw from "tailwind-rn"; import tw from "tailwind-rn";
//Color //Color
import Color from "../../../constants/Colors"; import Color from "../../../constants/Colors";
const Header = ({ title, route }) => { const Header = ({ title, route, mobile }) => {
const colorScheme = Appearance.getColorScheme(); const colorScheme = Appearance.getColorScheme();
const navigation = useNavigation(); const navigation = useNavigation();
return ( return (
<View style={tw("w-full flex flex-row-reverse justify-between mb-0")}> <View style={tw(`w-full flex flex-row-reverse justify-between ${mobile ? "" : "mb-2"}`)}>
<Text <Text
style={[ style={[
{ {
color: Color.theme1[colorScheme].green79, color: Color.theme1[colorScheme].green79,
fontFamily: "bold", fontFamily: "demi",
fontSize: fontSize.xl, fontSize: mobile ? fontSize.lg : fontSize.xl2,
}, },
]} ]}
> >
@ -33,4 +35,8 @@ const Header = ({ title, route }) => {
); );
}; };
export default Header; const mapStateToProps = (state) => ({
mobile : state.publicApi.mobile
})
export default connect(mapStateToProps)(Header);

@ -5,15 +5,17 @@ import {
TouchableOpacity, TouchableOpacity,
FlatList, FlatList,
Platform, Platform,
Dimensions
} from "react-native"; } from "react-native";
import { useNavigation } from "@react-navigation/native"; import { useNavigation } from "@react-navigation/native";
import tw from "tailwind-rn"; import tw from "tailwind-rn";
const ios = Platform.OS === "ios"; const ios = Platform.OS === "ios";
const {height} = Dimensions.get("window");
import { connect } from "react-redux"; import { connect } from "react-redux";
function Scroll({ books }) { function Scroll({ books, mobile }) {
const Box = ({ books }) => { const Box = ({ books }) => {
const Product = ({ book, position }) => { const Product = ({ book, position }) => {
const navigation = useNavigation(); const navigation = useNavigation();
@ -25,8 +27,8 @@ function Scroll({ books }) {
style={[ style={[
tw("rounded-md mx-1 overflow-hidden rounded-md"), tw("rounded-md mx-1 overflow-hidden rounded-md"),
{ {
width: position === 0 ? 163 : 79, width: position === 0 ? mobile ? 163 : 240 : mobile ? 79 : 125,
height: position === 0 ? 245 : 118, height: position === 0 ? mobile ? 245 : 350 : mobile ? 118 : 170,
}, },
]} ]}
onPress={() => onPress={() =>
@ -48,7 +50,7 @@ function Scroll({ books }) {
ios ? "flex-wrap" : "flex-wrap-reverse" ios ? "flex-wrap" : "flex-wrap-reverse"
}` }`
), ),
{ height: 245, direction: "rtl" }, { height: mobile ? 245 : 350, direction: "rtl" },
]} ]}
> >
{books.map((book, index) => ( {books.map((book, index) => (
@ -72,6 +74,8 @@ function Scroll({ books }) {
); );
} }
const mapStateToProps = (state) => ({}); const mapStateToProps = (state) => ({
mobile : state.publicApi.mobile
});
export default connect(mapStateToProps, {})(Scroll); export default connect(mapStateToProps, {})(Scroll);

@ -21,13 +21,13 @@ import fontSize from "../../../constants/fontSize";
const ios = Platform.OS === "ios"; const ios = Platform.OS === "ios";
function Videos({ videos, grades }) { function Videos({ videos, grades, mobile }) {
const colorScheme = Appearance.getColorScheme(); const colorScheme = Appearance.getColorScheme();
const Video = ({ video }) => { const Video = ({ video }) => {
const navigation = useNavigation(); const navigation = useNavigation();
return ( return (
<TouchableOpacity <TouchableOpacity
style={tw("flex flex-col ml-3")} style={tw(`flex flex-col ${mobile ? "ml-3" : "ml-5"}`)}
onPress={() => navigation.navigate("Video", { id: video.id })} onPress={() => navigation.navigate("Video", { id: video.id })}
> >
<Image <Image
@ -35,8 +35,8 @@ function Videos({ videos, grades }) {
style={[ style={[
tw("rounded-md"), tw("rounded-md"),
{ {
height: 160, height: mobile ? 160 : 280,
width: 110, width: mobile ? 110 : 200,
}, },
]} ]}
/> />
@ -46,12 +46,12 @@ function Videos({ videos, grades }) {
{ {
color: Colors.theme1[colorScheme].gray20, color: Colors.theme1[colorScheme].gray20,
fontFamily: "bold", fontFamily: "bold",
fontSize: fontSize.base, fontSize: mobile ? fontSize.base : fontSize.xl,
textAlign: ios ? "right" : "auto", textAlign: ios ? "right" : "auto",
}, },
]} ]}
> >
{video.name} {'دوره ویدئویی' + ' ' + video.name}
</Text> </Text>
<Text <Text
style={[ style={[
@ -59,7 +59,7 @@ function Videos({ videos, grades }) {
{ {
color: Colors.theme1[colorScheme].gray20, color: Colors.theme1[colorScheme].gray20,
fontFamily: "regular", fontFamily: "regular",
fontSize: fontSize.tiny, fontSize: mobile ? fontSize.tiny : fontSize.base,
textAlign: ios ? "right" : "auto", textAlign: ios ? "right" : "auto",
}, },
]} ]}
@ -94,6 +94,7 @@ function Videos({ videos, grades }) {
const mapStateToProps = (state) => ({ const mapStateToProps = (state) => ({
grades: state.publicApi.grades, grades: state.publicApi.grades,
mobile : state.publicApi.mobile
}); });
export default connect(mapStateToProps, {})(Videos); export default connect(mapStateToProps, {})(Videos);

@ -32,7 +32,9 @@ const Home = ({
getBooks, getBooks,
userProducts, userProducts,
getUserProducts, getUserProducts,
mobile,
}) => { }) => {
const [width, setWidth] = useState(Dimensions.get("window").width);
const [position, setPosition] = useState("100%"); const [position, setPosition] = useState("100%");
useEffect(() => { useEffect(() => {
@ -69,15 +71,17 @@ const Home = ({
<Drawer setBoxPosition={setBoxPosition} position={position} /> <Drawer setBoxPosition={setBoxPosition} position={position} />
<ScrollView <ScrollView
contentContainerStyle={styles.contentContainerStyle} contentContainerStyle={styles.contentContainerStyle}
style={[styles.container]} style={[styles.container, { width }]}
onLayout={() => setWidth(Dimensions.get("window").width)}
> >
{userProduct?.length > 0 && <MyBooks books={userProducts} />} {!mobile && <View style={tw("mt-5")}></View>}
{userProduct?.length > 0 && <MyBooks books={userProducts} />}
<View style={tw("px-4 w-full")}> <View style={tw("px-4 w-full")}>
<Header title={"فروشگاه"} route={"Products"} /> <Header title={"فروشگاه"} route={"Products"} />
</View> </View>
{books?.length > 0 && <Scroll books={books} />} {books?.length > 0 && <Scroll books={books} />}
{books?.length > 0 && <Videos videos={books} />} {books?.length > 0 && <Videos videos={books} />}
{/* {blogs?.length > 0 && <Blogs blogs={blogs} />} */} {blogs?.length > 0 && <Blogs blogs={blogs} />}
</ScrollView> </ScrollView>
</SafeAreaView> </SafeAreaView>
); );
@ -90,7 +94,6 @@ const styles = StyleSheet.create({
// alignItems: "", // alignItems: "",
}, },
container: { container: {
width: Dimensions.get("window").width,
backgroundColor: "white", backgroundColor: "white",
flexDirection: "column", flexDirection: "column",
paddingVertical: 0, paddingVertical: 0,
@ -102,6 +105,7 @@ const mapStateToProps = (state) => ({
blogs: state.blog.list, blogs: state.blog.list,
books: state.book.list, books: state.book.list,
userProducts: state.userProduct.list, userProducts: state.userProduct.list,
mobile: state.publicApi.isMobile,
}); });
const mapDispatchToProps = { const mapDispatchToProps = {

@ -56,88 +56,112 @@ function Login(props) {
<KeyboardAvoidingView <KeyboardAvoidingView
behavior={ios ? "padding" : "height"} behavior={ios ? "padding" : "height"}
style={[ style={[
tw("flex flex-col flex-1 justify-center items-center bg-white px-4"), tw(
`flex flex-col flex-1 justify-center items-center bg-white mx-auto px-4`
),
]} ]}
> >
{/* <TouchableWithoutFeedback> */} {/* <TouchableWithoutFeedback> */}
<Image <Image
source={Logo} source={Logo}
style={{ style={{
width: 55, width: 55,
height: 80, height: 80,
}} }}
/>
<Text
style={[
tw(
`w-full mt-5 ${ios ? "text-right" : ""} ${
props.mobile ? "" : "w-3/4"
}`
),
{
fontSize: fontSize.xl2,
fontFamily: "bold",
color: Colors.theme1[colorScheme].black,
},
]}
>
{"سلام"}
</Text>
<Text
style={[
tw(
`w-full ${ios ? "text-right" : ""} ${
props.mobile ? "mb-5" : "mb-10 w-3/4"
}`
),
{
fontSize: fontSize.xl2,
fontFamily: "bold",
color: Colors.theme1[colorScheme].black,
},
]}
>
{"خوش برگشتی!"}
</Text>
<View
style={[
tw(
`w-full rounded-md overflow-hidden relative ${
props.mobile ? "" : "w-3/4"
}`
),
{},
]}
>
<CustomTextInput
label="شماره موبایل"
textAlign="left"
name="phone"
maxLength={11}
value={phone}
onChange={onChangePhone}
autoFocus={true}
direction="ltr"
regex={onInput.phonenumber}
/> />
<Text </View>
style={[ {
tw(`w-full mt-5 ${ios ? "text-right" : ""}`), !props.mobile && <View style={tw('mt-10')}></View>
{ }
fontSize: fontSize.xl2, <TouchableHighlight
fontFamily: "bold", disabled={loading}
color: Colors.theme1[colorScheme].black, style={[
}, tw(`w-full py-2.5 rounded-md ${props.mobile ? "" : "w-2/4"}`),
]} {
> backgroundColor: Colors.theme1[colorScheme].greenCF,
{"سلام"} alignItems: "center",
</Text> justifyContent: "center",
<Text marginTop: 15,
style={[ fontFamily: "light",
tw(`w-full mb-5 ${ios ? "text-right" : ""}`), },
{ ]}
fontSize: fontSize.xl2, onPress={() => submit()}
fontFamily: "bold", >
color: Colors.theme1[colorScheme].black, {loading ? (
}, <ActivityIndicator size={"small"} color={"white"} />
]} ) : (
> <Text
{"خوش برگشتی!"} style={{
</Text> color: "white",
<View style={[tw("w-full rounded-md overflow-hidden relative"), {}]}> fontSize: fontSize.xl,
<CustomTextInput fontWeight: "bold",
label="شماره موبایل" }}
textAlign="left" >
name="phone" {"ادامه"}
maxLength={11} </Text>
value={phone} )}
onChange={onChangePhone} </TouchableHighlight>
autoFocus={true}
direction="ltr"
regex={onInput.phonenumber}
/>
</View>
<TouchableHighlight
disabled={loading}
style={[
tw("w-full py-2.5 rounded-md"),
{
backgroundColor: Colors.theme1[colorScheme].greenCF,
alignItems: "center",
justifyContent: "center",
marginTop: 15,
fontFamily: "light",
},
]}
onPress={() => submit()}
>
{loading ? (
<ActivityIndicator size={"small"} color={"white"} />
) : (
<Text
style={{
color: "white",
fontSize: fontSize.xl,
fontWeight: "bold",
}}
>
{"ادامه"}
</Text>
)}
</TouchableHighlight>
{/* </TouchableWithoutFeedback> */} {/* </TouchableWithoutFeedback> */}
</KeyboardAvoidingView> </KeyboardAvoidingView>
); );
} }
const mapStateToProps = (state) => ({}); const mapStateToProps = (state) => ({
mobile: state.publicApi.mobile,
});
const mapDispatchToProps = { const mapDispatchToProps = {
sendPhoneNumber: user.otp, sendPhoneNumber: user.otp,

@ -132,11 +132,11 @@ function Otp(props) {
/> />
<Text <Text
style={[ style={[
tw(`w-full mt-2.5 ${ios ? 'text-right' : ""}`), tw(`w-full mt-2.5 ${ios ? 'text-right' : ""} ${props.mobile ? "" : "w-3/4"}`),
{ {
fontSize: fontSize.sm, fontSize: props.mobile ? fontSize.sm : fontSize.base,
fontFamily: "regular", fontFamily: "regular",
color: "#6f7074", color: Colors.theme1[colorScheme].gray20,
}, },
]} ]}
>{`یک کد تائیدیه به شماره ${props.route.params?.phone} ارسال شد. آن را در قسمت زیر وارد کنید`}</Text> >{`یک کد تائیدیه به شماره ${props.route.params?.phone} ارسال شد. آن را در قسمت زیر وارد کنید`}</Text>
@ -152,7 +152,7 @@ function Otp(props) {
fontSize: fontSize.xl3, fontSize: fontSize.xl3,
fontFamily: "bold", fontFamily: "bold",
color: Colors.theme1[colorScheme].green79, color: Colors.theme1[colorScheme].green79,
// width : ios ? fontSize.xl3 + 40 : "" width : ios ? fontSize.xl3 + 40 : ""
}, },
]} ]}
underlineColorAndroid={"transparent"} underlineColorAndroid={"transparent"}
@ -170,7 +170,7 @@ function Otp(props) {
fontSize: fontSize.xl3, fontSize: fontSize.xl3,
fontFamily: "bold", fontFamily: "bold",
color: Colors.theme1[colorScheme].green79, color: Colors.theme1[colorScheme].green79,
// width : ios ? fontSize.xl3 + 40 : "" width : ios ? fontSize.xl3 + 40 : ""
}, },
]} ]}
underlineColorAndroid={"transparent"} underlineColorAndroid={"transparent"}
@ -188,7 +188,7 @@ function Otp(props) {
fontSize: fontSize.xl3, fontSize: fontSize.xl3,
fontFamily: "bold", fontFamily: "bold",
color: Colors.theme1[colorScheme].green79, color: Colors.theme1[colorScheme].green79,
// width : ios ? fontSize.xl3 + 40 : "" width : ios ? fontSize.xl3 + 40 : ""
}, },
]} ]}
underlineColorAndroid={"transparent"} underlineColorAndroid={"transparent"}
@ -206,7 +206,7 @@ function Otp(props) {
fontSize: fontSize.xl3, fontSize: fontSize.xl3,
fontFamily: "bold", fontFamily: "bold",
color: Colors.theme1[colorScheme].green79, color: Colors.theme1[colorScheme].green79,
// width : ios ? fontSize.xl3 + 40 : "" width : ios ? fontSize.xl3 + 40 : ""
}, },
]} ]}
underlineColorAndroid={"transparent"} underlineColorAndroid={"transparent"}
@ -221,7 +221,7 @@ function Otp(props) {
<TouchableOpacity <TouchableOpacity
disabled={loading} disabled={loading}
style={[ style={[
tw("w-full rounded-md py-2 mt-6 items-center justify-center"), tw(`w-full rounded-md py-2 mt-6 items-center justify-center ${props.mobile ? "" : "w-3/4"}`),
{ {
backgroundColor: Colors.theme1[colorScheme].greenCF, backgroundColor: Colors.theme1[colorScheme].greenCF,
}, },
@ -246,7 +246,7 @@ function Otp(props) {
<Text <Text
style={[ style={[
tw("mt-7 text-center"), tw("mt-7 text-center"),
{ fontFamily: "light", fontSize: fontSize.base }, { fontFamily: "light", fontSize: fontSize.base, color : Colors.theme1[colorScheme].gray20 },
]} ]}
> >
{"زمان باقی مانده تا انقضای کد: " + time} {"زمان باقی مانده تا انقضای کد: " + time}
@ -275,6 +275,7 @@ function Otp(props) {
const mapStateToProps = (state) => ({ const mapStateToProps = (state) => ({
isLogin: state.user.status, isLogin: state.user.status,
mobile : state.publicApi.mobile
}); });
const mapDispatchToProps = { const mapDispatchToProps = {

@ -1,4 +1,11 @@
import { View, Text, Image, Appearance, Platform, Pressable } from "react-native"; import {
View,
Text,
Image,
Appearance,
Platform,
Pressable,
} from "react-native";
import React from "react"; import React from "react";
import { connect } from "react-redux"; import { connect } from "react-redux";
import Svg, { Path } from "react-native-svg"; import Svg, { Path } from "react-native-svg";
@ -21,30 +28,26 @@ const User = ({ user }) => {
)} )}
onPress={() => setDropdown(!dropdown)} onPress={() => setDropdown(!dropdown)}
> >
<View <View style={tw(`flex items-center flex-row-reverse`)}>
style={tw( {user?.picFileIds ? (
`flex items-center flex-row-reverse`
)}
>
{user?.picFileId ? (
<Image <Image
source={{ uri: "https://dnvn.ir/api/v1/" + user.picFileId }} source={{ uri: "https://dnvn.ir/api/v1/" + user.picFileIds }}
style={[tw("rounded-full"), { width: 70, height: 70 }]} style={[tw("rounded-full"), { width: 70, height: 70 }]}
/> />
) : ( ) : (
<View <View
style={[ style={[
tw("rounded-full bg-gray-400"), tw("rounded-full"),
{ minWidth: 60, minHeight: 60, zIndex: 1 }, { width: 60, height: 60, zIndex: 1, backgroundColor: "#ddd" },
]} ]}
></View> ></View>
)} )}
<View style={tw(`flex flex-col ${ios ? "items-end" : ""}`)}> <View style={tw(`flex flex-col mr-1 ${ios ? "items-end" : ""}`)}>
<Text <Text
style={{ style={{
fontSize: fontSize.xl, fontSize: fontSize.lg,
color: Colors.theme1[colorScheme].gray20, color: Colors.theme1[colorScheme].gray20,
fontFamily: "regular", fontFamily: "bold",
}} }}
> >
{user?.firstName + " " + user?.lastName} {user?.firstName + " " + user?.lastName}
@ -54,6 +57,7 @@ const User = ({ user }) => {
fontSize: fontSize.tiny, fontSize: fontSize.tiny,
color: Colors.theme1[colorScheme].gray20, color: Colors.theme1[colorScheme].gray20,
fontFamily: "light", fontFamily: "light",
marginTop: 3,
}} }}
> >
{user?.cellphone} {user?.cellphone}
@ -79,25 +83,28 @@ const User = ({ user }) => {
> >
<View <View
style={[ style={[
tw( tw(`flex items-center w-full pb-3 mb-4 flex-row-reverse`),
`flex items-center w-full pb-3 mb-4 flex-row-reverse`
),
{ {
borderBottomWidth: 1, borderBottomWidth: 1,
borderColor: Colors.theme1[colorScheme].grayE3, borderColor: Colors.theme1[colorScheme].grayE3,
}, },
]} ]}
> >
{user?.picFileId ? ( {user?.picFileIds ? (
<Image <Image
source={{ uri: "https://dnvn.ir/api/v1/" + user.picFileId }} source={{ uri: "https://dnvn.ir/api/v1/" + user.picFileIds }}
style={[tw("rounded-full"), { width: 30, height: 30 }]} style={[tw("rounded-full"), { width: 30, height: 30 }]}
/> />
) : ( ) : (
<View <View
style={[ style={[
tw("rounded-full bg-gray-400"), tw("rounded-full"),
{ minWidth: 30, minHeight: 30, zIndex: 1 }, {
minWidth: 30,
minHeight: 30,
zIndex: 1,
backgroundColor: "#ddd",
},
]} ]}
></View> ></View>
)} )}
@ -105,7 +112,8 @@ const User = ({ user }) => {
style={{ style={{
fontSize: fontSize.base, fontSize: fontSize.base,
color: Colors.theme1[colorScheme].gray20, color: Colors.theme1[colorScheme].gray20,
fontFamily: "regular", fontFamily: "bold",
marginRight: 5,
}} }}
> >
{user?.firstName + " " + user?.lastName} {user?.firstName + " " + user?.lastName}
@ -113,9 +121,7 @@ const User = ({ user }) => {
</View> </View>
<View <View
style={[ style={[
tw( tw(`flex items-center w-full pb-3 mb-3 flex-row-reverse`),
`flex items-center w-full pb-3 mb-3 flex-row-reverse`
),
{ {
borderBottomWidth: 1, borderBottomWidth: 1,
borderColor: Colors.theme1[colorScheme].grayE3, borderColor: Colors.theme1[colorScheme].grayE3,

Loading…
Cancel
Save