some fixing

master
Reza_ashrafi 3 years ago
parent 6f57df14bd
commit 714e97b883
  1. 7
      App.js
  2. 9
      navigation/index.js
  3. 5
      src/components/Select.js
  4. 32
      src/redux/store.js
  5. 2
      src/screens/Address/index.js
  6. 101
      src/screens/Contact/index.js
  7. 6
      src/screens/Contact/layouts/Box.js
  8. 56
      src/screens/Product/components/Book.js
  9. 4
      src/screens/Product/components/Info.js
  10. 10
      src/screens/Video/index.js

@ -4,8 +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 store from "./src/redux/store";
import buildStore from "./src/redux/store";
import React from "react";
import { PersistGate } from "redux-persist/integration/react";
const { store, persistor } = buildStore();
const App = () => {
let [fontsLoaded] = useFonts({
@ -20,8 +23,10 @@ const App = () => {
}
return (
<Provider store={store}>
<PersistGate loading={null} persistor={persistor}>
<Navigation />
<AlertModal />
</PersistGate>
</Provider>
);
};

@ -111,7 +111,7 @@ const BottomTabNavigator = ({ theme }) => {
data-name="Vector"
d="M16.79 25.471v-6.693"
fill="none"
stroke="#fff"
stroke={theme === "light" ? "#fff" : Colors.theme1.dark}
strokeLinecap="round"
strokeLinejoin="round"
strokeWidth={1.5}
@ -179,7 +179,7 @@ const BottomTabNavigator = ({ theme }) => {
data-name="Vector"
d="M17.567 8.851v20.774M29.213 12.298h-3.294M29.159 16.643h-4.392"
fill="none"
stroke="#fff"
stroke={theme === "light" ? "#fff" : Colors.theme1.dark}
strokeLinecap="round"
strokeLinejoin="round"
strokeWidth={1.5}
@ -248,7 +248,7 @@ const BottomTabNavigator = ({ theme }) => {
data-name="Vector"
d="M12.427 14.995v-2.083c0-2.673 1.892-3.766 4.2-2.43l1.805 1.042 1.806 1.041c2.308 1.336 2.308 3.523 0 4.86l-1.806 1.041-1.805 1.046c-2.308 1.332-4.2.239-4.2-2.434v-2.083Z"
fill="none"
stroke="#fff"
stroke={theme === "light" ? "#fff" : Colors.theme1.dark}
strokeLinecap="round"
strokeLinejoin="round"
strokeWidth={1.5}
@ -313,6 +313,7 @@ const BottomTabNavigator = ({ theme }) => {
xmlns="http://www.w3.org/2000/svg"
width={31.017}
height={31.017}
style={{ transform: [{scale : 1.2}]}}
>
<G
fill={
@ -320,7 +321,7 @@ const BottomTabNavigator = ({ theme }) => {
? Colors.theme1.green79
: Colors.theme1.greenCF
}
stroke={"white"}
stroke={theme === 'light' ? "white" : Colors.theme1.dark}
strokeLinecap="round"
strokeLinejoin="round"
strokeWidth={1.5}

@ -31,6 +31,7 @@ function Select({
rowTextStyle={{
fontSize: fontSize.sm,
fontFamily: "regular",
color: theme === "light" ? Colors.theme1.gray20 : Colors.theme1.grayF9,
}}
defaultButtonText={defaultValue}
statusBarTranslucent={true}
@ -68,6 +69,10 @@ function Select({
/>
</Svg>
)}
dropdownStyle={{
backgroundColor:
theme === "light" ? Colors.theme1.white : Colors.theme1.gray2077,
}}
/>
);
}

@ -1,6 +1,5 @@
import AsyncStorage from "@react-native-async-storage/async-storage";
import { applyMiddleware, createStore, compose, combineReducers } from "redux";
import { createLogger } from "redux-logger";
import thunk from "redux-thunk";
import { persistStore, persistReducer } from "redux-persist";
import autoMergeLevel2 from "redux-persist/lib/stateReconciler/autoMergeLevel2";
@ -13,10 +12,10 @@ import faq from "./reducers/faq";
import file from "./reducers/file";
import userFactor from "./reducers/userFactor";
import userProduct from "./reducers/userProduct";
import qr from './reducers/qr';
import qr from "./reducers/qr";
import userAddress from "./reducers/userAddress";
import transport from "./reducers/transport"
import comment from './reducers/comment';
import transport from "./reducers/transport";
import comment from "./reducers/comment";
import form from "./reducers/form";
import userFavorite from "./reducers/userFavorite";
import vote from "./reducers/vote";
@ -32,13 +31,7 @@ const initialState = {};
const middleWare = [thunk];
// const loggerMiddleware = createLogger({
// predicate: () => process.env.NODE_ENV === "development",
// });
// middleWare.push(loggerMiddleware);
const store = createStore(
persistReducer(
const persistedReducer = persistReducer(
persistConfig,
combineReducers({
publicApi,
@ -56,16 +49,19 @@ const store = createStore(
comment,
form,
userFavorite,
vote
vote,
})
),
);
console.disableYellowBox = true;
export default () => {
let store = createStore(
persistedReducer,
initialState,
compose(applyMiddleware(...middleWare))
);
const persistor = persistStore(store);
console.disableYellowBox = true;
export default store;
return { store, persistor };
};

@ -271,7 +271,7 @@ const Address = ({
}}
/>
<ScrollView style={tw("flex-1 px-4")}>
<KeyboardAvoidingView behavior={"padding"}>
<KeyboardAvoidingView>
<TouchableWithoutFeedback>
<View style={tw("flex-1")}>
<Header

@ -9,6 +9,7 @@ import {
} from "react-native";
import { connect } from "react-redux";
import { faq } from "../../redux/actions";
import { useNavigation } from "@react-navigation/native";
//style
import tw from "tailwind-rn";
@ -27,7 +28,57 @@ import bgContact from "./assets/contact.png";
const { width, height } = Dimensions.get("window");
function Contact({ info, theme }) {
function Contact({ theme }) {
const navigation = useNavigation();
const info = React.useMemo(() => {
return {
onlineSupport: {
icon: onlineSupportIcon,
title: { text: "پشتیبانی آنلاین", color: "#D3B702" },
description: {
text: "همکاران ما در قسمت فروش و پشتیبانی، پاسخگوی شما هستند هر سوالی در مورد کتابهای ما داشتید بپرسید",
color: theme === 'light' ? "#766600" : "#D3B702",
},
link: {
title: "ارتباط با بخش پشتیبانی",
link: "/support",
color: theme === 'light' ? "#766600" : "#D3B702",
},
bg: "#D3B70233",
borderColor: "#D3B70255",
onPress : navigation.push("Tickets")
},
call: {
icon: callIcon,
title: { text: "شماره تماس", color: "#06A02A" },
description: {
text: "در صورت هرگونه سوال شما میتوانید در ساعات اداری 9 الی 17 با شماره 021۸۸۸۱۴۶۳۷ تماس حاصل فرمایید",
color: theme === 'light' ? "#025816" : "#06A02A",
},
link: null,
bg: "#69FF5F33",
borderColor: "#69FF5F55",
onPress : () => {}
},
address: {
icon: addressIcon,
title: { text: "نشانی", color: "#0EAD98" },
description: {
text: "نشانی دفتر مرکزی: تهران میدان فردوسی خیابان عباس موسوی پلاک 30",
color: theme === 'light' ? "#066A5C" : "#0EAD98",
},
link: {
title: "لیست نمایندگیهای فروش",
link: "/sell",
color: theme === 'light' ? "#0A7769" : "#0EAD98",
},
bg: "#0A776933",
borderColor: "#0A776955",
onPress : () => {}
},
};
}, [theme]);
return (
<SafeAreaView
style={{
@ -62,55 +113,9 @@ function Contact({ info, theme }) {
}
const mapStateToProps = (state) => ({
theme: state.publicApi.theme
theme: state.publicApi.theme,
});
const mapDispatchToProps = {};
export default connect(mapStateToProps, mapDispatchToProps)(Contact);
Contact.defaultProps = {
info: {
onlineSupport: {
icon: onlineSupportIcon,
title: { text: "پشتیبانی آنلاین", color: "#D3B702" },
description: {
text: "همکاران ما در قسمت فروش و پشتیبانی، پاسخگوی شما هستند هر سوالی در مورد کتابهای ما داشتید بپرسید",
color: "#766600",
},
link: {
title: "ارتباط با بخش پشتیبانی",
link: "/support",
color: "#766600",
},
bg: "#D3B70233",
borderColor: "#D3B70255",
},
call: {
icon: callIcon,
title: { text: "شماره تماس", color: "#06A02A" },
description: {
text: "در صورت هرگونه سوال شما میتوانید در ساعات اداری 9 الی 17 با شماره 021۸۸۸۱۴۶۳۷ تماس حاصل فرمایید",
color: "#025816",
},
link: null,
bg: "#69FF5F33",
borderColor: "#69FF5F55",
},
address: {
icon: addressIcon,
title: { text: "نشانی", color: "#0EAD98" },
description: {
text: "نشانی دفتر مرکزی: تهران میدان فردوسی خیابان عباس موسوی پلاک 30",
color: "#066A5C",
},
link: {
title: "لیست نمایندگیهای فروش",
link: "/sell",
color: "#0A7769",
},
bg: "#0A776933",
borderColor: "#0A776955",
},
},
};

@ -8,7 +8,6 @@ import {
} from "react-native";
import React from "react";
import { connect } from "react-redux";
import { useNavigation } from "@react-navigation/native";
//style
import tw from "tailwind-rn";
@ -18,9 +17,6 @@ const ios = Platform.OS === "ios";
const { height, width } = Dimensions.get("window");
const Box = ({ info, mobile }) => {
const navigation = useNavigation();
const refRBSheet = React.useRef();
return (
<TouchableOpacity
style={[
@ -35,7 +31,7 @@ const Box = ({ info, mobile }) => {
borderWidth: 1,
},
]}
onPress={() => navigation.push("Tickets")}
onPress={() => info.onPress()}
>
<Image
source={info.icon}

@ -88,8 +88,8 @@ function Book({
asyncAwesomeAlert("", "به سبد خرید اضافه شد", {
showCancelButton: true,
onConfirm: () =>
navigation.navigate("ShoppingCartTab", {
screen: "ShoppingCart",
navigation.navigate("Root", {
screen: "ShoppingCartTab",
}),
confirmText: "مشاهده سبد خرید",
cancelText: "ادامه خرید",
@ -98,8 +98,8 @@ function Book({
asyncAwesomeAlert("", "به سبد خرید اضافه شد", {
showCancelButton: true,
onConfirm: () =>
navigation.navigate("ShoppingCartTab", {
screen: "ShoppingCart",
navigation.navigate("Root", {
screen: "ShoppingCartTab",
}),
confirmText: "مشاهده سبد خرید",
cancelText: "ادامه خرید",
@ -108,8 +108,8 @@ function Book({
asyncAwesomeAlert("", "به سبد خرید اضافه شد", {
showCancelButton: true,
onConfirm: () =>
navigation.navigate("ShoppingCartTab", {
screen: "ShoppingCart",
navigation.navigate("Root", {
screen: "ShoppingCartTab",
}),
confirmText: "مشاهده سبد خرید",
cancelText: "ادامه خرید",
@ -123,21 +123,6 @@ function Book({
return (
<ScrollView style={[tw("flex flex-1 relative")]}>
{!mobile ? <View style={tw("mt-5")}></View> : null}
{!book ? (
<View
style={[
tw("absolute left-0 top-0 rounded-md overflow-hidden"),
{
width: Dimensions.get("window").width,
height: height - 110,
zIndex: 1,
backgroundColor: Colors.theme1.white + "60",
},
]}
>
<Blur />
</View>
) : null}
{imageSlider ? <ImageSlider /> : null}
<View style={[tw("flex flex-row-reverse")]}>
<Image
@ -170,7 +155,7 @@ function Book({
textAlign: ios ? "right" : "auto",
}}
>
{book?.name}
{book?.name || ""}
</Text>
<Text
style={{
@ -182,7 +167,7 @@ function Book({
fontFamily: "regular",
}}
>
{"پایه" + " " + grades[book?.gradeId]}
{"پایه" + " " + (grades[book?.gradeId] || " ")}
</Text>
</View>
<Text
@ -191,7 +176,7 @@ function Book({
{ color: "#323232", fontSize: fontSize.sm, fontFamily: "light" },
]}
>
{book?.text}
{book?.text || " "}
</Text>
</View>
</View>
@ -209,7 +194,7 @@ function Book({
}}
>
{" "}
{book?.pagesNum + "\n" + "صفحه"}
{(book?.pagesNum || " ") + "\n" + "صفحه"}
</Text>
</View>
<View
@ -291,7 +276,10 @@ function Book({
"این محصول قبلا به سبد خرید شما اضافه شده است.",
{
showCancelButton: true,
onConfirm: () => navigation.push("ShoppingCart"),
onConfirm: () =>
navigation.navigate("Root", {
screen: "ShoppingCartTab",
}),
confirmText: "مشاهده سبد خرید",
cancelText: "باشه",
}
@ -338,7 +326,7 @@ function Book({
},
]}
>
{separate(book?.product[1]?.price) + " " + "تومان"}
{(separate(book?.product[1]?.price) || " ") + " " + "تومان"}
</Text>
</View>
</View>
@ -363,7 +351,10 @@ function Book({
"این محصول قبلا به سبد خرید شما اضافه شده است.",
{
showCancelButton: true,
onConfirm: () => navigation.push("ShoppingCart"),
onConfirm: () =>
navigation.navigate("Root", {
screen: "ShoppingCartTab",
}),
confirmText: "مشاهده سبد خرید",
cancelText: "باشه",
}
@ -410,7 +401,7 @@ function Book({
},
]}
>
{separate(book?.product[0]?.price) + " " + "تومان"}
{(separate(book?.product[0]?.price) || " ") + " " + "تومان"}
</Text>
</View>
</>
@ -463,7 +454,10 @@ function Book({
"این محصول قبلا به سبد خرید شما اضافه شده است.",
{
showCancelButton: true,
onConfirm: () => navigation.push("ShoppingCart"),
onConfirm: () =>
navigation.navigate("Root", {
screen: "ShoppingCartTab",
}),
confirmText: "مشاهده سبد خرید",
cancelText: "باشه",
}
@ -509,7 +503,7 @@ function Book({
},
]}
>
{separate(book?.product[2]?.price) + " " + "تومان"}
{(separate(book?.product[2]?.price) || " ") + " " + "تومان"}
</Text>
</View>
</>

@ -178,7 +178,7 @@ const ProductReviews = ({ list, mobile, theme }) => {
style={[
{
fontSize: mobile ? fontSize.tiny : fontSize.lg,
color: Colors.theme1.green79,
color: theme === 'light' ? Colors.theme1.green79 : Colors.theme1.white,
fontFamily: "bold",
},
]}
@ -190,7 +190,7 @@ const ProductReviews = ({ list, mobile, theme }) => {
style={{
fontSize: mobile ? fontSize.tiny : fontSize.base,
fontFamily: "light",
color: "#275077",
color: theme === 'light' ? "#275077" : Colors.theme1.white,
lineHeight: 25,
textAlign: ios ? "right" : "auto",
}}

@ -76,7 +76,10 @@ function Product({
setAddedFlag(false);
asyncAwesomeAlert("", "به سبد خرید اضافه شد", {
showCancelButton: false,
onConfirm: () => navigation.push("ShoppingCart"),
onConfirm: () =>
navigation.navigate("Root", {
screen: "ShoppingCartTab",
}),
confirmText: "مشاهده سبد خرید",
});
}
@ -182,7 +185,10 @@ function Product({
"این محصول قبلا به سبد خرید شما اضافه شده است.",
{
showCancelButton: true,
onConfirm: () => navigation.push("ShoppingCart"),
onConfirm: () =>
navigation.navigate("Root", {
screen: "ShoppingCartTab",
}),
confirmText: "مشاهده سبد خرید",
cancelText: "ادامه خرید",
}

Loading…
Cancel
Save