diff --git a/app.json b/app.json index 6354558..5c80269 100644 --- a/app.json +++ b/app.json @@ -1,11 +1,11 @@ { "expo": { - "name": "RnDanovinExpo", - "slug": "RnDanovinExpo", + "name": "Danovin", + "slug": "Danovin", "version": "1.0.0", "orientation": "portrait", "userInterfaceStyle": "automatic", - "icon": "", + "icon": "./assets/appLogo.png", "scheme": "danovin", "splash": { "image": "", diff --git a/assets/appLogo.png b/assets/appLogo.png new file mode 100644 index 0000000..c247f50 Binary files /dev/null and b/assets/appLogo.png differ diff --git a/navigation/index.js b/navigation/index.js index 3811c52..03558b6 100644 --- a/navigation/index.js +++ b/navigation/index.js @@ -51,7 +51,7 @@ const BottomTabNavigator = () => { React.useEffect(() => { setTimeout(() => { setHeaderShown(false); - }, 500); + }, 600); }, []); return ( { const colorScheme = useColorScheme(); @@ -95,6 +96,7 @@ const FloatingLabelInput = ({ maxLength={maxLength} value={value} onBlur={() => (value ? {} : setIsFocused(() => false))} + keyboardType={keyboardType} /> ); diff --git a/src/components/MapSelector.js b/src/components/MapSelector.js index e025a91..1354a09 100644 --- a/src/components/MapSelector.js +++ b/src/components/MapSelector.js @@ -6,7 +6,6 @@ const X_API_KEY = "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6IjkyODE4ODI0N2FhM export default function MapSelector() { onRegionDidChange = (e) => { - console.log('onRegionDidChange', e.geometry.coordinates); }; return ( diff --git a/src/components/MusicPlayer.js b/src/components/MusicPlayer.js index e1e0af3..71528c4 100644 --- a/src/components/MusicPlayer.js +++ b/src/components/MusicPlayer.js @@ -6,19 +6,16 @@ export default function VoicePlayer({fileIds}) { const [sound, setSound] = React.useState(); async function playSound() { - console.log('Loading Sound'); const { sound } = await Audio.Sound.createAsync( {uri : `https://dnvn.ir/api/v1/file/${fileIds}`} ); setSound(sound); - console.log('Playing Sound'); await sound.playAsync(); } React.useEffect(() => { return sound ? () => { - console.log('Unloading Sound'); sound.unloadAsync(); } : undefined; }, [sound]); diff --git a/src/redux/proxy.js b/src/redux/proxy.js index d7aa0f6..b7c8d98 100644 --- a/src/redux/proxy.js +++ b/src/redux/proxy.js @@ -27,7 +27,6 @@ class Proxy { data || params ); } catch (error) { - console.log("proxy get error! : ", error); } }; @@ -35,7 +34,6 @@ class Proxy { try { this.check(url, opt, () => Axios.post(url, params, opt), data || params); } catch (error) { - console.log("proxy post error! : ", error); } }; @@ -43,7 +41,6 @@ class Proxy { try { this.check(url, opt, () => Axios.put(url, params, opt), data || params); } catch (error) { - console.log("proxy put error! : ", error); } }; @@ -56,7 +53,6 @@ class Proxy { data || params ); } catch (error) { - console.log("proxy delete error! : ", error); } }; @@ -72,7 +68,6 @@ class Proxy { case 401: if (this.refresh()) { let response = fetch(); - console.log('check 401', response ) dispatch({ type: url, data: response.data.data, params }); return response.data.data; } @@ -86,7 +81,6 @@ class Proxy { } return false; } catch (error) { - console.log("proxy check error! : ", error); } }; @@ -102,12 +96,10 @@ class Proxy { ); return login ? true : false; } catch (error) { - console.log("proxy refresh error! : ", error); } }; login = (url, params, { dispatch }) => { - console.log('login called'); try { this.post(url, params, { dispatch: (obj) => { @@ -125,7 +117,6 @@ class Proxy { }, }); } catch (error) { - console.log("proxy login error! : ", error); } }; @@ -139,7 +130,6 @@ class Proxy { }, }); } catch (error) { - console.log("proxy logout error : ", error); } }; status = async () => { @@ -154,7 +144,6 @@ class Proxy { } return userData || null; } catch (error) { - console.log("proxy status error : ", error); return nulll; } }; diff --git a/src/redux/reducers/activation.js b/src/redux/reducers/activation.js index b3fbf2f..a4fa301 100644 --- a/src/redux/reducers/activation.js +++ b/src/redux/reducers/activation.js @@ -17,14 +17,12 @@ export default function activation(state = initialState, action) { asyncAwesomeAlert("نتیجه", data.message, { showCancelButton: false, }); - console.log(data.message); return { ...state, loading: false, error: null }; case "activation/delete": return { ...state, loading: false, error: null }; case "loading": return { ...state, loading: true }; case "error": - console.log(data.message); asyncAwesomeAlert("خطا", data.message, { showCancelButton: false, }); diff --git a/src/redux/reducers/user.js b/src/redux/reducers/user.js index 7fbd6ab..76ef600 100644 --- a/src/redux/reducers/user.js +++ b/src/redux/reducers/user.js @@ -1,5 +1,6 @@ import proxy from "../proxy"; import AsyncStorage from "@react-native-async-storage/async-storage"; +import {asyncAwesomeAlert} from '../../utils/AsyncWrappers'; let initialState = { status: null, @@ -41,7 +42,7 @@ const user = (state = initialState, action) => { try { AsyncStorage.setItem("userData", myData); } catch (error) { - console.log("user/getProfile", error); + ("user/getProfile", error); } return { ...state, @@ -61,6 +62,9 @@ const user = (state = initialState, action) => { case "loading": return { ...state, loading: true }; case "error": + asyncAwesomeAlert("خظا", data.message, { + showCancelButton: false, + }); return { ...state, loading: false, error: data.message }; default: return state; diff --git a/src/redux/store.js b/src/redux/store.js index 5661daf..784822f 100644 --- a/src/redux/store.js +++ b/src/redux/store.js @@ -62,7 +62,6 @@ try { ReactNative.I18nManager.allowRTL(false); // enableScreens(); } catch (e) { - console.log(e); } diff --git a/src/screens/DeliveryForm/index.js b/src/screens/DeliveryForm/index.js index 22d5f3b..bc86c1a 100644 --- a/src/screens/DeliveryForm/index.js +++ b/src/screens/DeliveryForm/index.js @@ -37,7 +37,6 @@ const DeliveryForm = ({ list, form, getList, getFactorInfo, userId, payFactor, f getList(); }, []); - console.log(userFactor); return ( @@ -118,6 +118,7 @@ function Login(props) { maxLength={11} value={phone} onChange={onChangePhone} + keyboardType="numeric" autoFocus={true} direction="ltr" regex={(text) => onInput.phonenumber(text)} diff --git a/src/screens/Otp/index.js b/src/screens/Otp/index.js index b86e278..25520cd 100644 --- a/src/screens/Otp/index.js +++ b/src/screens/Otp/index.js @@ -123,6 +123,12 @@ function Otp(props) { } }, [props.isLogin]); + const goBack = () => { + timer = 60; + props.navigation.navigate("Login"); + + } + return ( onChangeCode(text, "1")} regex={onInput.numberOnly} direction="ltr" + keyboardType="numeric" /> onChangeCode(text, "2")} regex={onInput.numberOnly} direction="ltr" + keyboardType="numeric" /> onChangeCode(text, "3")} regex={onInput.numberOnly} direction="ltr" + keyboardType="numeric" /> onChangeCode(text, "4")} regex={onInput.numberOnly} direction="ltr" + keyboardType="numeric" /> props.navigation.navigate("Login")} + onPress={() => goBack()} > {!mobile && } @@ -64,18 +69,11 @@ function Book({ book, grades, pushToCart, userId, loading, mobile }) { )} {imageSlider && } - setImageSlider(true)} - > + - - {book.product[type].name} + {book?.name} - {"پایه" + " " + grades[book.gradeId]} + {"پایه" + " " + grades[book?.gradeId]} - {book.text} + {book?.text} @@ -129,7 +128,7 @@ function Book({ book, grades, pushToCart, userId, loading, mobile }) { }} > {" "} - {book.pagesNum + "\n" + "صفحه"} + {book?.pagesNum + "\n" + "صفحه"} - setType(1)} - backgroundColor={ - type === 0 ? "transparent" : Colors.theme1[colorScheme].greenCF + + pushToCart({ + productId: book?.product[1]?.id, + userId: userId, + count: 1, + }) } - color={type === 0 ? Colors.theme1[colorScheme].greenCF : "white"} - border={{ color: Colors.theme1[colorScheme].greenCF, width: 1 }} - width={"49%"} - /> - setType(0)} - title={"نسخه دیجیتال"} - backgroundColor={ - type === 1 ? "transparent" : Colors.theme1[colorScheme].greenCF + > + + خرید نسخه فیزیکی کتاب + + + + + {separate(book?.product[1]?.price) + " " + "تومان"} + + + + + pushToCart({ + productId: book?.product[0]?.id, + userId: userId, + count: 1, + }) } - color={type === 1 ? Colors.theme1[colorScheme].greenCF : "white"} - border={{ color: Colors.theme1[colorScheme].greenCF, width: 1 }} - width={"49%"} - /> - + + خرید نسخه دیجیتال کتاب + + + + + {separate(book?.product[0]?.price) + " " + "تومان"} + + + + navigation.push("Sample", { id: book?.sampleFileId })} + > + + مشاهده نمونه + + + pushToCart({ - productId: book?.product[type]?.id, + productId: book?.product[2]?.id, userId: userId, count: 1, }) } - /> - navigation.push('Sample')} - /> - + + خرید دوره ویدئویی کتاب + + + + + {separate(book?.product[2]?.price) + " " + "تومان"} + + + + navigation.navigate("Video", { id: book.id })} + onPress={() => navigation.navigate("Video", { id: book?.id })} > - - مشاهده دوره ویدئویی این محصول + پیش نمایش - + - {book.product[type].description && ( - + {book?.product[type]?.description && ( + )} } + component={ + + } height={height - height / 4} /> */} - + ); } diff --git a/src/screens/Product/components/LinkBox.js b/src/screens/Product/components/LinkBox.js index ff03e63..0ce9cd1 100644 --- a/src/screens/Product/components/LinkBox.js +++ b/src/screens/Product/components/LinkBox.js @@ -21,7 +21,7 @@ function Description({ title, component, height, mobile }) { `flex flex-row-reverse justify-between items-center mt-3 rounded-md px-5 ${mobile ? "py-3" : "py-4"}` ), { - backgroundColor: Colors.theme1[colorScheme].greenCF, + backgroundColor: Colors.theme1[colorScheme].greenCF + '15', // borderWidth : 1, }, ]} @@ -29,8 +29,8 @@ function Description({ title, component, height, mobile }) { {title} - + { +import Navbar from "../../../components/Navbar"; + +const Sample = ({route}) => { return ( { flex : 1 }} > + diff --git a/src/screens/Product/components/Video.js b/src/screens/Product/components/Video.js deleted file mode 100644 index de6bd40..0000000 --- a/src/screens/Product/components/Video.js +++ /dev/null @@ -1,205 +0,0 @@ -import {t} from 'i18next'; -import React from 'react'; -import { - View, - Text, - Image, - Dimensions, - ScrollView, - Pressable, -} from 'react-native'; -import {Entypo} from '@expo/vector-icons'; -import CustomPressable from '../../../components/Pressable'; -import Description from './Description'; -import LinkBox from './LinkBox'; -import Comments from './Comments'; -import Rates from './Rates'; -import tw from 'tailwind-rn'; - - -const width = Dimensions.get('window').width; -const height = Dimensions.get('window').height; - -export default function Video({product}) { - return ( - - - - {/* */} - - - - - - - - {product.name} - - - {product.grade} - - - - {product.text} - - - - - - - {' '} - {473 + '\n' + 'صفحه'} - - - - - - {' '} - {'فیزیکی- دیجیتالی - ویدئو' + '\n' + 'در دسترس'} - - - - - - {' '} - {4.8 + '\n' + 'امتیاز'} - - - - - - نسخه محصول را انتخاب کنید - - - - - - - - - - - - - مشاهده دوره ویدئویی این محصول - - - - - - - - - - امتیازات و نظرات - - - - - - - ); -} diff --git a/src/screens/Product/index.js b/src/screens/Product/index.js index 9e34078..20f196d 100644 --- a/src/screens/Product/index.js +++ b/src/screens/Product/index.js @@ -8,21 +8,15 @@ import { StatusBar, } from "react-native"; import Book from "./components/Book"; -import Video from "./components/Video"; -import {book} from "../../redux/actions"; +import { book } from "../../redux/actions"; import { connect } from "react-redux"; import Navbar from "../../components/Navbar"; -function Product({ - route, - book, - getBook, - grades, -}) { +function Product({ route, book, getBook, grades }) { useEffect(() => { - getBook({id : route.params.id}); - },[]); - + getBook({ id: route.params.id, vod : true }); + }, []); + return ( - {book && (route.params.type === 'video' ? ( - ); @@ -69,12 +59,12 @@ const styles = StyleSheet.create({ }); const mapStateToProps = (state) => ({ - book : state.book.info, - grades : state.publicApi.grades + book: state.book.info, + grades: state.publicApi.grades, }); const mapDispatchToProps = { - getBook : book.info -} + getBook: book.info, +}; export default connect(mapStateToProps, mapDispatchToProps)(Product); diff --git a/src/screens/Profile/components/ProfileAddress/index.js b/src/screens/Profile/components/ProfileAddress/index.js index 6212398..e00faa7 100644 --- a/src/screens/Profile/components/ProfileAddress/index.js +++ b/src/screens/Profile/components/ProfileAddress/index.js @@ -249,7 +249,7 @@ const ProfileAddress = ({ borderWidth: 1.5, }, tw( - `flex flex-row-reverse self-end justify-center py-3 rounded-md items-center mt-4 mx-auto w-full` + `flex flex-row-reverse self-end justify-center py-3 rounded-md items-center mt-4 w-full` ), ]} onPress={() => navigation.push("CreateAddress")} diff --git a/src/screens/QRContent/Tab/index.js b/src/screens/QRContent/Tab/index.js index 282cd51..93f2ee7 100644 --- a/src/screens/QRContent/Tab/index.js +++ b/src/screens/QRContent/Tab/index.js @@ -14,7 +14,7 @@ const { width} = Dimensions.get("window"); export default function Tab({ data }) { const [dataType, setDataType] = useState("all"); - console.log(data); + return ( { if (data) { - // console.log(data.qr.content); + // (data.qr.content); } }, [data]); return (