update 23 files

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

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

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

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

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

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

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

@ -169,8 +169,7 @@ const styles = StyleSheet.create({
paddingTop: 0, paddingTop: 0,
}, },
container: { container: {
paddingBottom: 0, paddingVertical: 0,
paddingTop: 64,
paddingHorizontal: 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 <Header
background={bgContact} background={bgContact}
title={"ارتباط با ما"} title={"ارتباط با ما"}

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

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

@ -1,7 +1,9 @@
import React, { useState } from "react"; import React, { useState } from "react";
import { connect } from "react-redux"; 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 { useNavigation } from "@react-navigation/native";
import { copilot, walkthroughable, CopilotStep } from "react-native-copilot";
import { import {
View, View,
@ -38,6 +40,9 @@ const Home = ({
getBooks, getBooks,
getUserProducts, getUserProducts,
bottomNavigation, bottomNavigation,
setFirstLogin,
firstLogin,
...props
}) => { }) => {
const navigation = useNavigation(); const navigation = useNavigation();
const [position, setPosition] = useState("100%"); const [position, setPosition] = useState("100%");
@ -47,6 +52,16 @@ const Home = ({
setPosition(position === "100%" ? "0%" : "100%"); 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(() => { React.useEffect(() => {
if (!blogs) { if (!blogs) {
getBlogs(); getBlogs();
@ -57,6 +72,8 @@ const Home = ({
if (!userProducts) { if (!userProducts) {
getUserProducts(); getUserProducts();
} }
getFirstLogin();
}, []); }, []);
return ( return (
@ -107,8 +124,7 @@ const styles = StyleSheet.create({
}, },
container: { container: {
flexDirection: "column", flexDirection: "column",
paddingBottom: 0, paddingVertical: 0,
paddingTop: 64,
paddingHorizontal: 0, paddingHorizontal: 0,
}, },
}); });
@ -119,12 +135,23 @@ const mapStateToProps = (state) => ({
userProducts: state.userProduct.list, userProducts: state.userProduct.list,
mobile: state.publicApi.isMobile, mobile: state.publicApi.isMobile,
bottomNavigation: state.config.bottomNavigation, bottomNavigation: state.config.bottomNavigation,
firstLogin: state.publicApi.firstLogin,
}); });
const mapDispatchToProps = { const mapDispatchToProps = {
getBlogs: blog.list, getBlogs: blog.list,
getBooks: book.list, getBooks: book.list,
getUserProducts: userProduct.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: { container: {
flexDirection: "column", flexDirection: "column",
paddingBottom: 0, paddingVertical: 0,
paddingHorizontal: 16, paddingHorizontal: 16,
paddingTop: 64,
}, },
}); });

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

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

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

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

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

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

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

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

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

Loading…
Cancel
Save