diff --git a/navigation/index.js b/navigation/index.js index 3b6d4e0..24645c0 100644 --- a/navigation/index.js +++ b/navigation/index.js @@ -1,6 +1,6 @@ import React, { useEffect } from "react"; import Svg, { G, Path } from "react-native-svg"; -import { Appearance } from "react-native"; +import { Appearance, Platform } from "react-native"; import { NavigationContainer } from "@react-navigation/native"; import { createNativeStackNavigator } from "@react-navigation/native-stack"; import { createBottomTabNavigator } from "@react-navigation/bottom-tabs"; @@ -40,29 +40,35 @@ import fontSize from "../src/constants/fontSize"; import Colors from "../src/constants/Colors"; import tw from "tailwind-react-native-classnames"; +const ios = Platform.OS === "ios"; + const Tab = createBottomTabNavigator(); const BottomTabNavigator = () => { + const [height, setHeight] = React.useState(88); const colorScheme = Appearance.getColorScheme(); - + React.useEffect(() => { + setTimeout(() => { + setHeight(89); + },1000); + },[]); return ( { > + + - diff --git a/src/components/Search.js b/src/components/Search.js index 42a7635..feaf5a8 100644 --- a/src/components/Search.js +++ b/src/components/Search.js @@ -1,28 +1,22 @@ -import React, {useState} from 'react'; +import React, { useState } from "react"; import { TextInput, View, Dimensions, StyleSheet, Pressable, - Appearance -} from 'react-native'; -import tw from 'tailwind-rn'; -import { AntDesign } from '@expo/vector-icons'; + Appearance, +} from "react-native"; +import tw from "tailwind-rn"; +import { AntDesign } from "@expo/vector-icons"; //style import Colors from "../constants/Colors"; -import fontSize from '../constants/fontSize'; +import fontSize from "../constants/fontSize"; -const width = Dimensions.get('window').width; +const width = Dimensions.get("window").width; -const Search = ({ - placeholder, - textAlign, - direction, - onChange, - value, -}) => { +const Search = ({ placeholder, textAlign, direction, onChange, value }) => { const colorScheme = Appearance.getColorScheme(); const styles = StyleSheet.create({ inputStyle: { @@ -35,19 +29,19 @@ const Search = ({ direction: direction, textAlign: textAlign, backgroundColor: Colors.theme1[colorScheme].white, - fontFamily : 'regular' + fontFamily: "regular", }, }); return ( - + onChange(text)} + style={[styles.inputStyle, tw("rounded-md")]} + onChangeText={(text) => onChange(text)} placeholder={placeholder} placeholderTextColor={Colors.theme1[colorScheme].gray2077} value={value} /> - + @@ -57,6 +51,6 @@ const Search = ({ export default Search; Search.defaultProps = { - direction: 'rtl', - textAlign: 'right', -}; \ No newline at end of file + direction: "rtl", + textAlign: "right", +}; diff --git a/src/screens/Blogs/layouts/New.js b/src/screens/Blogs/layouts/New.js index f096191..2fc80d1 100644 --- a/src/screens/Blogs/layouts/New.js +++ b/src/screens/Blogs/layouts/New.js @@ -45,7 +45,7 @@ export const New = ({ blog }) => { fontFamily: "bold", color: Colors.theme1[colorScheme].gray20, marginTop: 5, - textAlign: ios ? "right" : "", + textAlign: ios ? "right" : "auto", }} > {blog?.title} @@ -55,7 +55,7 @@ export const New = ({ blog }) => { fontSize: fontSize.sm, fontFamily: "regular", color: Colors.theme1[colorScheme].gray2077, - textAlign: ios ? "right" : "", + textAlign: ios ? "right" : "auto", marginTop: 5, }} > diff --git a/src/screens/Blogs/layouts/Single.js b/src/screens/Blogs/layouts/Single.js index 20c1983..810c68c 100644 --- a/src/screens/Blogs/layouts/Single.js +++ b/src/screens/Blogs/layouts/Single.js @@ -6,6 +6,7 @@ import { Dimensions, Image, Appearance, + Platform, } from "react-native"; import { connect } from "react-redux"; import { LinearGradient } from "expo-linear-gradient"; @@ -17,6 +18,7 @@ import fontSize from "../../../constants/fontSize"; import Colors from "../../../constants/Colors"; const { height, width } = Dimensions.get("window"); +const ios = Platform.OS === "ios"; export const Single = ({ blog }) => { const navigation = useNavigation(); @@ -58,7 +60,11 @@ export const Single = ({ blog }) => { {"نوشته از:" + " " + "کامران ایزدی"} @@ -66,7 +72,11 @@ export const Single = ({ blog }) => { {"سردبیر بخش وبلاگ دانوین"} @@ -101,6 +111,7 @@ export const Single = ({ blog }) => { fontFamily: "bold", fontSize: fontSize.xl, color: Colors.theme1[colorScheme].gray20, + textAlign: ios ? "right" : "auto", }} > {blog?.title} @@ -112,6 +123,7 @@ export const Single = ({ blog }) => { color: Colors.theme1[colorScheme].gray2077, lineHeight: 25, marginTop: 10, + textAlign: ios ? "right" : "auto", }} > هر نفسی که فرو می‌ بریم، مرگی را که مدام به ما دست‌ اندازی می‌کند پس diff --git a/src/screens/Blogs/layouts/Target.js b/src/screens/Blogs/layouts/Target.js index 4fd80aa..5cb4de0 100644 --- a/src/screens/Blogs/layouts/Target.js +++ b/src/screens/Blogs/layouts/Target.js @@ -49,7 +49,7 @@ const Target = ({ blogs }) => { { fontFamily: "bold", fontSize: fontSize.xl, - textAlign: ios ? "right" : "", + textAlign: ios ? "right" : "auto", }, ]} > @@ -139,7 +139,7 @@ const Target = ({ blogs }) => { { fontFamily: "bold", fontSize: fontSize.lg, - textAlign: ios ? "right" : "", + textAlign: ios ? "right" : "auto", }, ]} > diff --git a/src/screens/Home/components/Blogs.js b/src/screens/Home/components/Blogs.js index e6304aa..0d4a5cc 100644 --- a/src/screens/Home/components/Blogs.js +++ b/src/screens/Home/components/Blogs.js @@ -7,7 +7,8 @@ import { TouchableOpacity, FlatList, Pressable, - Appearance + Appearance, + Platform } from "react-native"; import { connect } from "react-redux"; import Svg, { G, Path } from "react-native-svg"; @@ -24,6 +25,7 @@ import fontSize from "../../../constants/fontSize"; import userImage from "../assets/user.png"; const { width } = Dimensions.get("window"); +const ios = Platform.OS === "ios"; function Blogs({ blogs }) { const colorScheme = Appearance.getColorScheme(); @@ -64,6 +66,7 @@ function Blogs({ blogs }) { color: Colors.theme1[colorScheme].gray20, fontFamily: "bold", fontSize: fontSize.tiny, + textAlign: ios ? "right" : "auto", }, ]} > diff --git a/src/screens/Home/components/Videos.js b/src/screens/Home/components/Videos.js index 49385c5..3d1e916 100644 --- a/src/screens/Home/components/Videos.js +++ b/src/screens/Home/components/Videos.js @@ -5,6 +5,7 @@ import { TouchableOpacity, FlatList, Appearance, + Platform } from "react-native"; import { useNavigation } from "@react-navigation/native"; import tw from "tailwind-rn"; @@ -18,6 +19,8 @@ import Header from "../components/Header"; import Colors from "../../../constants/Colors"; import fontSize from "../../../constants/fontSize"; +const ios = Platform.OS === "ios"; + function Videos({ videos, grades }) { const colorScheme = Appearance.getColorScheme(); const Video = ({ video }) => { @@ -44,6 +47,7 @@ function Videos({ videos, grades }) { color: Colors.theme1[colorScheme].gray20, fontFamily: "bold", fontSize: fontSize.base, + textAlign: ios ? "right" : "auto", }, ]} > @@ -54,8 +58,9 @@ function Videos({ videos, grades }) { tw("mt-1 pr-1"), { color: Colors.theme1[colorScheme].gray20, - fontFamily: "light", + fontFamily: "regular", fontSize: fontSize.tiny, + textAlign: ios ? "right" : "auto", }, ]} > diff --git a/src/screens/Home/index.js b/src/screens/Home/index.js index 4f6a836..bafbd51 100644 --- a/src/screens/Home/index.js +++ b/src/screens/Home/index.js @@ -11,8 +11,9 @@ import { StatusBar, LayoutAnimation, } from "react-native"; + +//components import Navbar from "../../components/Navbar"; -import tw from "tailwind-rn"; import Scroll from "./components/Scroll"; import MyBooks from "./components/MyBooks"; import Videos from "./components/Videos"; @@ -20,6 +21,9 @@ import Blogs from "./components/Blogs"; import Drawer from "../../components/Drawer"; import Header from "./components/Header"; +//style +import tw from "tailwind-rn"; + // Within your render function const Home = ({ blogs, @@ -33,7 +37,7 @@ const Home = ({ useEffect(() => { getBlogs(); - getBooks({vod : true}); + getBooks({ vod: true }); getUserProducts(); }, []); @@ -41,7 +45,7 @@ const Home = ({ LayoutAnimation.configureNext(LayoutAnimation.Presets.easeInEaseOut); setPosition(position === "100%" ? "0%" : "100%"); }; - + return ( + - {userProduct?.length > 0 && } + {userProduct?.length > 0 && }
- {books?.length > 0 && } - {books?.length > 0 && } - {blogs?.length > 0 && } - + {books?.length > 0 && } + {books?.length > 0 && } + {/* {blogs?.length > 0 && } */} + ); }; @@ -81,10 +86,13 @@ const Home = ({ // Later on in your styles.. const styles = StyleSheet.create({ contentContainerStyle: { - paddingBottom: 20, + paddingBottom: 100, + // alignItems: "", }, container: { + width: Dimensions.get("window").width, backgroundColor: "white", + flexDirection: "column", paddingVertical: 0, paddingHorizontal: 0, }, diff --git a/src/screens/Login/index.js b/src/screens/Login/index.js index d4d4796..c4af650 100644 --- a/src/screens/Login/index.js +++ b/src/screens/Login/index.js @@ -1,5 +1,5 @@ import React, { useState } from "react"; -import {connect} from 'react-redux'; +import { connect } from "react-redux"; import { View, @@ -9,18 +9,20 @@ import { Dimensions, TouchableHighlight, Appearance, - Platform + Platform, + TouchableWithoutFeedback, + KeyboardAvoidingView, } from "react-native"; import Logo from "./assets/logo.png"; import CustomTextInput from "../../components/CustomTextInput"; -import onInput from '../../utils/onInput'; +import onInput from "../../utils/onInput"; import { asyncAwesomeAlert } from "../../utils/AsyncWrappers"; import tw from "tailwind-rn"; -import {user} from '../../redux/actions'; +import { user } from "../../redux/actions"; import Colors from "../../constants/Colors"; import fontSize from "../../constants/fontSize"; -const ios = Platform.OS === 'ios'; +const ios = Platform.OS === "ios"; const { width } = Dimensions.get("window"); @@ -34,7 +36,7 @@ function Login(props) { }; const checkPhoneNumber = () => { - return phone.split("").length === 11 && phone.slice(0, 2) === '09'; + return phone.split("").length === 11 && phone.slice(0, 2) === "09"; }; const submit = async () => { @@ -45,100 +47,100 @@ function Login(props) { showCancelButton: false, }); } - props.sendPhoneNumber({cellphone : phone}); - props.navigation.navigate("Otp", { phone : phone}); + props.sendPhoneNumber({ cellphone: phone }); + props.navigation.navigate("Otp", { phone: phone }); setLoading(false); }; return ( - - - - {"سلام"} - - - {"خوش برگشتی!"} - - - */} + - - submit()} - > - {loading ? ( - - ) : ( - - {"ادامه"} - - )} - - + + {"سلام"} + + + {"خوش برگشتی!"} + + + + + submit()} + > + {loading ? ( + + ) : ( + + {"ادامه"} + + )} + + {/* */} + ); } -const mapStateToProps = (state) => ({ - -}) +const mapStateToProps = (state) => ({}); const mapDispatchToProps = { - sendPhoneNumber : user.otp -} + sendPhoneNumber: user.otp, +}; export default connect(mapStateToProps, mapDispatchToProps)(Login); - diff --git a/src/screens/Products/components/Main.js b/src/screens/Products/components/Main.js index 2be56db..5bbf64b 100644 --- a/src/screens/Products/components/Main.js +++ b/src/screens/Products/components/Main.js @@ -5,6 +5,7 @@ import { Image, Dimensions, Appearance, + Platform, } from "react-native"; import React from "react"; import { connect } from "react-redux"; @@ -17,6 +18,7 @@ import Colors from "../../../constants/Colors"; import fontSize from "../../../constants/fontSize"; const width = Dimensions.get("window").width; +const ios = Platform.OS === "ios"; const Main = ({ books, filterOptions, grades }) => { const colorScheme = Appearance.getColorScheme(); @@ -90,15 +92,35 @@ const Main = ({ books, filterOptions, grades }) => { - {'دوره ویدئویی' + ' ' + product?.name} + {"دوره ویدئویی" + " " + product?.name} - + {"پایه" + " " + grades[product?.gradeId]} - + {separate(product?.product[2]?.price) + " " + "تومان"} @@ -120,7 +142,10 @@ const Main = ({ books, filterOptions, grades }) => { tw("flex justify-between px-2 pt-2 rounded-md"), ]} onPress={() => - navigation.navigate("Product", { id: product?.id, type: "book" }) + navigation.navigate("Product", { + id: product?.id, + type: "book", + }) } > @@ -135,11 +160,12 @@ const Main = ({ books, filterOptions, grades }) => { /> {"کتاب دیجیتال" + " " + product?.name} @@ -151,6 +177,7 @@ const Main = ({ books, filterOptions, grades }) => { marginTop: 5, fontFamily: "regular", width: "100%", + textAlign: ios ? "right" : "auto", }} > {"پایه" + " " + grades[product?.gradeId]} @@ -176,7 +203,7 @@ const Main = ({ books, filterOptions, grades }) => { @@ -200,7 +227,10 @@ const Main = ({ books, filterOptions, grades }) => { tw("flex justify-between px-2 pt-2 rounded-md"), ]} onPress={() => - navigation.navigate("Product", { id: product?.id, type: "book" }) + navigation.navigate("Product", { + id: product?.id, + type: "book", + }) } > @@ -215,11 +245,12 @@ const Main = ({ books, filterOptions, grades }) => { /> {"کتاب فیزیکی" + " " + product?.name} @@ -231,6 +262,7 @@ const Main = ({ books, filterOptions, grades }) => { marginTop: 5, fontFamily: "regular", width: "100%", + textAlign: ios ? "right" : "auto", }} > {"پایه" + " " + grades[product?.gradeId]} @@ -256,7 +288,7 @@ const Main = ({ books, filterOptions, grades }) => { @@ -271,9 +303,11 @@ const Main = ({ books, filterOptions, grades }) => { return ( {filterOptions?.productType === "دوره ویدئویی" && Items(2)} {filterOptions?.productType === "کتاب دیجیتال" && Items(0)} diff --git a/src/screens/VideoDisplay/index.js b/src/screens/VideoDisplay/index.js index 09eb3e8..295edc7 100644 --- a/src/screens/VideoDisplay/index.js +++ b/src/screens/VideoDisplay/index.js @@ -9,6 +9,7 @@ import { LayoutAnimation, Appearance, Text, + Platform, } from "react-native"; import { connect } from "react-redux"; import { publicApi } from "../../redux/actions"; @@ -26,6 +27,7 @@ import fontSize from "../../constants/fontSize"; import Colors from "../../constants/Colors"; const { width } = Dimensions.get("window"); +const ios = Platform.OS === "ios"; function VideoDisplay({ route }) { const colorScheme = Appearance.getColorScheme(); @@ -53,7 +55,7 @@ function VideoDisplay({ route }) { return ( @@ -88,7 +90,12 @@ function VideoDisplay({ route }) { onPlaybackStatusUpdate={(status) => setStatus(() => status)} /> {route.params.unit?.name}