diff --git a/src/screens/AR/index.js b/src/screens/AR/index.js index f8d99bc..d4a4975 100644 --- a/src/screens/AR/index.js +++ b/src/screens/AR/index.js @@ -23,13 +23,24 @@ import tw from "tailwind-rn"; const { height } = Dimensions.get("window"); const ios = Platform.OS === "ios"; -function AR({ getArList, arList, mobile }) { +function AR({ getArList, arList, mobile, theme }) { const [position, setPosition] = useState("100%"); useEffect(() => { getArList(); + StatusBar.setBarStyle( + `${theme === "light" ? "dark" : "light"}-content`, + true + ); }, []); + useEffect(() => { + StatusBar.setBarStyle( + `${theme === "light" ? "dark" : "light"}-content`, + true + ); + }, [theme]); + const setBoxPosition = () => { LayoutAnimation.configureNext(LayoutAnimation.Presets.easeInEaseOut); setPosition(position === "100%" ? "0%" : "100%"); @@ -90,6 +101,7 @@ function AR({ getArList, arList, mobile }) { const mapStateToProps = (state) => ({ arList: state.publicApi.arList, mobile: state.publicApi.mobile, + theme: state.publicApi.theme }); const mapDispatchToProps = { diff --git a/src/screens/Activation/index.js b/src/screens/Activation/index.js index e2597d1..cf517f6 100644 --- a/src/screens/Activation/index.js +++ b/src/screens/Activation/index.js @@ -40,6 +40,13 @@ function Activation({ add, mobile, theme, route }) { const navigation = useNavigation(); const insets = useSafeAreaInsets(); + React.useEffect(() => { + StatusBar.setBarStyle( + `${theme === "light" ? "dark" : "light"}-content`, + true + ); + }, [theme]); + return ( { + StatusBar.setBarStyle( + `${theme === "light" ? "dark" : "light"}-content`, + true + ); + }, [theme]); + useEffect(() => { if (addressFields?.provinceId) { getCity({ diff --git a/src/screens/Blog/index.js b/src/screens/Blog/index.js index 4cc2243..24eee2d 100644 --- a/src/screens/Blog/index.js +++ b/src/screens/Blog/index.js @@ -51,6 +51,13 @@ export const Blog = ({ getInfo, blog, getList, blogs, route, theme }) => { } }, []); + useEffect(() => { + StatusBar.setBarStyle( + `${theme === "light" ? "dark" : "light"}-content`, + true + ); + }, [theme]); + return ( { fontFamily: "bold", fontSize: fontSize.base, textAlign: ios ? "right" : "auto", - marginBottom : 20, + marginBottom: 20, color: theme === "light" ? Colors.theme1.gray20 @@ -186,8 +193,8 @@ export const Blog = ({ getInfo, blog, getList, blogs, route, theme }) => { ? Colors.theme1.gray20 : Colors.theme1.grayF9, textAlign: "right", - fontFamily : 'light', - lineHeight: 25 + fontFamily: "light", + lineHeight: 25, }, strong: { color: @@ -195,10 +202,10 @@ export const Blog = ({ getInfo, blog, getList, blogs, route, theme }) => { ? Colors.theme1.gray20 : Colors.theme1.grayF9, textAlign: "right", - fontFamily : 'light', - lineHeight: 25 + fontFamily: "light", + lineHeight: 25, }, - ul : { + ul: { textAlign: "right", }, li: { @@ -207,8 +214,8 @@ export const Blog = ({ getInfo, blog, getList, blogs, route, theme }) => { ? Colors.theme1.gray20 : Colors.theme1.grayF9, textAlign: "right", - fontFamily : 'light', - lineHeight: 25 + fontFamily: "light", + lineHeight: 25, }, }} /> diff --git a/src/screens/Blogs/index.js b/src/screens/Blogs/index.js index 0100bf3..a2c9e76 100644 --- a/src/screens/Blogs/index.js +++ b/src/screens/Blogs/index.js @@ -10,12 +10,12 @@ import { Dimensions, Image, Text, - Pressable + Pressable, } from "react-native"; import { connect } from "react-redux"; import { blog } from "../../redux/actions"; -import {useNavigation} from "@react-navigation/native"; +import { useNavigation } from "@react-navigation/native"; //components import Navbar from "../../components/Navbar"; @@ -42,11 +42,18 @@ function Blogs({ getList, blogs, hashtag, setHashtag, theme }) { setHashtag(null); }, []); + useEffect(() => { + StatusBar.setBarStyle( + `${theme === "light" ? "dark" : "light"}-content`, + true + ); + }, [theme]); + const setBoxPosition = () => { LayoutAnimation.configureNext(LayoutAnimation.Presets.easeInEaseOut); setPosition(position === "100%" ? "0%" : "100%"); }; - + return ( { const mapStateToProps = (state) => ({ blogs: state.blog.list, hashtag: state.blog.hashtag, - theme : state.publicApi.theme + theme: state.publicApi.theme, }); const mapDispatchToProps = { diff --git a/src/screens/Contact/index.js b/src/screens/Contact/index.js index 3d08197..b78f86a 100644 --- a/src/screens/Contact/index.js +++ b/src/screens/Contact/index.js @@ -6,7 +6,7 @@ import { SafeAreaView, Platform, StatusBar, - Linking + Linking, } from "react-native"; import { connect } from "react-redux"; import { faq } from "../../redux/actions"; @@ -31,7 +31,14 @@ const { width, height } = Dimensions.get("window"); function Contact({ theme }) { const navigation = useNavigation(); - + + React.useEffect(() => { + StatusBar.setBarStyle( + `${theme === "light" ? "dark" : "light"}-content`, + true + ); + }, [theme]); + const info = React.useMemo(() => { return { onlineSupport: { @@ -39,45 +46,44 @@ function Contact({ theme }) { title: { text: "پشتیبانی آنلاین", color: "#D3B702" }, description: { text: "همکاران ما در قسمت فروش و پشتیبانی، پاسخگوی شما هستند هر سوالی در مورد کتاب‌های ما داشتید بپرسید", - color: theme === 'light' ? "#766600" : "#D3B702", + color: theme === "light" ? "#766600" : "#D3B702", }, link: { title: "ارتباط با بخش پشتیبانی", link: "/support", - color: theme === 'light' ? "#766600" : "#D3B702", + color: theme === "light" ? "#766600" : "#D3B702", }, bg: "#D3B70233", borderColor: "#D3B70255", - onPress : () => navigation.push("Tickets") + onPress: () => navigation.push("Tickets"), }, call: { icon: callIcon, title: { text: "شماره تماس", color: "#06A02A" }, description: { text: "در صورت هرگونه سوال شما می‌توانید در ساعات اداری 9 الی 17 با شماره 021۸۸۸۱۴۶۳۷ تماس حاصل فرمایید", - color: theme === 'light' ? "#025816" : "#06A02A", + color: theme === "light" ? "#025816" : "#06A02A", }, link: null, bg: "#69FF5F33", borderColor: "#69FF5F55", - onPress : () => Linking.openURL(`tel:02188814637`) - + onPress: () => Linking.openURL(`tel:02188814637`), }, address: { icon: addressIcon, title: { text: "نشانی", color: "#0EAD98" }, description: { text: "نشانی دفتر مرکزی: تهران میدان فردوسی خیابان عباس موسوی پلاک 30", - color: theme === 'light' ? "#066A5C" : "#0EAD98", + color: theme === "light" ? "#066A5C" : "#0EAD98", }, link: { title: "لیست نمایندگی‌های فروش", link: "/sell", - color: theme === 'light' ? "#0A7769" : "#0EAD98", + color: theme === "light" ? "#0A7769" : "#0EAD98", }, bg: "#0A776933", borderColor: "#0A776955", - onPress : () => {} + onPress: () => {}, }, }; }, [theme]); diff --git a/src/screens/Contact/layouts/TicketStatus.js b/src/screens/Contact/layouts/TicketStatus.js index bfd0c49..ac43c40 100644 --- a/src/screens/Contact/layouts/TicketStatus.js +++ b/src/screens/Contact/layouts/TicketStatus.js @@ -33,8 +33,6 @@ export const TicketStatus = ({ theme }) => { } }; - - }, [theme]); return ( { +const DeliveryForm = ({ + list, + form, + getList, + getFactorInfo, + userId, + payFactor, + factorInfo, + theme, +}) => { useEffect(() => { getFactorInfo({ userId }); getList(); }, []); + React.useEffect(() => { + StatusBar.setBarStyle( + `${theme === "light" ? "dark" : "light"}-content`, + true + ); + }, [theme]); + return ( factorInfo.transportId && factorInfo.userAddressId - ? payFactor({userId}) + ? payFactor({ userId }) : asyncAwesomeAlert("خطا", "آدرس یا نحوه ارسال را وارد کنید", { showCancelButton: false, - confirmText: "باشه" + confirmText: "باشه", }) } /> @@ -96,13 +112,13 @@ const mapStateToProps = (state) => ({ factorInfo: state.userFactor.info, userId: state.user.status?.id, list: state.userAddress.list, - theme: state.publicApi.theme + theme: state.publicApi.theme, }); const mapDispatchToProps = { getFactorInfo: userFactor.info, getList: userAddress.list, - payFactor : userFactor.payment + payFactor: userFactor.payment, }; export default connect(mapStateToProps, mapDispatchToProps)(DeliveryForm); diff --git a/src/screens/Faq/index.js b/src/screens/Faq/index.js index b97510b..03efb51 100644 --- a/src/screens/Faq/index.js +++ b/src/screens/Faq/index.js @@ -2,7 +2,6 @@ import React, { useEffect } from "react"; import { View, Dimensions, - ScrollView, SafeAreaView, Platform, StatusBar, @@ -27,13 +26,28 @@ import bgFaq from "./assets/faq.png"; const { width, height } = Dimensions.get("window"); -function Faq({ list, getFaq, searchResult, search, selectFaq, searchFaq, theme }) { +function Faq({ + list, + getFaq, + searchResult, + search, + selectFaq, + searchFaq, + theme, +}) { useEffect(() => { if (list.length === 0) { getFaq(); } }, [list]); + useEffect(() => { + StatusBar.setBarStyle( + `${theme === "light" ? "dark" : "light"}-content`, + true + ); + }, [theme]); + return list.length > 0 ? ( موردی یافت نشد. @@ -112,7 +126,7 @@ const mapStateToProps = (state) => ({ list: state.faq.list, searchResult: state.faq.searchResult, search: state.faq.search, - theme : state.publicApi.theme + theme: state.publicApi.theme, }); const mapDispatchToProps = { diff --git a/src/screens/Home/components/Videos.js b/src/screens/Home/components/Videos.js index c929ece..7d1230e 100644 --- a/src/screens/Home/components/Videos.js +++ b/src/screens/Home/components/Videos.js @@ -15,7 +15,7 @@ const ios = Platform.OS === "ios"; function Videos({ videos, grades, mobile, theme }) { return ( - +
diff --git a/src/screens/Home/index.js b/src/screens/Home/index.js index 6925975..8c10b80 100644 --- a/src/screens/Home/index.js +++ b/src/screens/Home/index.js @@ -10,6 +10,7 @@ import { Platform, StatusBar, LayoutAnimation, + Dimensions } from "react-native"; //components @@ -24,7 +25,8 @@ import Header from "./components/Header"; //style import tw from "tailwind-rn"; -// Within your render function +const {width, height} = Dimensions.get("window"); + const Home = ({ route, blogs, @@ -91,7 +93,7 @@ const styles = StyleSheet.create({ flex: 1, }, contentContainerStyle: { - // paddingBottom: 40, + paddingBottom: height / 10, // flex : 1, // alignItems: "", }, diff --git a/src/screens/Login/index.js b/src/screens/Login/index.js index dc4bf3b..2ff553a 100644 --- a/src/screens/Login/index.js +++ b/src/screens/Login/index.js @@ -10,6 +10,7 @@ import { Platform, KeyboardAvoidingView, ScrollView, + StatusBar } from "react-native"; import Svg, { Defs, Pattern, Image, Path } from "react-native-svg"; import onInput from "../../utils/onInput"; @@ -34,6 +35,13 @@ function Login(props) { const [phone, setPhone] = useState(""); const [loading, setLoading] = useState(false); + React.useEffect(() => { + StatusBar.setBarStyle( + `${theme === "light" ? "dark" : "light"}-content`, + true + ); + }, [props.theme]); + const onChangePhone = (name, value) => { setPhone(() => value); }; diff --git a/src/screens/OrderDetails/index.js b/src/screens/OrderDetails/index.js index 1927df5..a6ab5e6 100644 --- a/src/screens/OrderDetails/index.js +++ b/src/screens/OrderDetails/index.js @@ -46,6 +46,13 @@ function OrderDetails({ mobile, route, theme }) { const { order } = route.params; const [position, setPosition] = useState("100%"); + React.useEffect(() => { + StatusBar.setBarStyle( + `${theme === "light" ? "dark" : "light"}-content`, + true + ); + }, [theme]); + const setBoxPosition = () => { LayoutAnimation.configureNext(LayoutAnimation.Presets.easeInEaseOut); setPosition(position === "100%" ? "0%" : "100%"); @@ -244,7 +251,7 @@ function OrderDetails({ mobile, route, theme }) { backgroundColor: theme === "light" ? Colors.theme1.greenFF1 + "aa" : null, borderWidth: theme === "light" ? 0 : 1, - borderColor : Colors.theme1.greenFF1 + borderColor: Colors.theme1.greenFF1, }, ]} > diff --git a/src/screens/OrdersFollowUp/index.js b/src/screens/OrdersFollowUp/index.js index ee39e6d..725cd62 100644 --- a/src/screens/OrdersFollowUp/index.js +++ b/src/screens/OrdersFollowUp/index.js @@ -23,9 +23,16 @@ import b1Image from "./assets/b1.png"; const width = Dimensions.get("window").width; -function OrdersFollowUp({ orders, getList }) { +function OrdersFollowUp({ orders, getList, theme }) { const [position, setPosition] = useState("100%"); + React.useEffect(() => { + StatusBar.setBarStyle( + `${theme === "light" ? "dark" : "light"}-content`, + true + ); + }, [theme]); + const setBoxPosition = () => { LayoutAnimation.configureNext(LayoutAnimation.Presets.easeInEaseOut); setPosition(position === "100%" ? "0%" : "100%"); @@ -89,6 +96,7 @@ const styles = StyleSheet.create({ const mapStateToProps = (state) => ({ orders: state.userFactor.fullList, + theme: state.publicApi.theme, }); const mapDispatchToProps = { diff --git a/src/screens/Otp/index.js b/src/screens/Otp/index.js index 16afe8a..073aeae 100644 --- a/src/screens/Otp/index.js +++ b/src/screens/Otp/index.js @@ -9,6 +9,7 @@ import { KeyboardAvoidingView, ScrollView, Platform, + StatusBar } from "react-native"; import tw from "tailwind-rn"; import { connect } from "react-redux"; @@ -39,6 +40,13 @@ function Otp(props) { const [loading, setLoading] = useState(false); const [timeEnd, setTimeEnd] = useState(false); + React.useEffect(() => { + StatusBar.setBarStyle( + `${theme === "light" ? "dark" : "light"}-content`, + true + ); + }, [props.theme]); + const onChangeCode = (value, key) => { if (onInput.numberOnly(value) || value === "") { switch (key) { @@ -245,12 +253,15 @@ function Otp(props) { { fontSize: fontSize.xl5, fontFamily: "bold", - color: props.theme === 'light' ? Colors.theme1.green79 : Colors.theme1.white, + color: + props.theme === "light" + ? Colors.theme1.green79 + : Colors.theme1.white, width: fontSize.xl5 + 40, backgroundColor: props.theme === "light" ? Colors.theme1.grayE3 : null, - borderWidth : props.theme === "light" ? 0 : 1, - borderColor : Colors.theme1.grayE3 + 'aa' + borderWidth: props.theme === "light" ? 0 : 1, + borderColor: Colors.theme1.grayE3 + "aa", }, ]} underlineColorAndroid={"transparent"} @@ -268,12 +279,15 @@ function Otp(props) { { fontSize: fontSize.xl5, fontFamily: "bold", - color: props.theme === 'light' ? Colors.theme1.green79 : Colors.theme1.white, + color: + props.theme === "light" + ? Colors.theme1.green79 + : Colors.theme1.white, width: fontSize.xl5 + 40, backgroundColor: props.theme === "light" ? Colors.theme1.grayE3 : null, - borderWidth : props.theme === "light" ? 0 : 1, - borderColor : Colors.theme1.grayE3 + 'aa' + borderWidth: props.theme === "light" ? 0 : 1, + borderColor: Colors.theme1.grayE3 + "aa", }, ]} underlineColorAndroid={"transparent"} @@ -291,12 +305,15 @@ function Otp(props) { { fontSize: fontSize.xl5, fontFamily: "bold", - color: props.theme === 'light' ? Colors.theme1.green79 : Colors.theme1.white, + color: + props.theme === "light" + ? Colors.theme1.green79 + : Colors.theme1.white, width: fontSize.xl5 + 40, backgroundColor: props.theme === "light" ? Colors.theme1.grayE3 : null, - borderWidth : props.theme === "light" ? 0 : 1, - borderColor : Colors.theme1.grayE3 + 'aa' + borderWidth: props.theme === "light" ? 0 : 1, + borderColor: Colors.theme1.grayE3 + "aa", }, ]} underlineColorAndroid={"transparent"} @@ -314,12 +331,15 @@ function Otp(props) { { fontSize: fontSize.xl5, fontFamily: "bold", - color: props.theme === 'light' ? Colors.theme1.green79 : Colors.theme1.white, + color: + props.theme === "light" + ? Colors.theme1.green79 + : Colors.theme1.white, width: fontSize.xl5 + 40, backgroundColor: props.theme === "light" ? Colors.theme1.grayE3 : null, - borderWidth : props.theme === "light" ? 0 : 1, - borderColor : Colors.theme1.grayE3 + 'aa' + borderWidth: props.theme === "light" ? 0 : 1, + borderColor: Colors.theme1.grayE3 + "aa", }, ]} underlineColorAndroid={"transparent"} diff --git a/src/screens/Profile/components/Trophy.js b/src/screens/Profile/components/Trophy.js index 9f12062..77d3d52 100644 --- a/src/screens/Profile/components/Trophy.js +++ b/src/screens/Profile/components/Trophy.js @@ -2,7 +2,7 @@ import { View, Text, Platform, Pressable } from "react-native"; import React from "react"; import { connect } from "react-redux"; import Svg, { G, Path } from "react-native-svg"; -import {asyncAwesomeAlert} from "../../../utils/AsyncWrappers"; +import { asyncAwesomeAlert } from "../../../utils/AsyncWrappers"; //style import tw from "tailwind-rn"; @@ -15,11 +15,11 @@ const Trophy = ({ theme }) => { return ( @@ -68,7 +68,7 @@ const Trophy = ({ theme }) => { asyncAwesomeAlert("نتیجه", "این قابلیت در حال توسعه است.", { - confirmText : 'باشه', + confirmText: "باشه", showCancelButton: false, }) } diff --git a/src/screens/QR/index.js b/src/screens/QR/index.js index 488ddd9..bb76df4 100644 --- a/src/screens/QR/index.js +++ b/src/screens/QR/index.js @@ -9,7 +9,7 @@ import { import Scan from "./layouts/Scan"; const width = Dimensions.get("window").width; -function QR({ }) { +function QR({ route }) { return ( - + ); diff --git a/src/screens/QR/layouts/Scan/index.js b/src/screens/QR/layouts/Scan/index.js index 2fe2b7f..ac44b66 100644 --- a/src/screens/QR/layouts/Scan/index.js +++ b/src/screens/QR/layouts/Scan/index.js @@ -21,7 +21,7 @@ const { width, height } = Dimensions.get("screen"); //assets import laptopImage from "../../assets/laptop.png"; -function Scan({ theme, route }) { +function Scan({ theme, page }) { const navigation = useNavigation(); const [hasPermission, setHasPermission] = React.useState(null); const [scanned, setScanned] = React.useState(false); @@ -31,18 +31,21 @@ function Scan({ theme, route }) { const { status } = await BarCodeScanner.requestPermissionsAsync(); setHasPermission(status === "granted"); })(); + if (page === "book") { + navigation.push("QRContent", { data : "zist10-13" }); + } }, []); const handleBarCodeScanned = React.useCallback( ({ type, data }) => { setScanned(true); - if (route?.params?.page === "activation") { - navigation.push("QRContent", { data }); - } else { + if (page === "activation") { navigation.push("Activation", { data }); + } else { + navigation.push("QRContent", { data }); } }, - [route, scanned] + [page, scanned] ); return ( diff --git a/src/screens/QRContent/Content/Links.js b/src/screens/QRContent/Content/Links.js index b1b99de..cf0e91a 100644 --- a/src/screens/QRContent/Content/Links.js +++ b/src/screens/QRContent/Content/Links.js @@ -1,8 +1,14 @@ import React from "react"; import { View, Text, Image, Pressable, Dimensions } from "react-native"; -import tw from "tailwind-rn"; + +//assets import linkIcon from "../../../assets/icons/link.png"; +//styles +import tw from "tailwind-rn"; +import fontSize from "../../../constants/fontSize"; +import Colors from "../../../constants/Colors"; + const { width } = Dimensions.get("window"); export default function Links({ links }) { @@ -13,7 +19,14 @@ export default function Links({ links }) { )} > - + لینک ها {links.map((link, i) => ( diff --git a/src/screens/QRContent/Content/PDF.js b/src/screens/QRContent/Content/PDF.js index af70f59..99dfd56 100644 --- a/src/screens/QRContent/Content/PDF.js +++ b/src/screens/QRContent/Content/PDF.js @@ -1,8 +1,13 @@ import React from "react"; import { View, Text, Image, Dimensions, TouchableOpacity } from "react-native"; +import * as OpenAnything from "react-native-openanything"; + +//style +import fontSize from "../../../constants/fontSize"; +import Colors from "../../../constants/Colors"; import tw from "tailwind-rn"; -import * as OpenAnything from 'react-native-openanything'; +//assets import pdfIcon from "../../../assets/icons/pdf.png"; const { width } = Dimensions.get("window"); @@ -13,12 +18,20 @@ export default function PDF({ data }) { style={tw( "w-full flex-row-reverse justify-between items-center rounded-md bg-red-100 py-3 px-2 mt-5" )} - onPress={() => OpenAnything.Pdf(`https://dnvn.ir/api/v1/file/${data.fileIds}`)} + onPress={() => + OpenAnything.Pdf(`https://dnvn.ir/api/v1/file/${data.fileIds}`) + } > {data.name} diff --git a/src/screens/QRContent/Content/PPT.js b/src/screens/QRContent/Content/PPT.js index 03e2cae..aefb90c 100644 --- a/src/screens/QRContent/Content/PPT.js +++ b/src/screens/QRContent/Content/PPT.js @@ -1,6 +1,12 @@ import React from "react"; import { View, Text, Image, Dimensions } from "react-native"; + +//style import tw from "tailwind-rn"; +import fontSize from "../../../constants/fontSize"; +import Colors from "../../../constants/Colors"; + +//assets import pptIcon from "../../../assets/icons/ppt.png"; const { width } = Dimensions.get("window"); @@ -15,7 +21,12 @@ export default function PPT({ name, file }) { {name} diff --git a/src/screens/QRContent/Content/Video.js b/src/screens/QRContent/Content/Video.js index 4ce438a..3d31956 100644 --- a/src/screens/QRContent/Content/Video.js +++ b/src/screens/QRContent/Content/Video.js @@ -1,11 +1,15 @@ import React from "react"; import { View, Text, Dimensions } from "react-native"; -import tw from "tailwind-rn"; import { Video } from "expo-av"; -const {width} = Dimensions.get("window"); +//style +import fontSize from "../../../constants/fontSize"; +import Colors from "../../../constants/Colors"; +import tw from "tailwind-rn"; + +const { width } = Dimensions.get("window"); -export default function VideoContent({ data }) { +export default function VideoContent({ data, theme }) { const [status, setStatus] = React.useState({}); const video = React.useRef(null); return ( @@ -13,25 +17,30 @@ export default function VideoContent({ data }) { - {'موضوع:' + ' ' + data.name} + {"موضوع:" + " " + data.name} - + ); } diff --git a/src/screens/QRContent/Content/Voice.js b/src/screens/QRContent/Content/Voice.js index 71c11b9..5548606 100644 --- a/src/screens/QRContent/Content/Voice.js +++ b/src/screens/QRContent/Content/Voice.js @@ -1,8 +1,15 @@ import React from "react"; import { View, Text, Dimensions } from "react-native"; + +//style import tw from "tailwind-rn"; +import fontSize from "../../../constants/fontSize"; +import Colors from "../../../constants/Colors"; + +//components import MusicPlayer from "../../../components/MusicPlayer"; + const { width } = Dimensions.get("window"); export default function Voice({ data }) { @@ -11,7 +18,13 @@ export default function Voice({ data }) { {data.name} diff --git a/src/screens/QRContent/Content/index.js b/src/screens/QRContent/Content/index.js index 378746b..8cdcf8b 100644 --- a/src/screens/QRContent/Content/index.js +++ b/src/screens/QRContent/Content/index.js @@ -1,27 +1,35 @@ import React from "react"; import { View, Text, Image, Dimensions } from "react-native"; -import tw from "tailwind-rn"; import Tab from "../Tab"; + +//style +import tw from "tailwind-rn"; import Colors from "../../../constants/Colors"; +import fontSize from "../../../constants/fontSize"; -const { width} = Dimensions.get("window"); +const { height, width } = Dimensions.get("window"); -export default function Content({ data, grades }) { +export default function Content({ data, grades, theme }) { + const light = React.useMemo(() => { + return theme === 'light'; + },[theme]); return ( - + - + {data.book.name} @@ -31,20 +39,22 @@ export default function Content({ data, grades }) { tw("mt-1"), { fontFamily: "regular", - fontSize: width / 34, - color: Colors.theme1.light.blue5, + fontSize: fontSize.tiny, + color: light ? Colors.theme1.green79 : Colors.theme1.white, + textAlign: "right", }, ]} > - { 'پایه' + ' ' + grades[data.book.gradeId]} + {"پایه" + " " + grades[data.book.gradeId]} {`شما در حال مشاهده صفحه ${data.qr.pageNumber} هستید.`} @@ -54,12 +64,13 @@ export default function Content({ data, grades }) { obj.type === 'voice')[0], - video: data.qr.content.filter((obj) => obj.type === 'video')[0], - pdf: data.qr.content.filter((obj) => obj.type === 'pdf')[0], - ppt: data.qr.content.filter((obj) => obj.type === 'ppt')[0], - links: data.qr.content.filter((obj) => obj.type === 'links')[0], + voice: data.qr.content.filter((obj) => obj.type === "voice")[0], + video: data.qr.content.filter((obj) => obj.type === "video")[0], + pdf: data.qr.content.filter((obj) => obj.type === "pdf")[0], + ppt: data.qr.content.filter((obj) => obj.type === "ppt")[0], + links: data.qr.content.filter((obj) => obj.type === "links")[0], }} + theme={theme} /> ); diff --git a/src/screens/QRContent/Tab/index.js b/src/screens/QRContent/Tab/index.js index 3d117ae..00dbdc3 100644 --- a/src/screens/QRContent/Tab/index.js +++ b/src/screens/QRContent/Tab/index.js @@ -12,41 +12,52 @@ import Links from "../Content/Links"; //assets import tw from "tailwind-rn"; import Colors from "../../../constants/Colors"; +import fontSize from "../../../constants/fontSize"; const { width } = Dimensions.get("window"); function Tab({ data, theme }) { const [dataType, setDataType] = useState("all"); + const light = React.useMemo(() => { + return theme === "light"; + }, [theme]); + return ( - + setDataType("all")} style={[ tw("py-2 w-1/6"), { - borderBottomWidth: 1, - borderColor: - dataType === "all" - ? Colors.theme1.blue3 - : Colors.theme1.blue5, + borderBottomWidth: dataType === "all" ? 0 : 1, + borderColor: Colors.theme1.greenBA + "aa", backgroundColor: - dataType === "all" ? Colors.theme1.blue3 : "white", + dataType === "all" + ? Colors.theme1.greenCF + : light + ? Colors.theme1.white + : Colors.theme1.dark, }, ]} > تمامی محتوا @@ -57,22 +68,28 @@ function Tab({ data, theme }) { style={[ tw("py-2 w-1/6"), { - borderBottomWidth: 1, - borderColor: - dataType === "voice" - ? Colors.theme1.blue3 - : Colors.theme1.blue5, + borderBottomWidth: dataType === "voice" ? 0 : 1, + borderColor: Colors.theme1.greenBA + "aa", backgroundColor: - dataType === "voice" ? Colors.theme1.blue3 : "white", + dataType === "voice" + ? Colors.theme1.greenCF + : light + ? Colors.theme1.white + : Colors.theme1.dark, }, ]} > صوت @@ -84,21 +101,27 @@ function Tab({ data, theme }) { tw("py-2 w-1/6"), { borderBottomWidth: 1, - borderColor: - dataType === "video" - ? Colors.theme1.blue3 - : Colors.theme1.blue5, + borderColor: Colors.theme1.greenBA + "aa", backgroundColor: - dataType === "video" ? Colors.theme1.blue3 : "white", + dataType === "video" + ? Colors.theme1.greenCF + : light + ? Colors.theme1.white + : Colors.theme1.dark, }, ]} > ویدئو @@ -110,21 +133,27 @@ function Tab({ data, theme }) { tw("py-2 w-1/6"), { borderBottomWidth: 1, - borderColor: - dataType === "pdf" - ? Colors.theme1.blue3 - : Colors.theme1.blue5, + borderColor: Colors.theme1.greenBA + "aa", backgroundColor: - dataType === "pdf" ? Colors.theme1.blue3 : "white", + dataType === "pdf" + ? Colors.theme1.greenCF + : light + ? Colors.theme1.white + : Colors.theme1.dark, }, ]} > پی دی اف @@ -136,21 +165,27 @@ function Tab({ data, theme }) { tw("py-2 w-1/6"), { borderBottomWidth: 1, - borderColor: - dataType === "ppt" - ? Colors.theme1.blue3 - : Colors.theme1.blue5, + borderColor: Colors.theme1.greenBA + "aa", backgroundColor: - dataType === "ppt" ? Colors.theme1.blue3 : "white", + dataType === "ppt" + ? Colors.theme1.greenCF + : light + ? Colors.theme1.white + : Colors.theme1.dark, }, ]} > پاور پوینت @@ -162,21 +197,27 @@ function Tab({ data, theme }) { tw("py-2 w-1/6"), { borderBottomWidth: 1, - borderColor: - dataType === "links" - ? Colors.theme1.blue3 - : Colors.theme1.blue5, + borderColor: Colors.theme1.greenBA + "aa", backgroundColor: - dataType === "links" ? Colors.theme1.blue3 : "white", + dataType === "links" + ? Colors.theme1.greenCF + : light + ? Colors.theme1.white + : Colors.theme1.dark, }, ]} > لینک ها @@ -186,23 +227,24 @@ function Tab({ data, theme }) { {dataType === "all" ? ( <> - {data.voice ? : null} - {data.video ?