From 5ef4fd15d57ca66b53a5df96c3168cc160061cf1 Mon Sep 17 00:00:00 2001 From: Reza_ashrafi Date: Wed, 25 May 2022 13:50:07 +0430 Subject: [PATCH] update 23 files --- src/components/Navbar.js | 90 ++++++++++------------- src/redux/actions/public.js | 6 +- src/redux/reducers/public.js | 3 + src/screens/AR/index.js | 1 - src/screens/Activation/index.js | 2 +- src/screens/Address/index.js | 2 +- src/screens/Blog/index.js | 3 +- src/screens/Blogs/index.js | 3 +- src/screens/Contact/index.js | 2 +- src/screens/DeliveryForm/index.js | 3 +- src/screens/Faq/index.js | 2 +- src/screens/Home/index.js | 35 ++++++++- src/screens/OrderDetails/index.js | 3 +- src/screens/OrdersFollowUp/index.js | 3 +- src/screens/Product/index.js | 3 +- src/screens/Products/components/Header.js | 2 +- src/screens/Profile/index.js | 3 +- src/screens/QRContent/index.js | 11 +-- src/screens/ShoppingCart/index.js | 3 +- src/screens/Video/index.js | 3 +- src/screens/VideoDisplay/index.js | 3 +- src/screens/Videos/index.js | 3 +- 22 files changed, 98 insertions(+), 91 deletions(-) diff --git a/src/components/Navbar.js b/src/components/Navbar.js index 59cac18..a3d4cef 100644 --- a/src/components/Navbar.js +++ b/src/components/Navbar.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 = ({ ) : null} {headerOptions?.hamburgerMenu ? ( - setBoxPosition()}> - + setBoxPosition()} > - - - - - - {notification ? ( - - ) : null} - + + + + + + {notification ? ( + + ) : null} + + ) : 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); diff --git a/src/redux/actions/public.js b/src/redux/actions/public.js index aa98eb9..a4dfb23 100644 --- a/src/redux/actions/public.js +++ b/src/redux/actions/public.js @@ -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) => diff --git a/src/redux/reducers/public.js b/src/redux/reducers/public.js index 84be686..0887067 100644 --- a/src/redux/reducers/public.js +++ b/src/redux/reducers/public.js @@ -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": diff --git a/src/screens/AR/index.js b/src/screens/AR/index.js index 14fa834..2456698 100644 --- a/src/screens/AR/index.js +++ b/src/screens/AR/index.js @@ -72,7 +72,6 @@ function AR({ getUserProducts, userProducts, mobile, theme }) { style={{ paddingHorizontal: 16, height: height, - paddingTop: 64 }} contentContainerStyle={{ paddingBottom: 100 }} > diff --git a/src/screens/Activation/index.js b/src/screens/Activation/index.js index 892df12..412d824 100644 --- a/src/screens/Activation/index.js +++ b/src/screens/Activation/index.js @@ -73,7 +73,7 @@ function Activation({ add, mobile, theme, route, orientation }) { backgroundColor: Colors.theme1.greenCF + "0F", }} /> - + - + diff --git a/src/screens/Blog/index.js b/src/screens/Blog/index.js index 4e82d90..d26ab42 100644 --- a/src/screens/Blog/index.js +++ b/src/screens/Blog/index.js @@ -305,8 +305,7 @@ const styles = StyleSheet.create({ paddingBottom: 40, }, container: { - paddingTop: 64, - paddingBottom: 0, + paddingVertical: 0, paddingHorizontal: 0, }, font: { diff --git a/src/screens/Blogs/index.js b/src/screens/Blogs/index.js index 71e627a..4b77d10 100644 --- a/src/screens/Blogs/index.js +++ b/src/screens/Blogs/index.js @@ -169,8 +169,7 @@ const styles = StyleSheet.create({ paddingTop: 0, }, container: { - paddingBottom: 0, - paddingTop: 64, + paddingVertical: 0, paddingHorizontal: 0, }, }); diff --git a/src/screens/Contact/index.js b/src/screens/Contact/index.js index 0381379..a072303 100644 --- a/src/screens/Contact/index.js +++ b/src/screens/Contact/index.js @@ -107,7 +107,7 @@ function Contact({ theme }) { }} /> - +
- +
{ 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); diff --git a/src/screens/OrderDetails/index.js b/src/screens/OrderDetails/index.js index dcd7e76..de10d7d 100644 --- a/src/screens/OrderDetails/index.js +++ b/src/screens/OrderDetails/index.js @@ -491,9 +491,8 @@ const styles = StyleSheet.create({ }, container: { flexDirection: "column", - paddingBottom: 0, + paddingVertical: 0, paddingHorizontal: 16, - paddingTop: 64, }, }); diff --git a/src/screens/OrdersFollowUp/index.js b/src/screens/OrdersFollowUp/index.js index b16937a..66fb16b 100644 --- a/src/screens/OrdersFollowUp/index.js +++ b/src/screens/OrdersFollowUp/index.js @@ -89,8 +89,7 @@ const styles = StyleSheet.create({ }, container: { flexDirection: "column", - paddingBottom: 0, - paddingTop: 64, + paddingVertical: 0, paddingHorizontal: 16, }, }); diff --git a/src/screens/Product/index.js b/src/screens/Product/index.js index f172799..bb21f72 100644 --- a/src/screens/Product/index.js +++ b/src/screens/Product/index.js @@ -57,8 +57,7 @@ const styles = StyleSheet.create({ }, container: { flexDirection: "column", - paddingBottom: 5, - paddingTop: 64, + paddingVertical: 5, paddingHorizontal: 16, }, }); diff --git a/src/screens/Products/components/Header.js b/src/screens/Products/components/Header.js index cae7fb9..b1d5f91 100644 --- a/src/screens/Products/components/Header.js +++ b/src/screens/Products/components/Header.js @@ -12,7 +12,7 @@ import Select from "../../../components/Select"; const Header = ({ setFilterOptions, filterOptions, levels, productTypes }) => { return ( - + setFilterOptions({ ...filterOptions, search: val })} placeholder={"نام کتاب یا دوره را جستجو کنید"} diff --git a/src/screens/Profile/index.js b/src/screens/Profile/index.js index 39844f6..b2e42bd 100644 --- a/src/screens/Profile/index.js +++ b/src/screens/Profile/index.js @@ -149,8 +149,7 @@ const styles = StyleSheet.create({ }, container: { flexDirection: "column", - paddingBottom: 5, - paddingTop: 64, + paddingVertical: 5, paddingHorizontal: 16, }, }); diff --git a/src/screens/QRContent/index.js b/src/screens/QRContent/index.js index 65d19b3..f914f2f 100644 --- a/src/screens/QRContent/index.js +++ b/src/screens/QRContent/index.js @@ -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, }} /> - + {data ? : null} @@ -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, }); diff --git a/src/screens/ShoppingCart/index.js b/src/screens/ShoppingCart/index.js index 941c60d..f8db8c8 100644 --- a/src/screens/ShoppingCart/index.js +++ b/src/screens/ShoppingCart/index.js @@ -340,8 +340,7 @@ const styles = StyleSheet.create({ }, container: { flexDirection: "column", - paddingBottom: 5, - paddingTop: 64, + paddingVertical: 5, paddingHorizontal: 16, }, }); diff --git a/src/screens/Video/index.js b/src/screens/Video/index.js index fac5e78..ae0faec 100644 --- a/src/screens/Video/index.js +++ b/src/screens/Video/index.js @@ -220,8 +220,7 @@ const styles = StyleSheet.create({ paddingBottom: 100, }, container: { - paddingBottom: 5, - paddingTop: 64, + paddingVertical: 5, paddingHorizontal: 16, }, }); diff --git a/src/screens/VideoDisplay/index.js b/src/screens/VideoDisplay/index.js index add80f0..783f274 100644 --- a/src/screens/VideoDisplay/index.js +++ b/src/screens/VideoDisplay/index.js @@ -129,8 +129,7 @@ const styles = StyleSheet.create({ paddingBottom: 100, }, container: { - paddingBottom: 5, - paddingTop: 64, + paddingVertical: 5, paddingHorizontal: 16, }, }); diff --git a/src/screens/Videos/index.js b/src/screens/Videos/index.js index 49231e5..026b8cb 100644 --- a/src/screens/Videos/index.js +++ b/src/screens/Videos/index.js @@ -92,8 +92,7 @@ const styles = StyleSheet.create({ }, container: { flexDirection: "column", - paddingBottom: 0, - paddingTop: 64, + paddingVertical: 0, paddingHorizontal: 16, }, });