reza linked to ar app

master
Reza_ashrafi 3 years ago
parent e492530a05
commit 25caef9116
  1. 1
      app.json
  2. 34
      navigation/index.js
  3. 2
      package.json
  4. 6
      src/components/BottomSheetComponents/ProductSpecifications.js
  5. 4
      src/components/Search.js
  6. 10
      src/screens/AR/components/Book.js
  7. 3
      src/screens/AR/index.js
  8. 1
      src/screens/Home/index.js
  9. 2
      src/screens/Login/index.js
  10. 52
      src/screens/Otp/index.js
  11. 4
      src/screens/Product/components/Book.js
  12. 24
      src/screens/Product/components/Sample.js
  13. 1
      src/screens/Products/components/Header.js
  14. 4
      src/screens/Profile/components/ProfileAddress/index.js
  15. 46
      yarn.lock

@ -6,6 +6,7 @@
"orientation": "portrait",
"userInterfaceStyle": "automatic",
"icon": "",
"scheme": "danovin",
"splash": {
"image": "",
"resizeMode": "contain",

@ -1,6 +1,8 @@
import React, { useEffect } from "react";
import * as Linking from 'expo-linking';
import Svg, { G, Path } from "react-native-svg";
import { Appearance, Platform, Dimensions } from "react-native";
import {Entypo} from '@expo/vector-icons';
import { NavigationContainer, DefaultTheme } from "@react-navigation/native";
import { createNativeStackNavigator } from "@react-navigation/native-stack";
import { createBottomTabNavigator } from "@react-navigation/bottom-tabs";
@ -34,6 +36,7 @@ import ProfileBookmark from "../src/screens/Profile/components/ProfileBookmark";
import ProfileAddress from "../src/screens/Profile/components/ProfileAddress";
import Blogs from "../src/screens/Blogs";
import Blog from "../src/screens/Blog";
import Sample from "../src/screens/Product/components/Sample";
//style
import fontSize from "../src/constants/fontSize";
@ -44,33 +47,34 @@ const colorScheme = Appearance.getColorScheme();
const Tab = createBottomTabNavigator();
const BottomTabNavigator = () => {
const [height, setHeight] = React.useState(88);
const [headerShown, setHeaderShown] = React.useState(true);
React.useEffect(() => {
setTimeout(() => {
setHeight(89);
}, 1000);
setHeaderShown(false);
}, 500);
}, []);
return (
<Tab.Navigator
initialRouteName="HomeTab"
screenOptions={{
tabBarHideOnKeyboard: true,
headerShown: false,
headerShown,
contentStyle: {
backgroundColor: "white",
},
tabBarIconStyle : {
},
tabBarLabelPosition: "below-icon",
tabBarActiveTintColor: Colors.theme1[colorScheme].green79,
tabBarInactiveTintColor: "grey",
tabBarStyle: {
backgroundColor: Colors.theme1[colorScheme].greenFF1,
height,
},
tabBarLabelStyle: {
fontSize: fontSize.sm,
fontFamily: "bold",
// fontSize: fontSize.sm,
// fontFamily: "bold",
},
tabBarShowLabel: true,
tabBarShowLabel: false,
}}
>
<Tab.Screen
@ -360,6 +364,7 @@ const HomeStackScreen = () => {
<HomeStack.Screen name="VideoDisplay" component={VideoDisplay} />
<HomeStack.Screen name="Products" component={Products} />
<HomeStack.Screen name="Product" component={Product} />
<HomeStack.Screen name="Sample" component={Sample} />
<HomeStack.Screen name="Blogs" component={Blogs} />
<HomeStack.Screen name="Blog" component={Blog} />
</HomeStack.Navigator>
@ -378,6 +383,7 @@ const ProductsStackScreen = () => {
>
<ProductsStack.Screen name="Products" component={Products} />
<ProductsStack.Screen name="Product" component={Product} />
<ProductsStack.Screen name="Sample" component={Sample} />
</ProductsStack.Navigator>
);
};
@ -427,13 +433,19 @@ const PROFILEStackScreen = () => {
);
};
const prefix = Linking.createURL('/')
const Stack = createNativeStackNavigator();
const Navigation = ({ getStatus, isLogin }) => {
const linking = {
prefixes: [prefix],
};
useEffect(() => {
getStatus();
}, []);
return (
<NavigationContainer>
<NavigationContainer linking={linking}>
<Stack.Navigator
// initialRouteName="Root"
screenOptions={{
@ -442,10 +454,10 @@ const Navigation = ({ getStatus, isLogin }) => {
}}
>
<Stack.Screen name="Splash" component={Splash} />
<Stack.Screen name="QR" component={QR} />
<Stack.Screen name="Root" component={BottomTabNavigator} />
<Stack.Screen name="Login" component={Login} />
<Stack.Screen name="Otp" component={Otp} />
<Stack.Screen name="QR" component={QR} />
<Stack.Screen name="Root" component={BottomTabNavigator} />
<Stack.Screen name="Orders" component={OrdersFollowUp} />
<Stack.Screen name="Order" component={OrderDetails} />
<Stack.Screen name="Faq" component={Faq} />

@ -27,6 +27,7 @@
"expo-device": "~4.1.0",
"expo-font": "^10.0.4",
"expo-linear-gradient": "~11.0.3",
"expo-linking": "~3.0.0",
"expo-screen-orientation": "~4.1.1",
"expo-status-bar": "~1.2.0",
"i18next": "^21.6.3",
@ -47,6 +48,7 @@
"react-native-select-dropdown": "^1.6.0",
"react-native-svg": "^12.1.1",
"react-native-web": "0.17.1",
"react-native-webview": "11.15.0",
"react-navigation-stack": "^2.10.4",
"react-redux": "^7.2.6",
"redux": "^4.1.2",

@ -32,7 +32,7 @@ const ProductSpecifications = ({ list, mobile }) => {
},
]}
>
{persian[prop]}
{prop?.description || 'description'}
</Text>
</View>
<View
@ -51,7 +51,7 @@ const ProductSpecifications = ({ list, mobile }) => {
},
]}
>
{list[prop]}
{prop?.value || 'value'}
</Text>
</View>
</View>
@ -83,7 +83,7 @@ const ProductSpecifications = ({ list, mobile }) => {
</Text>
</View>
<ScrollView style={tw("flex-1")}>
{Object?.keys(list)?.map((prop, index) => (
{list?.map((prop, index) => (
<Property prop={prop} key={index} />
))}
</ScrollView>

@ -23,7 +23,7 @@ const Search = ({ placeholder, textAlign, direction, onChange, value }) => {
fontSize: fontSize.tiny,
color: Colors.theme1[colorScheme].gray2077,
borderWidth: 0.5,
borderColor: Colors.theme1[colorScheme].gray20,
borderColor: Colors.theme1[colorScheme].gray20 + '88',
paddingVertical: 10,
paddingHorizontal: 10,
direction: direction,
@ -38,7 +38,7 @@ const Search = ({ placeholder, textAlign, direction, onChange, value }) => {
style={[styles.inputStyle, tw("rounded-md")]}
onChangeText={(text) => onChange(text)}
placeholder={placeholder}
placeholderTextColor={Colors.theme1[colorScheme].gray2077}
placeholderTextColor={Colors.theme1[colorScheme].gray20 + '88'}
value={value}
/>
<Pressable style={tw("absolute left-3 top-3")}>

@ -1,6 +1,8 @@
import { View, Text, Image, Dimensions, Appearance } from "react-native";
import { Pressable, Text, Image, Dimensions, Appearance } from "react-native";
import React from "react";
import { connect } from "react-redux";
import { useNavigation } from "@react-navigation/native";
import * as Linking from 'expo-linking';
//style
import tw from "tailwind-rn";
@ -10,13 +12,15 @@ import Colors from "../../../constants/Colors";
const { width, height } = Dimensions.get("window");
const Book = ({ book, mobile }) => {
const navigation = useNavigation();
const colorScheme = Appearance.getColorScheme();
return (
<View
<Pressable
style={[
tw("flex flex-col items-end rounded-md p-2 my-2"),
{ width: mobile ? "48%" : width / 4.2 },
]}
onPress={() => Linking.openURL(`https://ar.dnvn.ir/lunch?id=${book.id}`)}
>
<Image
source={{ uri: `https://dnvn.ir/api/v1/file/${book.fileId}` }}
@ -40,7 +44,7 @@ const Book = ({ book, mobile }) => {
>
{book.title}
</Text>
</View>
</Pressable>
);
};

@ -38,6 +38,7 @@ function AR({ getArList, arList, mobile }) {
paddingTop: Platform.OS === "android" ? StatusBar.currentHeight : 0,
position: "relative",
backgroundColor: "white",
flex : 1
}}
>
<Navbar
@ -59,7 +60,7 @@ function AR({ getArList, arList, mobile }) {
height: height,
backgroundColor: "white",
}}
contentContainerStyle={{ paddingBottom: 100 }}
contentContainerStyle={{ paddingBottom: 60 }}
>
<View
style={tw(

@ -52,6 +52,7 @@ const Home = ({
style={{
paddingTop: Platform.OS === "android" ? StatusBar.currentHeight : 0,
position: "relative",
flex : 1,
}}
>
<Navbar

@ -120,7 +120,7 @@ function Login(props) {
onChange={onChangePhone}
autoFocus={true}
direction="ltr"
regex={onInput.phonenumber}
regex={(text) => onInput.phonenumber(text)}
/>
</View>
{

@ -8,7 +8,7 @@ import {
TouchableOpacity,
ActivityIndicator,
Appearance,
Platform
Platform,
} from "react-native";
import tw from "tailwind-rn";
import { connect } from "react-redux";
@ -20,8 +20,7 @@ import { user } from "../../redux/actions";
import fontSize from "../../constants/fontSize";
import Colors from "../../constants/Colors";
const ios = Platform.OS === 'ios';
const ios = Platform.OS === "ios";
const { width } = Dimensions.get("window");
let ref1;
let ref2;
@ -38,8 +37,10 @@ function Otp(props) {
const [fourthCode, setFourthCode] = useState("");
const [time, setTime] = useState(60);
const [loading, setLoading] = useState(false);
const [timeEnd, setTimeEnd] = useState(false);
const onChangeCode = (value, key) => {
if (onInput.numberOnly(value) || value === "") {
switch (key) {
case "1":
setFirstCode(value);
@ -73,6 +74,9 @@ function Otp(props) {
break;
}
} else {
return;
}
};
const getEnCode = () => {
@ -105,6 +109,7 @@ function Otp(props) {
}, 1000);
let timeout = setTimeout(() => {
clearInterval(interval);
setTimeEnd(true);
}, 60000);
return () => {
clearInterval(interval);
@ -132,7 +137,11 @@ function Otp(props) {
/>
<Text
style={[
tw(`w-full mt-2.5 ${ios ? 'text-right' : ""} ${props.mobile ? "" : "w-3/4"}`),
tw(
`w-full mt-2.5 ${ios ? "text-right" : ""} ${
props.mobile ? "" : "w-3/4"
}`
),
{
fontSize: props.mobile ? fontSize.sm : fontSize.base,
fontFamily: "regular",
@ -152,12 +161,12 @@ function Otp(props) {
fontSize: fontSize.xl3,
fontFamily: "bold",
color: Colors.theme1[colorScheme].green79,
width : ios ? fontSize.xl3 + 40 : ""
width: fontSize.xl3 + 40,
},
]}
underlineColorAndroid={"transparent"}
value={firstCode}
maxLength={1}
maxLength={2}
ref={(ref) => (ref1 = ref)}
onChangeText={(text) => onChangeCode(text, "1")}
regex={onInput.numberOnly}
@ -170,12 +179,12 @@ function Otp(props) {
fontSize: fontSize.xl3,
fontFamily: "bold",
color: Colors.theme1[colorScheme].green79,
width : ios ? fontSize.xl3 + 40 : ""
width: fontSize.xl3 + 40,
},
]}
underlineColorAndroid={"transparent"}
value={secondCode}
maxLength={1}
maxLength={2}
ref={(ref) => (ref2 = ref)}
onChangeText={(text) => onChangeCode(text, "2")}
regex={onInput.numberOnly}
@ -188,12 +197,12 @@ function Otp(props) {
fontSize: fontSize.xl3,
fontFamily: "bold",
color: Colors.theme1[colorScheme].green79,
width : ios ? fontSize.xl3 + 40 : ""
width: fontSize.xl3 + 40,
},
]}
underlineColorAndroid={"transparent"}
value={thirdCode}
maxLength={1}
maxLength={2}
ref={(ref) => (ref3 = ref)}
onChangeText={(text) => onChangeCode(text, "3")}
regex={onInput.numberOnly}
@ -206,12 +215,12 @@ function Otp(props) {
fontSize: fontSize.xl3,
fontFamily: "bold",
color: Colors.theme1[colorScheme].green79,
width : ios ? fontSize.xl3 + 40 : ""
width: fontSize.xl3 + 40,
},
]}
underlineColorAndroid={"transparent"}
value={fourthCode}
maxLength={1}
maxLength={2}
ref={(ref) => (ref4 = ref)}
onChangeText={(text) => onChangeCode(text, "4")}
regex={onInput.numberOnly}
@ -221,7 +230,11 @@ function Otp(props) {
<TouchableOpacity
disabled={loading}
style={[
tw(`w-full rounded-md py-2 mt-6 items-center justify-center ${props.mobile ? "" : "w-3/4"}`),
tw(
`w-full rounded-md py-2 mt-6 items-center justify-center ${
props.mobile ? "" : "w-3/4"
}`
),
{
backgroundColor: Colors.theme1[colorScheme].greenCF,
},
@ -243,14 +256,20 @@ function Otp(props) {
)}
</TouchableOpacity>
<View>
{!timeEnd ? (
<Text
style={[
tw("mt-7 text-center"),
{ fontFamily: "light", fontSize: fontSize.base, color : Colors.theme1[colorScheme].gray20 },
{
fontFamily: "light",
fontSize: fontSize.base,
color: Colors.theme1[colorScheme].gray20,
},
]}
>
{"زمان باقی مانده تا انقضای کد: " + time}
{"زمان باقی مانده تا ارسال مجدد: " + time}
</Text>
) : (
<TouchableOpacity
style={{
marginTop: 20,
@ -268,6 +287,7 @@ function Otp(props) {
{"بازگشت به مرحله قبل و اصلاح شماره"}
</Text>
</TouchableOpacity>
)}
</View>
</View>
);
@ -275,7 +295,7 @@ function Otp(props) {
const mapStateToProps = (state) => ({
isLogin: state.user.status,
mobile : state.publicApi.mobile
mobile: state.publicApi.mobile,
});
const mapDispatchToProps = {

@ -230,7 +230,7 @@ function Book({ book, grades, pushToCart, userId, loading, mobile }) {
color={Colors.theme1[colorScheme].redFF1}
border={{ color: Colors.theme1[colorScheme].redFF1, width: 1 }}
width={"33%"}
onPress={() => {}}
onPress={() => navigation.push('Sample')}
/>
<TouchableOpacity
style={[
@ -270,7 +270,7 @@ function Book({ book, grades, pushToCart, userId, loading, mobile }) {
<LinkBox
title="مشخصات محصول"
key={"0"}
component={<ProductSpecifications />}
component={<ProductSpecifications list={book.product[type].properties} />}
height={height - height / 4}
/>
<LinkBox

@ -0,0 +1,24 @@
import { WebView } from "react-native-webview";
import {SafeAreaView, Platform, StatusBar} from "react-native";
import React from "react";
const Sample = () => {
return (
<SafeAreaView
style={{
paddingTop: Platform.OS === "android" ? StatusBar.currentHeight : 0,
position: "relative",
flex : 1
}}
>
<WebView
source={{
uri: "https://github.com/facebook/react-native",
}}
style={{ flex: 1 }}
></WebView>
</SafeAreaView>
);
};
export default Sample;

@ -17,6 +17,7 @@ const Header = ({ setFilterOptions, filterOptions, levels, productTypes }) => {
<Search
onChange={(val) => setFilterOptions({ ...filterOptions, search: val })}
placeholder={"نام کتاب یا دوره را جستجو کنید"}
value={filterOptions.search}
/>
<View
style={[tw("flex flex-1 flex-row justify-between items-center")]}

@ -208,6 +208,8 @@ const ProfileAddress = ({
paddingTop: Platform.OS === "android" ? StatusBar.currentHeight : 0,
position: "relative",
backgroundColor: "white",
flex : 1,
paddingBottom : 20
}}
>
<Navbar
@ -223,7 +225,7 @@ const ProfileAddress = ({
/>
<ScrollView
contentContainerStyle={styles.contentContainerStyle}
style={[styles.container, { minHeight: height - 200 }]}
style={[styles.container]}
onLayout={() => setHeight(Dimensions.get("window").height)}
>
<View style={tw("w-full mt-2 px-4")}>

@ -2764,6 +2764,11 @@ escape-html@~1.0.3:
resolved "https://registry.yarnpkg.com/escape-html/-/escape-html-1.0.3.tgz#0258eae4d3d0c0974de1c169188ef0051d1d1988"
integrity sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg=
escape-string-regexp@2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-2.0.0.tgz#a30304e99daa32e23b2fd20f51babd07cffca344"
integrity sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w==
escape-string-regexp@^1.0.5:
version "1.0.5"
resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4"
@ -2927,6 +2932,16 @@ expo-linear-gradient@~11.0.3:
resolved "https://registry.yarnpkg.com/expo-linear-gradient/-/expo-linear-gradient-11.0.3.tgz#bc559b9a251c9dc8aa37fb6c66c7a497fe92993c"
integrity sha512-LuzTM5+iEHCQfC2TBHAAI+ZjPvf0TvGiA7GYMsyTnakGA2r4JtsV8Ah/miQPKhfG06jLDOo4grUoSMGqbmSrEw==
expo-linking@~3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/expo-linking/-/expo-linking-3.0.0.tgz#67f06b0be4ac1da911c46535a704d24eca34e344"
integrity sha512-TgRB4JTdhMRo79rTu9E9zwzWyBUJxHpSbHFlv0ZfMAwU+qFCsL9zZsL44R/yj7xrvcLOjqbCVmBszLQ0pFOt1g==
dependencies:
expo-constants "~13.0.0"
invariant "^2.2.4"
qs "^6.9.1"
url-parse "^1.4.4"
expo-modules-autolinking@0.5.2:
version "0.5.2"
resolved "https://registry.yarnpkg.com/expo-modules-autolinking/-/expo-modules-autolinking-0.5.2.tgz#fb8812a88d6e22d014188c8252ea0c17c1ef4893"
@ -3521,7 +3536,7 @@ interpret@^1.0.0:
resolved "https://registry.yarnpkg.com/interpret/-/interpret-1.4.0.tgz#665ab8bc4da27a774a40584e812e3e0fa45b1a1e"
integrity sha512-agE4QfB2Lkp9uICn7BAqoscw4SZP9kTE2hxiFI3jBPmXJfdqiahTbUuKGsMoN2GtqL9AxhYioAcVvgsb1HvRbA==
invariant@^2.2.4:
invariant@2.2.4, invariant@^2.2.4:
version "2.2.4"
resolved "https://registry.yarnpkg.com/invariant/-/invariant-2.2.4.tgz#610f3c92c9359ce1db616e538008d23ff35158e6"
integrity sha512-phJfQVBuaJM5raOpJjSfkiD6BpbCE4Ns//LaXl6wGYtUBY83nWS6Rf9tXm2e8VaK60JEjYldbPif/A2B1C2gNA==
@ -4719,6 +4734,11 @@ object-copy@^0.1.0:
define-property "^0.2.5"
kind-of "^3.0.3"
object-inspect@^1.9.0:
version "1.12.0"
resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.12.0.tgz#6e2c120e868fd1fd18cb4f18c31741d0d6e776f0"
integrity sha512-Ho2z80bVIvJloH+YzRmpZVQe87+qASmBUKZDWgx9cu+KDrX2ZDH/3tMy+gXbZETVGs2M8YdxObOh7XAtim9Y0g==
object-keys@^1.0.12, object-keys@^1.1.1:
version "1.1.1"
resolved "https://registry.yarnpkg.com/object-keys/-/object-keys-1.1.1.tgz#1c47f272df277f3b1daf061677d9c82e2322c60e"
@ -5038,6 +5058,13 @@ pump@^3.0.0:
end-of-stream "^1.1.0"
once "^1.3.1"
qs@^6.9.1:
version "6.10.3"
resolved "https://registry.yarnpkg.com/qs/-/qs-6.10.3.tgz#d6cde1b2ffca87b5aa57889816c5f81535e22e8e"
integrity sha512-wr7M2E0OFRfIfJZjKGieI8lBKb7fRCH4Fv5KNPEs7gJ8jadvotdsS08PzOKR7opXhZ/Xkjtt3WF9g38drmyRqQ==
dependencies:
side-channel "^1.0.4"
query-string@^7.0.0:
version "7.0.1"
resolved "https://registry.yarnpkg.com/query-string/-/query-string-7.0.1.tgz#45bd149cf586aaa582dffc7ec7a8ad97dd02f75d"
@ -5201,6 +5228,14 @@ react-native-web@0.17.1:
normalize-css-color "^1.0.2"
prop-types "^15.6.0"
react-native-webview@11.15.0:
version "11.15.0"
resolved "https://registry.yarnpkg.com/react-native-webview/-/react-native-webview-11.15.0.tgz#b5aea9da579ca17fb9fd324e5202b1b5b8ce9fa8"
integrity sha512-0Wv+8qu8XuACx1xZwzc2Yfl+rOvxUouLcPxUKdkhaMVNpwoM5/ePpczCQZ3LpiRnSoEtjaUkfyQHbJQ+x4dDJQ==
dependencies:
escape-string-regexp "2.0.0"
invariant "2.2.4"
react-native@0.64.3:
version "0.64.3"
resolved "https://registry.yarnpkg.com/react-native/-/react-native-0.64.3.tgz#40db6385963b4b17325f9cc86dd19132394b03fc"
@ -5695,6 +5730,15 @@ shelljs@^0.8.4:
interpret "^1.0.0"
rechoir "^0.6.2"
side-channel@^1.0.4:
version "1.0.4"
resolved "https://registry.yarnpkg.com/side-channel/-/side-channel-1.0.4.tgz#efce5c8fdc104ee751b25c58d4290011fa5ea2cf"
integrity sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==
dependencies:
call-bind "^1.0.0"
get-intrinsic "^1.0.2"
object-inspect "^1.9.0"
signal-exit@^3.0.0, signal-exit@^3.0.2:
version "3.0.6"
resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.6.tgz#24e630c4b0f03fea446a2bd299e62b4a6ca8d0af"

Loading…
Cancel
Save