reza added something

master
Reza_ashrafi 3 years ago
parent c3a694d289
commit da3341e43b
  1. 4
      App.js
  2. 10
      src/redux/store.js
  3. 7
      src/screens/Activation/index.js
  4. 12
      src/screens/Address/index.js
  5. 6
      src/screens/Blogs/index.js
  6. 4
      src/screens/DeliveryForm/index.js
  7. 2
      src/screens/Home/components/MyBooks.js
  8. 7
      src/screens/Home/index.js
  9. 5
      src/screens/Profile/index.js

@ -4,11 +4,11 @@ import AppLoading from "expo-app-loading";
import Navigation from "./navigation/index"; import Navigation from "./navigation/index";
import AlertModal from "./src/components/AlertModal"; import AlertModal from "./src/components/AlertModal";
import { Provider } from "react-redux"; import { Provider } from "react-redux";
import buildStore from "./src/redux/store"; import { store, persistor } from "./src/redux/store";
import React from "react"; import React from "react";
import { PersistGate } from "redux-persist/integration/react"; import { PersistGate } from "redux-persist/integration/react";
const { store, persistor } = buildStore(); console.log(persistor);
const App = () => { const App = () => {
let [fontsLoaded] = useFonts({ let [fontsLoaded] = useFonts({

@ -55,13 +55,11 @@ const persistedReducer = persistReducer(
console.disableYellowBox = true; console.disableYellowBox = true;
export default () => { export const store = createStore(
let store = createStore(
persistedReducer, persistedReducer,
initialState, initialState,
compose(applyMiddleware(...middleWare)) compose(applyMiddleware(...middleWare))
); );
const persistor = persistStore(store);
export const persistor = persistStore(store);
return { store, persistor };
};

@ -15,6 +15,7 @@ import { useNavigation } from "@react-navigation/native";
import Svg, { Image as Imagee } from "react-native-svg"; import Svg, { Image as Imagee } from "react-native-svg";
import { activation } from "../../redux/actions"; import { activation } from "../../redux/actions";
import { useSafeAreaInsets } from "react-native-safe-area-context"; import { useSafeAreaInsets } from "react-native-safe-area-context";
import onInput from "../../utils/onInput";
//components //components
import TopHeader from "../../components/Header"; import TopHeader from "../../components/Header";
@ -113,7 +114,11 @@ function Activation({ add, mobile, theme, route }) {
}, },
]} ]}
value={value || route?.params?.data} value={value || route?.params?.data}
onChange={(name, value) => setValue(value)} onChangeText={(value) =>
setValue(
(value = onInput.englishAndNumberWithoutSpace(value))
)
}
/> />
<CustomPressable <CustomPressable
title={"تایید کد"} title={"تایید کد"}

@ -280,7 +280,7 @@ const Address = ({
/> />
<MapSelector /> <MapSelector />
<CustomTextInput <CustomTextInput
label="نام" label={profilePage ? "نام" : "نام تحویل گیرنده"}
placeholder="" placeholder=""
textAlign="right" textAlign="right"
name="firstName" name="firstName"
@ -299,7 +299,9 @@ const Address = ({
regex={(val) => val} regex={(val) => val}
/> />
<CustomTextInput <CustomTextInput
label="نام خانوادگی" label={
profilePage ? "نام خانوادگی" : "نام خانوادگی تحویل گیرنده"
}
placeholder="" placeholder=""
textAlign="right" textAlign="right"
name="lastName" name="lastName"
@ -339,7 +341,9 @@ const Address = ({
/> />
<CustomTextInput <CustomTextInput
keyboardType="numeric" keyboardType="numeric"
label="شماره موبایل" label={
profilePage ? "شماره موبایل" : "شماره موبایل تحویل گیرنده"
}
placeholder="" placeholder=""
textAlign="left" textAlign="left"
name="cellphone" name="cellphone"
@ -359,7 +363,7 @@ const Address = ({
/> />
<CustomTextInput <CustomTextInput
keyboardType="numeric" keyboardType="numeric"
label="شماره تلفن" label={profilePage ? "شماره تلفن" : "شماره تلفن تحویل گیرنده"}
placeholder="" placeholder=""
textAlign="left" textAlign="left"
name="phone" name="phone"

@ -68,7 +68,7 @@ function Blogs({ getList, blogs }) {
horizontal={true} horizontal={true}
inverted={true} inverted={true}
style={[tw("flex flex-row mt-3 pb-3")]} style={[tw("flex flex-row mt-3 pb-3")]}
data={blogs} data={blogs.slice(0, 7)}
renderItem={({ item }) => <New blog={item} />} renderItem={({ item }) => <New blog={item} />}
keyExtractor={(item) => item.id} keyExtractor={(item) => item.id}
/> />
@ -78,12 +78,12 @@ function Blogs({ getList, blogs }) {
horizontal={true} horizontal={true}
inverted={true} inverted={true}
style={[tw("flex flex-row mt-3 pb-3")]} style={[tw("flex flex-row mt-3 pb-3")]}
data={blogs} data={blogs.slice(0, 7)}
renderItem={({ item }) => <New blog={item} />} renderItem={({ item }) => <New blog={item} />}
keyExtractor={(item) => item.id} keyExtractor={(item) => item.id}
/> />
<Header title={"از دنیای آموزش"} /> <Header title={"از دنیای آموزش"} />
<Target blogs={blogs.slice(0,3)} /> <Target blogs={blogs.slice(0, 3)} />
</ScrollView> </ScrollView>
</SafeAreaView> </SafeAreaView>
); );

@ -62,7 +62,7 @@ const DeliveryForm = ({ list, form, getList, getFactorInfo, userId, payFactor, f
<TransportDate transportDate={form.transportDate} /> <TransportDate transportDate={form.transportDate} />
</View> </View>
<CustomPressable <CustomPressable
title={"ادامه فرایند خرید"} title={"پرداخت"}
backgroundColor={Colors.theme1.greenCF} backgroundColor={Colors.theme1.greenCF}
color={"white"} color={"white"}
border={{ color: "#196EC0", width: 0 }} border={{ color: "#196EC0", width: 0 }}
@ -72,6 +72,7 @@ const DeliveryForm = ({ list, form, getList, getFactorInfo, userId, payFactor, f
? payFactor({userId}) ? payFactor({userId})
: asyncAwesomeAlert("خطا", "آدرس یا نحوه ارسال را وارد کنید", { : asyncAwesomeAlert("خطا", "آدرس یا نحوه ارسال را وارد کنید", {
showCancelButton: false, showCancelButton: false,
confirmText: "باشه"
}) })
} }
/> />
@ -86,7 +87,6 @@ const styles = StyleSheet.create({
paddingBottom: 100, paddingBottom: 100,
}, },
container: { container: {
flexDirection: "column",
paddingVertical: 5, paddingVertical: 5,
paddingHorizontal: 16, paddingHorizontal: 16,
}, },

@ -43,7 +43,7 @@ function MyBooks({ books, grades, theme }) {
style={[tw("py-3")]} style={[tw("py-3")]}
horizontal={true} horizontal={true}
inverted={true} inverted={true}
data={books} data={books?.filter((book) => book.condition >= 2)}
renderItem={({ item }) => ( renderItem={({ item }) => (
<Book book={item} grades={grades} theme={theme} /> <Book book={item} grades={grades} theme={theme} />
)} )}

@ -1,17 +1,14 @@
import React, { useState, useEffect } from "react"; import React, { useState } from "react";
import { connect } from "react-redux"; import { connect } from "react-redux";
import { asyncAwesomeAlert } from "../../utils/AsyncWrappers";
import { useNavigation } from "@react-navigation/native"; import { useNavigation } from "@react-navigation/native";
import { import {
View, View,
StyleSheet, StyleSheet,
Dimensions,
ScrollView, ScrollView,
SafeAreaView, SafeAreaView,
Platform, Platform,
StatusBar, StatusBar,
LayoutAnimation, LayoutAnimation,
BackHandler,
} from "react-native"; } from "react-native";
//components //components
@ -29,7 +26,6 @@ import tw from "tailwind-rn";
// Within your render function // Within your render function
const Home = ({ route, blogs, books, userProducts, mobile }) => { const Home = ({ route, blogs, books, userProducts, mobile }) => {
const [position, setPosition] = useState("100%"); const [position, setPosition] = useState("100%");
const navigation = useNavigation();
const setBoxPosition = () => { const setBoxPosition = () => {
LayoutAnimation.configureNext(LayoutAnimation.Presets.easeInEaseOut); LayoutAnimation.configureNext(LayoutAnimation.Presets.easeInEaseOut);
@ -40,7 +36,6 @@ const Home = ({ route, blogs, books, userProducts, mobile }) => {
<SafeAreaView <SafeAreaView
style={{ style={{
paddingTop: Platform.OS === "android" ? StatusBar.currentHeight : 0, paddingTop: Platform.OS === "android" ? StatusBar.currentHeight : 0,
position: "relative",
flex: 1, flex: 1,
}} }}
> >

@ -72,7 +72,10 @@ function Profile({ mobile, theme, logout, loading }) {
onPress={() => onPress={() =>
asyncAwesomeAlert("", "آیا قصد خروج از حساب کاربری فعلی رو داری؟", { asyncAwesomeAlert("", "آیا قصد خروج از حساب کاربری فعلی رو داری؟", {
showCancelButton: true, showCancelButton: true,
onConfirm: () => logout(), onConfirm: () => {
navigation.navigate("HomeTab", { screen: "Home" });
logout();
},
}) })
} }
> >

Loading…
Cancel
Save