reza added something

master
Reza_ashrafi 2 years ago
parent c3a694d289
commit da3341e43b
  1. 4
      App.js
  2. 16
      src/redux/store.js
  3. 7
      src/screens/Activation/index.js
  4. 14
      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 AlertModal from "./src/components/AlertModal";
import { Provider } from "react-redux";
import buildStore from "./src/redux/store";
import { store, persistor } from "./src/redux/store";
import React from "react";
import { PersistGate } from "redux-persist/integration/react";
const { store, persistor } = buildStore();
console.log(persistor);
const App = () => {
let [fontsLoaded] = useFonts({

@ -55,13 +55,11 @@ const persistedReducer = persistReducer(
console.disableYellowBox = true;
export default () => {
let store = createStore(
persistedReducer,
initialState,
compose(applyMiddleware(...middleWare))
);
const persistor = persistStore(store);
export const store = createStore(
persistedReducer,
initialState,
compose(applyMiddleware(...middleWare))
);
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 { activation } from "../../redux/actions";
import { useSafeAreaInsets } from "react-native-safe-area-context";
import onInput from "../../utils/onInput";
//components
import TopHeader from "../../components/Header";
@ -113,7 +114,11 @@ function Activation({ add, mobile, theme, route }) {
},
]}
value={value || route?.params?.data}
onChange={(name, value) => setValue(value)}
onChangeText={(value) =>
setValue(
(value = onInput.englishAndNumberWithoutSpace(value))
)
}
/>
<CustomPressable
title={"تایید کد"}

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

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

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

@ -43,7 +43,7 @@ function MyBooks({ books, grades, theme }) {
style={[tw("py-3")]}
horizontal={true}
inverted={true}
data={books}
data={books?.filter((book) => book.condition >= 2)}
renderItem={({ item }) => (
<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 { asyncAwesomeAlert } from "../../utils/AsyncWrappers";
import { useNavigation } from "@react-navigation/native";
import {
View,
StyleSheet,
Dimensions,
ScrollView,
SafeAreaView,
Platform,
StatusBar,
LayoutAnimation,
BackHandler,
} from "react-native";
//components
@ -29,7 +26,6 @@ import tw from "tailwind-rn";
// Within your render function
const Home = ({ route, blogs, books, userProducts, mobile }) => {
const [position, setPosition] = useState("100%");
const navigation = useNavigation();
const setBoxPosition = () => {
LayoutAnimation.configureNext(LayoutAnimation.Presets.easeInEaseOut);
@ -40,7 +36,6 @@ const Home = ({ route, blogs, books, userProducts, mobile }) => {
<SafeAreaView
style={{
paddingTop: Platform.OS === "android" ? StatusBar.currentHeight : 0,
position: "relative",
flex: 1,
}}
>

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

Loading…
Cancel
Save