update 23 files

master
Reza_ashrafi 2 years ago
parent 6ef747e088
commit 5ef4fd15d5
  1. 90
      src/components/Navbar.js
  2. 6
      src/redux/actions/public.js
  3. 3
      src/redux/reducers/public.js
  4. 1
      src/screens/AR/index.js
  5. 2
      src/screens/Activation/index.js
  6. 2
      src/screens/Address/index.js
  7. 3
      src/screens/Blog/index.js
  8. 3
      src/screens/Blogs/index.js
  9. 2
      src/screens/Contact/index.js
  10. 3
      src/screens/DeliveryForm/index.js
  11. 2
      src/screens/Faq/index.js
  12. 35
      src/screens/Home/index.js
  13. 3
      src/screens/OrderDetails/index.js
  14. 3
      src/screens/OrdersFollowUp/index.js
  15. 3
      src/screens/Product/index.js
  16. 2
      src/screens/Products/components/Header.js
  17. 3
      src/screens/Profile/index.js
  18. 11
      src/screens/QRContent/index.js
  19. 3
      src/screens/ShoppingCart/index.js
  20. 3
      src/screens/Video/index.js
  21. 3
      src/screens/VideoDisplay/index.js
  22. 3
      src/screens/Videos/index.js

@ -35,6 +35,7 @@ import tw from "tailwind-rn";
import fontSize from "../constants/fontSize";
const CopilotView = walkthroughable(View);
const CopilotPressable = walkthroughable(Pressable);
const Navbar = ({
notification,
@ -49,11 +50,7 @@ const Navbar = ({
}) => {
const navigation = useNavigation();
React.useEffect(() => {
setTimeout(() => {
props.start();
}, 800);
}, []);
React.useEffect(() => {}, []);
const isActiveBookmark = React.useMemo(() => {
return userFavoriteList.filter((object) =>
@ -126,34 +123,45 @@ const Navbar = ({
</Text>
) : null}
{headerOptions?.hamburgerMenu ? (
<Pressable style={tw("relative mr-4")} onPress={() => setBoxPosition()}>
<Svg
xmlns="http://www.w3.org/2000/svg"
width={31.567}
height={29.996}
<CopilotStep
order={3}
name="منو"
text="با زدن بر روی این بخش لیستی از خدمات ما را مشاهده خواهید کرد."
>
<CopilotPressable
style={tw("relative mr-4")}
onPress={() => setBoxPosition()}
>
<G
fill="none"
stroke={
theme === "light" ? Colors.theme1.green79 : Colors.theme1.white
}
strokeLinecap="round"
strokeLinejoin="round"
strokeWidth={2}
<Svg
xmlns="http://www.w3.org/2000/svg"
width={31.567}
height={29.996}
>
<Path d="M1 1h29.567" />
<Path
data-name="Vector"
d="M1 9.999h29.567M1 18.998h29.567M1 27.996h29.567"
/>
</G>
</Svg>
{notification ? (
<View
style={tw("h-2.5 w-2.5 absolute -left-1 -top-1 rounded-full")}
></View>
) : null}
</Pressable>
<G
fill="none"
stroke={
theme === "light"
? Colors.theme1.green79
: Colors.theme1.white
}
strokeLinecap="round"
strokeLinejoin="round"
strokeWidth={2}
>
<Path d="M1 1h29.567" />
<Path
data-name="Vector"
d="M1 9.999h29.567M1 18.998h29.567M1 27.996h29.567"
/>
</G>
</Svg>
{notification ? (
<View
style={tw("h-2.5 w-2.5 absolute -left-1 -top-1 rounded-full")}
></View>
) : null}
</CopilotPressable>
</CopilotStep>
) : null}
{headerOptions?.logo ? (
@ -754,22 +762,4 @@ const mapDispatchToProps = {
deleteBookmark: userFavorite.del,
};
const component = copilot({
labels: {
previous: "قبلی",
next: "بعدی",
skip: "رد کردن",
finish: "پایان",
},
tooltipStyle : {
fontFamily : 'regular',
fontSize : 40,
},
textStyle : {
fontFamily : 'regular',
fontSize : 40
}
})(Navbar);
export default connect(mapStateToProps, mapDispatchToProps)(component);
export default connect(mapStateToProps, mapDispatchToProps)(Navbar);

@ -1,7 +1,9 @@
import proxy from "../proxy";
const publicApi = {
setOffline : (data) => async (dispatch) =>
await dispatch({ type: "public/setOffline", data }),
setFirstLogin: (data) => async (dispatch) =>
await dispatch({ type: "public/setFirstLogin", data }),
setOffline: (data) => async (dispatch) =>
await dispatch({ type: "public/setOffline", data }),
setOrientation: (data) => async (dispatch) =>
await dispatch({ type: "public/setOrientation", data }),
setLTR: (data) => async (dispatch) =>

@ -6,6 +6,7 @@ const { width, height } = Dimensions.get("window");
const initialState = {
ltr: false,
theme: null,
firstLogin: false,
mobile: width < 720,
orientation: height > width ? "portrait" : "landscape",
homeData: [],
@ -80,6 +81,8 @@ const grades = [
const publicApi = (state = initialState, action) => {
let { type, data } = action;
switch (type) {
case "public/setFirstLogin":
return { ...state, firstLogin: data, error: null, loading: false };
case "public/setOffline":
return { ...state, offline: data, error: null, loading: false };
case "public/setOrientation":

@ -72,7 +72,6 @@ function AR({ getUserProducts, userProducts, mobile, theme }) {
style={{
paddingHorizontal: 16,
height: height,
paddingTop: 64
}}
contentContainerStyle={{ paddingBottom: 100 }}
>

@ -73,7 +73,7 @@ function Activation({ add, mobile, theme, route, orientation }) {
backgroundColor: Colors.theme1.greenCF + "0F",
}}
/>
<View style={[tw("flex w-full"), { paddingTop: 64 }]}>
<View style={[tw("flex w-full")]}>
<TopHeader
background={bgQr}
title={"فعالسازی کتاب دیجیتال"}

@ -392,7 +392,7 @@ const Address = ({
back: true,
}}
/>
<ScrollView style={[tw("flex-1 px-4"), { paddingTop: 64 }]}>
<ScrollView style={[tw("flex-1 px-4")]}>
<KeyboardAvoidingView>
<TouchableWithoutFeedback>
<View style={tw("flex-1")}>

@ -305,8 +305,7 @@ const styles = StyleSheet.create({
paddingBottom: 40,
},
container: {
paddingTop: 64,
paddingBottom: 0,
paddingVertical: 0,
paddingHorizontal: 0,
},
font: {

@ -169,8 +169,7 @@ const styles = StyleSheet.create({
paddingTop: 0,
},
container: {
paddingBottom: 0,
paddingTop: 64,
paddingVertical: 0,
paddingHorizontal: 0,
},
});

@ -107,7 +107,7 @@ function Contact({ theme }) {
}}
/>
<ScrollView style={[tw("flex pb-20 px-4 mb-4"), { paddingTop: 64 }]}>
<ScrollView style={[tw("flex pb-20 px-4 mb-4")]}>
<Header
background={bgContact}
title={"ارتباط با ما"}

@ -113,8 +113,7 @@ const styles = StyleSheet.create({
paddingBottom: 100,
},
container: {
paddingBottom: 5,
paddingTop: 64
paddingVertical: 5,
},
});

@ -67,7 +67,7 @@ function Faq({
backgroundColor: Colors.theme1.greenCF + "0F",
}}
/>
<View style={{ paddingTop: 64 }}>
<View>
<Header
background={bgFaq}
title={"پرسشهای متداول"}

@ -1,7 +1,9 @@
import React, { useState } from "react";
import { connect } from "react-redux";
import { blog, book, user, userProduct } from "../../redux/actions";
import { blog, book, user, userProduct, publicApi } from "../../redux/actions";
import AsyncStorage from "@react-native-async-storage/async-storage";
import { useNavigation } from "@react-navigation/native";
import { copilot, walkthroughable, CopilotStep } from "react-native-copilot";
import {
View,
@ -38,6 +40,9 @@ const Home = ({
getBooks,
getUserProducts,
bottomNavigation,
setFirstLogin,
firstLogin,
...props
}) => {
const navigation = useNavigation();
const [position, setPosition] = useState("100%");
@ -47,6 +52,16 @@ const Home = ({
setPosition(position === "100%" ? "0%" : "100%");
};
const getFirstLogin = React.useCallback(async () => {
const firstLoginFlag = await AsyncStorage.getItem("firstLogin");
if (!firstLoginFlag) {
AsyncStorage.setItem('firstLogin', JSON.stringify(true));
setTimeout(() => {
props.start();
}, 800);
}
}, [firstLogin]);
React.useEffect(() => {
if (!blogs) {
getBlogs();
@ -57,6 +72,8 @@ const Home = ({
if (!userProducts) {
getUserProducts();
}
getFirstLogin();
}, []);
return (
@ -107,8 +124,7 @@ const styles = StyleSheet.create({
},
container: {
flexDirection: "column",
paddingBottom: 0,
paddingTop: 64,
paddingVertical: 0,
paddingHorizontal: 0,
},
});
@ -119,12 +135,23 @@ const mapStateToProps = (state) => ({
userProducts: state.userProduct.list,
mobile: state.publicApi.isMobile,
bottomNavigation: state.config.bottomNavigation,
firstLogin: state.publicApi.firstLogin,
});
const mapDispatchToProps = {
getBlogs: blog.list,
getBooks: book.list,
getUserProducts: userProduct.list,
setFirstLogin: publicApi.setFirstLogin,
};
export default connect(mapStateToProps, mapDispatchToProps)(Home);
const component = copilot({
labels: {
previous: "قبلی",
next: "بعدی",
skip: "رد کردن",
finish: "پایان",
},
})(Home);
export default connect(mapStateToProps, mapDispatchToProps)(component);

@ -491,9 +491,8 @@ const styles = StyleSheet.create({
},
container: {
flexDirection: "column",
paddingBottom: 0,
paddingVertical: 0,
paddingHorizontal: 16,
paddingTop: 64,
},
});

@ -89,8 +89,7 @@ const styles = StyleSheet.create({
},
container: {
flexDirection: "column",
paddingBottom: 0,
paddingTop: 64,
paddingVertical: 0,
paddingHorizontal: 16,
},
});

@ -57,8 +57,7 @@ const styles = StyleSheet.create({
},
container: {
flexDirection: "column",
paddingBottom: 5,
paddingTop: 64,
paddingVertical: 5,
paddingHorizontal: 16,
},
});

@ -12,7 +12,7 @@ import Select from "../../../components/Select";
const Header = ({ setFilterOptions, filterOptions, levels, productTypes }) => {
return (
<View style={tw("flex mt-14 px-4 h-32")}>
<View style={tw("flex px-4 h-32")}>
<Search
onChange={(val) => setFilterOptions({ ...filterOptions, search: val })}
placeholder={"نام کتاب یا دوره را جستجو کنید"}

@ -149,8 +149,7 @@ const styles = StyleSheet.create({
},
container: {
flexDirection: "column",
paddingBottom: 5,
paddingTop: 64,
paddingVertical: 5,
paddingHorizontal: 16,
},
});

@ -12,9 +12,9 @@ import Content from "./Content";
import Navbar from "../../components/Navbar";
//style
import tw from 'tailwind-rn';
import tw from "tailwind-rn";
const {height} = Dimensions.get("window");
const { height } = Dimensions.get("window");
function QRContent({ route, getQrData, data, grades, theme }) {
useEffect(() => {
@ -39,10 +39,7 @@ function QRContent({ route, getQrData, data, grades, theme }) {
back: true,
}}
/>
<ScrollView
style={tw('pt-14')}
>
<ScrollView>
{data ? <Content data={data} grades={grades} theme={theme} /> : null}
</ScrollView>
</SafeAreaView>
@ -51,7 +48,7 @@ function QRContent({ route, getQrData, data, grades, theme }) {
const mapStateToProps = (state) => ({
data: state.qr.list,
grades : state.publicApi.grades,
grades: state.publicApi.grades,
theme: state.publicApi.theme,
});

@ -340,8 +340,7 @@ const styles = StyleSheet.create({
},
container: {
flexDirection: "column",
paddingBottom: 5,
paddingTop: 64,
paddingVertical: 5,
paddingHorizontal: 16,
},
});

@ -220,8 +220,7 @@ const styles = StyleSheet.create({
paddingBottom: 100,
},
container: {
paddingBottom: 5,
paddingTop: 64,
paddingVertical: 5,
paddingHorizontal: 16,
},
});

@ -129,8 +129,7 @@ const styles = StyleSheet.create({
paddingBottom: 100,
},
container: {
paddingBottom: 5,
paddingTop: 64,
paddingVertical: 5,
paddingHorizontal: 16,
},
});

@ -92,8 +92,7 @@ const styles = StyleSheet.create({
},
container: {
flexDirection: "column",
paddingBottom: 0,
paddingTop: 64,
paddingVertical: 0,
paddingHorizontal: 16,
},
});

Loading…
Cancel
Save