diff --git a/App.js b/App.js index e596c00..7c3e2f0 100644 --- a/App.js +++ b/App.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({ diff --git a/src/redux/store.js b/src/redux/store.js index ebcb78f..ba1edee 100644 --- a/src/redux/store.js +++ b/src/redux/store.js @@ -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 }; -}; diff --git a/src/screens/Activation/index.js b/src/screens/Activation/index.js index 80b604b..2ccd22e 100644 --- a/src/screens/Activation/index.js +++ b/src/screens/Activation/index.js @@ -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)) + ) + } /> - + val} /> } 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 }) => } keyExtractor={(item) => item.id} />
- + ); diff --git a/src/screens/DeliveryForm/index.js b/src/screens/DeliveryForm/index.js index e8f080e..e58784b 100644 --- a/src/screens/DeliveryForm/index.js +++ b/src/screens/DeliveryForm/index.js @@ -62,7 +62,7 @@ const DeliveryForm = ({ list, form, getList, getFactorInfo, userId, payFactor, f @@ -86,7 +87,6 @@ const styles = StyleSheet.create({ paddingBottom: 100, }, container: { - flexDirection: "column", paddingVertical: 5, paddingHorizontal: 16, }, diff --git a/src/screens/Home/components/MyBooks.js b/src/screens/Home/components/MyBooks.js index 173eb20..e1ec93a 100644 --- a/src/screens/Home/components/MyBooks.js +++ b/src/screens/Home/components/MyBooks.js @@ -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 }) => ( )} diff --git a/src/screens/Home/index.js b/src/screens/Home/index.js index e510d8c..f2e8bff 100644 --- a/src/screens/Home/index.js +++ b/src/screens/Home/index.js @@ -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 }) => { diff --git a/src/screens/Profile/index.js b/src/screens/Profile/index.js index 2dada0f..5455a83 100644 --- a/src/screens/Profile/index.js +++ b/src/screens/Profile/index.js @@ -72,7 +72,10 @@ function Profile({ mobile, theme, logout, loading }) { onPress={() => asyncAwesomeAlert("", "آیا قصد خروج از حساب کاربری فعلی رو داری؟", { showCancelButton: true, - onConfirm: () => logout(), + onConfirm: () => { + navigation.navigate("HomeTab", { screen: "Home" }); + logout(); + }, }) } >