reza fixed soemthing

master
Reza_ashrafi 3 years ago
parent e9ab15b696
commit 7505ab4ee0
  1. 14
      src/screens/AR/index.js
  2. 7
      src/screens/Activation/index.js
  3. 7
      src/screens/Address/index.js
  4. 23
      src/screens/Blog/index.js
  5. 13
      src/screens/Blogs/index.js
  6. 26
      src/screens/Contact/index.js
  7. 2
      src/screens/Contact/layouts/TicketStatus.js
  8. 26
      src/screens/DeliveryForm/index.js
  9. 22
      src/screens/Faq/index.js
  10. 2
      src/screens/Home/components/Videos.js
  11. 6
      src/screens/Home/index.js
  12. 8
      src/screens/Login/index.js
  13. 9
      src/screens/OrderDetails/index.js
  14. 10
      src/screens/OrdersFollowUp/index.js
  15. 44
      src/screens/Otp/index.js
  16. 8
      src/screens/Profile/components/Trophy.js
  17. 4
      src/screens/QR/index.js
  18. 13
      src/screens/QR/layouts/Scan/index.js
  19. 17
      src/screens/QRContent/Content/Links.js
  20. 19
      src/screens/QRContent/Content/PDF.js
  21. 13
      src/screens/QRContent/Content/PPT.js
  22. 19
      src/screens/QRContent/Content/Video.js
  23. 15
      src/screens/QRContent/Content/Voice.js
  24. 47
      src/screens/QRContent/Content/index.js
  25. 180
      src/screens/QRContent/Tab/index.js
  26. 17
      src/screens/QRContent/index.js
  27. 31
      src/screens/Splash/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 = {

@ -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 (
<SafeAreaView
style={[

@ -90,6 +90,13 @@ const Address = ({
});
}, []);
useEffect(() => {
StatusBar.setBarStyle(
`${theme === "light" ? "dark" : "light"}-content`,
true
);
}, [theme]);
useEffect(() => {
if (addressFields?.provinceId) {
getCity({

@ -51,6 +51,13 @@ export const Blog = ({ getInfo, blog, getList, blogs, route, theme }) => {
}
}, []);
useEffect(() => {
StatusBar.setBarStyle(
`${theme === "light" ? "dark" : "light"}-content`,
true
);
}, [theme]);
return (
<SafeAreaView
style={{
@ -160,7 +167,7 @@ export const Blog = ({ getInfo, blog, getList, blogs, route, theme }) => {
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,
},
}}
/>

@ -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,6 +42,13 @@ 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%");
@ -146,7 +153,7 @@ const HashtagBlog = ({ blog, theme }) => {
const mapStateToProps = (state) => ({
blogs: state.blog.list,
hashtag: state.blog.hashtag,
theme : state.publicApi.theme
theme: state.publicApi.theme,
});
const mapDispatchToProps = {

@ -6,7 +6,7 @@ import {
SafeAreaView,
Platform,
StatusBar,
Linking
Linking,
} from "react-native";
import { connect } from "react-redux";
import { faq } from "../../redux/actions";
@ -32,6 +32,13 @@ 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]);

@ -33,8 +33,6 @@ export const TicketStatus = ({ theme }) => {
}
};
}, [theme]);
return (
<SafeAreaView

@ -23,12 +23,28 @@ import CustomPressable from "../../components/Pressable";
import tw from "tailwind-rn";
import Colors from "../../constants/Colors";
const DeliveryForm = ({ list, form, getList, getFactorInfo, userId, payFactor, factorInfo, theme }) => {
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 (
<SafeAreaView
style={{
@ -69,10 +85,10 @@ const DeliveryForm = ({ list, form, getList, getFactorInfo, userId, payFactor, f
width={"100%"}
onPress={() =>
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);

@ -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 ? (
<SafeAreaView
style={{
@ -84,7 +98,7 @@ function Faq({ list, getFaq, searchResult, search, selectFaq, searchFaq, theme }
<Text
style={[
tw("w-full px-4 mt-10 text-center"),
{ fontFamily: "bold", color : Colors.theme1.gray20 + '77' },
{ fontFamily: "bold", color: Colors.theme1.gray20 + "77" },
]}
>
موردی یافت نشد.
@ -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 = {

@ -15,7 +15,7 @@ const ios = Platform.OS === "ios";
function Videos({ videos, grades, mobile, theme }) {
return (
<View style={[tw("w-full mb-5")]}>
<View style={[tw("w-full mb-0")]}>
<View style={[tw("w-full flex rounded-md pt-2 overflow-hidden")]}>
<View style={tw("flex px-4")}>
<Header title="دورههای ویدئویی شما" route={"VOD"} />

@ -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: "",
},

@ -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);
};

@ -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,
},
]}
>

@ -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 = {

@ -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"}

@ -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 (
<View
style={[
tw(`w-full flex py-3 px-3 justify-between flex-row-reverse`),
tw(`w-full flex py-3 px-3 justify-between flex-row-reverse mt-4`),
{
backgroundColor: theme === "light" ? Colors.theme1.yellow2 : null,
borderWidth: theme === "light" ? 0 : 1,
borderColor: Colors.theme1.yellow2,
borderColor: Colors.theme1.yellow2 + (theme === "light" ? "" : "77"),
},
]}
>
@ -68,7 +68,7 @@ const Trophy = ({ theme }) => {
<Pressable
onPress={() =>
asyncAwesomeAlert("نتیجه", "این قابلیت در حال توسعه است.", {
confirmText : 'باشه',
confirmText: "باشه",
showCancelButton: false,
})
}

@ -9,7 +9,7 @@ import {
import Scan from "./layouts/Scan";
const width = Dimensions.get("window").width;
function QR({ }) {
function QR({ route }) {
return (
<SafeAreaView
style={{
@ -20,7 +20,7 @@ function QR({ }) {
contentContainerStyle={styles.contentContainerStyle}
style={styles.container}
>
<Scan />
<Scan page={route?.params?.page} />
</ScrollView>
</SafeAreaView>
);

@ -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 (

@ -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 }) {
)}
>
<View style={tw("flex items-end")}>
<Text style={{ fontSize: width / 31, fontFamily: "bold" }}>
<Text
style={{
fontSize: fontSize.tiny,
fontFamily: "bold",
color:
theme === "light" ? Colors.theme1.gray2077 : Colors.theme1.white,
}}
>
لینک ها
</Text>
{links.map((link, i) => (

@ -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}`)
}
>
<Text
style={[
tw("text-right text-red-900"),
{ fontSize: width / 34, fontFamily: "regular" },
{
fontSize: fontSize.tiny,
fontFamily: "bold",
color:
theme === "light" ? Colors.theme1.gray2077 : Colors.theme1.white,
},
,
]}
>
{data.name}

@ -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 }) {
<Text
style={[
tw("text-right text-green-900"),
{ fontSize: width / 34, fontFamily: "regular" },
{
fontSize: fontSize.tiny,
fontFamily: "bold",
color:
theme === "light" ? Colors.theme1.gray2077 : Colors.theme1.white,
},
]}
>
{name}

@ -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,10 +17,15 @@ export default function VideoContent({ data }) {
<Text
style={[
tw("w-full text-right text-green-900 mb-4"),
{ fontSize: width / 34, fontFamily: "bold" },
{
fontSize: fontSize.tiny,
fontFamily: "bold",
color:
theme === "light" ? Colors.theme1.gray2077 : Colors.theme1.white,
},
]}
>
{'موضوع:' + ' ' + data.name}
{"موضوع:" + " " + data.name}
</Text>
<View style={tw("flex ")}>
<Video

@ -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 }) {
<Text
style={[
tw("w-full text-right text-xs text-green-900"),
{ fontSize: width / 34, fontFamily: "regular" },
{
fontSize: fontSize.tiny,
fontFamily: "bold",
color:
theme === "light" ? Colors.theme1.gray2077 : Colors.theme1.white,
},
,
]}
>
{data.name}

@ -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 (
<View style={tw("flex-1 flex px-4 pb-20")}>
<View style={tw("flex flex-1 ")}>
<View style={tw("flex w-full flex-row-reverse justify-between")}>
<View style={tw("flex flex-row-reverse")}>
<View style={tw("flex flex-row-reverse flex-1")}>
<Image
source={{ uri: "https://dnvn.ir/api/v1/file/2105" }}
style={[{ width: 80, height: 120 }, tw("rounded-md")]}
style={[{ height: height / 4.5, flex: 1 }, tw("rounded-md")]}
resizeMode="contain"
/>
<View style={tw("flex items-end mr-3")}>
<View style={tw("flex pr-2")}>
<Text
style={{
fontFamily: "bold",
fontSize: width / 27,
color: Colors.theme1.light.blue6,
fontSize: fontSize.lg,
color: light ? Colors.theme1.green79 : Colors.theme1.white,
textAlign: "right",
}}
>
{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]}
</Text>
<Text
style={[
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",
},
]}
>{`شما در حال مشاهده صفحه ${data.qr.pageNumber} هستید.`}</Text>
@ -54,12 +64,13 @@ export default function Content({ data, grades }) {
</View>
<Tab
data={{
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],
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}
/>
</View>
);

@ -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 (
<View
style={[
tw("w-full flex rounded-md overflow-hidden mt-4"),
{ borderWidth: 1, borderColor: Colors.theme1.blue5 },
{ borderWidth: 1, borderColor: Colors.theme1.greenBA + "aa" },
]}
>
<View style={tw("w-full flex flex-row-reverse justify-between px-0.5")}>
<View style={tw("w-full flex flex-row-reverse justify-between")}>
<TouchableOpacity
onPress={() => 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,
},
]}
>
<Text
style={{
fontSize: width / 38,
fontFamily: dataType === "all" ? "bold" : "light",
fontSize: fontSize.xs,
fontFamily: dataType === "all" ? "regular" : "light",
textAlign: "center",
color: Colors.theme1.blue5,
color:
dataType === "all"
? Colors.theme1.white
: light
? Colors.theme1.gray20
: Colors.theme1.white,
}}
>
تمامی محتوا
@ -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,
},
]}
>
<Text
style={{
fontSize: width / 38,
fontSize: fontSize.xs,
fontFamily: dataType === "voice" ? "bold" : "light",
textAlign: "center",
color: Colors.theme1.blue5,
color:
dataType === "voice"
? Colors.theme1.white
: light
? Colors.theme1.gray20
: Colors.theme1.white,
}}
>
صوت
@ -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,
},
]}
>
<Text
style={{
fontSize: width / 38,
fontSize: fontSize.xs,
fontFamily: dataType === "video" ? "bold" : "light",
textAlign: "center",
color: Colors.theme1.blue5,
color:
dataType === "video"
? Colors.theme1.white
: light
? Colors.theme1.gray20
: Colors.theme1.white,
}}
>
ویدئو
@ -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,
},
]}
>
<Text
style={{
fontSize: width / 38,
fontSize: fontSize.xs,
fontFamily: dataType === "pdf" ? "bold" : "light",
textAlign: "center",
color: Colors.theme1.blue5,
color:
dataType === "pdf"
? Colors.theme1.white
: light
? Colors.theme1.gray20
: Colors.theme1.white,
}}
>
پی دی اف
@ -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,
},
]}
>
<Text
style={{
fontSize: width / 38,
fontSize: fontSize.xs,
fontFamily: dataType === "ppt" ? "bold" : "light",
textAlign: "center",
color: Colors.theme1.blue5,
color:
dataType === "ppt"
? Colors.theme1.white
: light
? Colors.theme1.gray20
: Colors.theme1.white,
}}
>
پاور پوینت
@ -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,
},
]}
>
<Text
style={{
fontSize: width / 38,
fontSize: fontSize.xs,
fontFamily: dataType === "links" ? "bold" : "light",
textAlign: "center",
color: Colors.theme1.blue5,
color:
dataType === "links"
? Colors.theme1.white
: light
? Colors.theme1.gray20
: Colors.theme1.white,
}}
>
لینک ها
@ -186,23 +227,24 @@ function Tab({ data, theme }) {
<View style={tw("flex w-full p-4")}>
{dataType === "all" ? (
<>
{data.voice ? <Voice data={data.voice} /> : null}
{data.video ? <Video data={data.video} /> : null}
{data.ppt ? <PPT data={data.ppt} /> : null}
{data.pdf ? <PDF data={data.pdf} /> : null}
{data.links ? <Links data={data.links} /> : null}
{data.voice ? <Voice data={data.voice} theme={theme} /> : null}
{data.video ? <Video data={data.video} theme={theme} /> : null}
{data.ppt ? <PPT data={data.ppt} theme={theme} /> : null}
{data.pdf ? <PDF data={data.pdf} theme={theme} /> : null}
{data.links ? <Links data={data.links} theme={theme} /> : null}
</>
) : null}
{dataType === "voice" ? (
<>
{data.voice ? (
<Voice data={data.voice} />
<Voice data={data.voice} theme={theme} />
) : (
<Text
style={{
fontSize: width / 31,
color: "#707070",
fontSize: fontSize.tiny,
color: light ? Colors.theme1.gray2077 : Colors.theme1.white,
fontFamily: "light",
textAlign: "right",
}}
>
فایل صدا یافت نشد.
@ -213,13 +255,14 @@ function Tab({ data, theme }) {
{dataType === "video" ? (
<>
{data.video ? (
<Video data={data.video} />
<Video data={data.video} theme={theme} />
) : (
<Text
style={{
fontSize: width / 31,
color: "#707070",
fontSize: fontSize.tiny,
color: light ? Colors.theme1.gray2077 : Colors.theme1.white,
fontFamily: "light",
textAlign: "right",
}}
>
فایل تصویری یافت نشد.
@ -230,13 +273,14 @@ function Tab({ data, theme }) {
{dataType === "ppt" ? (
<>
{data.ppt ? (
<PPT data={data.ppt} />
<PPT data={data.ppt} theme={theme} />
) : (
<Text
style={{
fontSize: width / 31,
color: "#707070",
fontSize: fontSize.tiny,
color: light ? Colors.theme1.gray2077 : Colors.theme1.white,
fontFamily: "light",
textAlign: "right",
}}
>
فایل پاورپوینت یافت نشد.
@ -247,13 +291,14 @@ function Tab({ data, theme }) {
{dataType === "pdf" ? (
<>
{data.pdf ? (
<PDF data={data.pdf} />
<PDF data={data.pdf} theme={theme} />
) : (
<Text
style={{
fontSize: width / 31,
color: "#707070",
fontSize: fontSize.tiny,
color: light ? Colors.theme1.gray2077 : Colors.theme1.white,
fontFamily: "light",
textAlign: "right",
}}
>
فایل پی دی اف یافت نشد.
@ -264,13 +309,14 @@ function Tab({ data, theme }) {
{dataType === "links" ? (
<>
{data.links ? (
<Links data={data.links} />
<Links data={data.links} theme={theme} />
) : (
<Text
style={{
fontSize: width / 31,
color: "#707070",
fontSize: fontSize.tiny,
color: light ? Colors.theme1.gray2077 : Colors.theme1.white,
fontFamily: "light",
textAlign: "right",
}}
>
لینکی پیدا نشد.

@ -6,30 +6,26 @@ import {
Dimensions,
StatusBar,
} from "react-native";
import tw from 'tailwind-rn';
import { connect } from "react-redux";
import { qr } from "../../redux/actions";
import Content from "./Content";
import Navbar from "../../components/Navbar";
//style
import tw from 'tailwind-rn';
const {height} = Dimensions.get("window");
function QRContent({ route, getQrData, data, grades }) {
function QRContent({ route, getQrData, data, grades, theme }) {
useEffect(() => {
getQrData({ tail: route.params.data });
}, []);
useEffect(() => {
if (data) {
// (data.qr.content);
}
}, [data]);
return (
<SafeAreaView
style={{
paddingTop: Platform.OS === "android" ? StatusBar.currentHeight : 0,
height: height,
backgroundColor: 'white'
}}
>
<Navbar
@ -45,7 +41,7 @@ function QRContent({ route, getQrData, data, grades }) {
/>
<ScrollView
>
{data ? <Content data={data} grades={grades} /> : null}
{data ? <Content data={data} grades={grades} theme={theme} /> : null}
</ScrollView>
</SafeAreaView>
);
@ -53,7 +49,8 @@ function QRContent({ route, getQrData, data, grades }) {
const mapStateToProps = (state) => ({
data: state.qr.list,
grades : state.publicApi.grades
grades : state.publicApi.grades,
theme: state.publicApi.theme,
});
const mapDispatchToProps = {

@ -1,9 +1,16 @@
import React, { useEffect } from "react";
import { View, Image, ActivityIndicator, Dimensions, BackHandler } from "react-native";
import {
View,
Image,
ActivityIndicator,
Dimensions,
BackHandler,
StatusBar,
} from "react-native";
import AsyncStorage from "@react-native-async-storage/async-storage";
import { connect } from "react-redux";
import { blog, book, userProduct, publicApi } from "../../redux/actions";
import { useIsFocused } from '@react-navigation/native';
import { useIsFocused } from "@react-navigation/native";
import Logo from "../../assets/images/logo.png";
@ -19,9 +26,17 @@ function Splash({
userProducts,
getUserProducts,
setIsDark,
theme,
}) {
const isFocused = useIsFocused();
const [out, setOut] = React.useState(false);
React.useEffect(() => {
StatusBar.setBarStyle(
`${theme === "light" ? "dark" : "light"}-content`,
true
);
}, [theme]);
useEffect(async () => {
//set theme
const theme = await AsyncStorage.getItem("theme");
@ -39,20 +54,19 @@ function Splash({
} else if (userProducts.length === 0) {
getUserProducts();
} else {
setOut(true)
setOut(true);
navigation.navigate("Root");
}
}
}
}, []);
if(isFocused && out){
if (isFocused && out) {
setOut(false);
BackHandler.exitApp();
}
if(isFocused && !out){
if (isFocused && !out) {
if (isLogin !== null) {
if (isLogin === false) {
setOut(true);
@ -65,7 +79,7 @@ function Splash({
} else if (userProducts.length === 0) {
getUserProducts();
} else {
setOut(true)
setOut(true);
navigation.navigate("Root");
}
}
@ -101,13 +115,14 @@ const mapStateToProps = (state) => ({
blogs: state.blog.list,
books: state.book.list,
userProducts: state.userProduct.list,
theme: state.publicApi.theme,
});
const mapDispatchToProps = {
getBlogs: blog.list,
getBooks: book.list,
getUserProducts: userProduct.list,
setIsDark: publicApi.setIsDark
setIsDark: publicApi.setIsDark,
};
export default connect(mapStateToProps, mapDispatchToProps)(Splash);

Loading…
Cancel
Save