reza added kolli chiz miz

master
Reza_ashrafi 3 years ago
parent 50a2817301
commit 2530a593b3
  1. 11
      .expo-shared/README.md
  2. 5
      .expo-shared/assets.json
  3. 4
      App.js
  4. 3
      app.json
  5. 4
      navigation/index.js
  6. 2
      package.json
  7. BIN
      src/assets/sound.mp3
  8. 2
      src/components/Header.js
  9. 186
      src/components/MusicPlayer.js
  10. 121
      src/components/Navbar.js
  11. 2
      src/components/Or.js
  12. 2
      src/components/Pressable.js
  13. 4
      src/components/Scanner.js
  14. 1
      src/constants/Colors.js
  15. 2
      src/redux/actions/public.js
  16. 2
      src/redux/store.js
  17. 166
      src/screens/Activation/index.js
  18. 16
      src/screens/Home/index.js
  19. 13
      src/screens/OrderDetails/index.js
  20. 2
      src/screens/OrdersFollowUp/components/Order.js
  21. 15
      src/screens/OrdersFollowUp/index.js
  22. 19
      src/screens/Product/index.js
  23. 9
      src/screens/Products/index.js
  24. 33
      src/screens/QR/Content/Links.js
  25. 30
      src/screens/QR/Content/PDF.js
  26. 30
      src/screens/QR/Content/PPT.js
  27. 27
      src/screens/QR/Content/Video.js
  28. 23
      src/screens/QR/Content/Voice.js
  29. 103
      src/screens/QR/Content/index.js
  30. 86
      src/screens/QR/Scan/index.js
  31. 289
      src/screens/QR/Tab/index.js
  32. BIN
      src/screens/QR/assets/laptop.png
  33. 117
      src/screens/QR/index.js
  34. 50
      src/screens/ShoppingCart/components/Code.js
  35. 35
      src/screens/ShoppingCart/index.js
  36. 3
      src/screens/Video/components/Season.js
  37. 21
      src/screens/Video/index.js
  38. 5
      src/screens/VideoDisplay/components/Season/index.js
  39. 23
      src/screens/VideoDisplay/index.js
  40. 23
      src/screens/Videos/index.js
  41. 12
      yarn.lock

@ -0,0 +1,11 @@
> Why do I have a folder named ".expo-shared" in my project?
The ".expo-shared" folder is created when running commands that produce state that is intended to be shared with all developers on the project. For example, "npx expo-optimize".
> What does the "assets.json" file contain?
The "assets.json" file describes the assets that have been optimized through "expo-optimize" and do not need to be processed again.
> Should I commit the ".expo-shared" folder?
Yes, you should share the ".expo-shared" folder with your collaborators.

@ -1,4 +1 @@
{ {}
"12bb71342c6255bbf50437ec8f4441c083f47cdb74bd89160c15e4f43e52a1cb": true,
"40b842e832070c58deac6aa9e08fa459302ee3f9da492c7e77d93d2fbf4a56fd": true
}

@ -1,4 +1,4 @@
import { StyleSheet } from "react-native"; import { AppRegistry, StyleSheet } from "react-native";
import { useFonts } from "expo-font"; import { useFonts } from "expo-font";
import AppLoading from "expo-app-loading"; import AppLoading from "expo-app-loading";
import Navigation from "./navigation/index"; import Navigation from "./navigation/index";
@ -27,4 +27,4 @@ const App = () => {
const styles = StyleSheet.create({}); const styles = StyleSheet.create({});
export default App; export default App;

@ -28,6 +28,7 @@
}, },
"web": { "web": {
"favicon": "" "favicon": ""
} },
"description": ""
} }
} }

@ -50,7 +50,7 @@ const BottomTabNavigator = () => {
// tabBarLabel : 'reza' // tabBarLabel : 'reza'
}} }}
> >
<Tab.Screen {/* <Tab.Screen
name="SplashTab" name="SplashTab"
component={AuthStackScreen} component={AuthStackScreen}
options={{ options={{
@ -58,7 +58,7 @@ const BottomTabNavigator = () => {
<FontAwesome name="user" size={focused ? 27 : 23} color={color} /> <FontAwesome name="user" size={focused ? 27 : 23} color={color} />
), ),
}} }}
/> /> */}
<Tab.Screen <Tab.Screen
name="ShoppingCartTab" name="ShoppingCartTab"
component={ShoppingCart} component={ShoppingCart}

@ -12,6 +12,7 @@
"dependencies": { "dependencies": {
"@expo-google-fonts/noto-sans": "^0.2.0", "@expo-google-fonts/noto-sans": "^0.2.0",
"@react-native-async-storage/async-storage": "~1.15.0", "@react-native-async-storage/async-storage": "~1.15.0",
"@react-native-community/slider": "4.1.12",
"@react-navigation/bottom-tabs": "^6.0.9", "@react-navigation/bottom-tabs": "^6.0.9",
"@react-navigation/drawer": "^6.1.8", "@react-navigation/drawer": "^6.1.8",
"@react-navigation/native": "^6.0.6", "@react-navigation/native": "^6.0.6",
@ -19,6 +20,7 @@
"axios": "^0.24.0", "axios": "^0.24.0",
"expo": "^44.0.1", "expo": "^44.0.1",
"expo-app-loading": "~1.3.0", "expo-app-loading": "~1.3.0",
"expo-av": "^10.2.0",
"expo-barcode-scanner": "~11.2.0", "expo-barcode-scanner": "~11.2.0",
"expo-camera": "~12.1.0", "expo-camera": "~12.1.0",
"expo-device": "~4.1.0", "expo-device": "~4.1.0",

Binary file not shown.

@ -10,7 +10,7 @@ export default function Header({icon, title, description, background}) {
<View <View
style={[ style={[
tw.style('w-full flex flex-col items-center justify-end pb-3 relative mb-0'), tw.style('w-full flex flex-col items-center justify-end pb-3 relative mb-0'),
{height: height / 4.5, backgroundColor: '#196EC015'}, {height: height / 4.5, backgroundColor: '#E9F0F7'},
]}> ]}>
<Image source={background} style={[tw.style('absolute left-0 top-0'), {}]} /> <Image source={background} style={[tw.style('absolute left-0 top-0'), {}]} />
<Image source={icon} style={[{width : width / 5, height : height / 10, marginBottom : 10}]} /> <Image source={icon} style={[{width : width / 5, height : height / 10, marginBottom : 10}]} />

@ -0,0 +1,186 @@
import React, { useState, useEffect } from "react";
import { StyleSheet, TouchableOpacity, View, Image, Text } from "react-native";
import { Ionicons } from "@expo/vector-icons";
import { Audio } from "expo-av";
import sound from '../assets/sound.mp3';
const audioBookPlaylist = [
{
title: "Hamlet - Act I",
author: "William Shakespeare",
source: "Librivox",
uri: sound,
imageSource:
"http://www.archive.org/download/LibrivoxCdCoverArt8/hamlet_1104.jpg",
},
];
const MusicPlayer = () => {
const [isPlaying, setIsPlaying] = useState(false);
const [playbackInstance, setPlaybackInstance] = useState(null);
const [currentIndex, setCurrentIndex] = useState(0);
const [volume, setVolume] = useState(1.0);
const [isBuffering, setIsBuffering] = useState(true);
useEffect( async () => {
try {
await Audio.setAudioModeAsync({
allowsRecordingIOS: false,
interruptionModeIOS: Audio.INTERRUPTION_MODE_IOS_DO_NOT_MIX,
playsInSilentModeIOS: true,
interruptionModeAndroid: Audio.INTERRUPTION_MODE_ANDROID_DO_NOT_MIX,
shouldDuckAndroid: true,
staysActiveInBackground: true,
playThroughEarpieceAndroid: true,
});
loadAudio();
} catch (e) {
console.log(e);
}
});
const loadAudio = async () => {
try {
const playbackInstance = new Audio.Sound();
const source = {
uri: audioBookPlaylist[currentIndex].uri,
};
const status = {
shouldPlay: isPlaying,
volume: volume,
};
playbackInstance.setOnPlaybackStatusUpdate(onPlaybackStatusUpdate);
await playbackInstance.loadAsync(source, status, false);
setPlaybackInstance(playbackInstance);
} catch (e) {
console.log(e);
}
};
const onPlaybackStatusUpdate = (status) => {
setIsBuffering(status.isBuffering);
};
const handlePlayPause = async () => {
if(isPlaying) {
await playbackInstance.pauseAsync();
}else{
await playbackInstance.playAsync();
}
setIsPlaying(() => !isPlaying);
};
const handlePreviousTrack = async () => {
let { playbackInstance, currentIndex } = state;
if (playbackInstance) {
await playbackInstance.unloadAsync();
setCurrentIndex(
currentIndex === 0 ? audioBookPlaylist.length - 1 : currentIndex - 1
);
loadAudio();
}
};
const handleNextTrack = async () => {
if (playbackInstance) {
await playbackInstance.unloadAsync();
setCurrentIndex(
currentIndex + 1 > audioBookPlaylist.length - 1 ? 0 : currentIndex + 1
);
loadAudio();
}
};
const renderFileInfo = () => {
return playbackInstance ? (
<View style={styles.trackInfo}>
<Text style={[styles.trackInfoText, styles.largeText]}>
{audioBookPlaylist[currentIndex].title}
</Text>
<Text style={[styles.trackInfoText, styles.smallText]}>
{audioBookPlaylist[currentIndex].author}
</Text>
<Text style={[styles.trackInfoText, styles.smallText]}>
{audioBookPlaylist[currentIndex].source}
</Text>
</View>
) : null;
};
return (
<View style={styles.container}>
<Image
style={styles.albumCover}
source={{
uri: "http://www.archive.org/download/LibrivoxCdCoverArt8/hamlet_1104.jpg",
}}
/>
<View style={styles.controls}>
<TouchableOpacity
style={styles.control}
onPress={() => handlePreviousTrack()}
>
<Ionicons name="play-back" size={48} color="#444" />
</TouchableOpacity>
<TouchableOpacity
style={styles.control}
onPress={() => handlePlayPause()}
>
{isPlaying ? (
<Ionicons name="ios-pause" size={48} color="#444" />
) : (
<Ionicons name="ios-play-circle" size={48} color="#444" />
)}
</TouchableOpacity>
<TouchableOpacity
style={styles.control}
onPress={() => handleNextTrack()}
>
<Ionicons name="play-forward" size={48} color="#444" />
</TouchableOpacity>
</View>
{renderFileInfo()}
</View>
);
};
const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: "#fff",
alignItems: "center",
justifyContent: "center",
},
albumCover: {
width: 250,
height: 250,
},
trackInfo: {
padding: 40,
backgroundColor: "#fff",
},
trackInfoText: {
textAlign: "center",
flexWrap: "wrap",
color: "#550088",
},
largeText: {
fontSize: 22,
},
smallText: {
fontSize: 16,
},
control: {
margin: 20,
},
controls: {
flexDirection: "row",
},
});
export default MusicPlayer;

@ -4,11 +4,15 @@ import {
StyleSheet, StyleSheet,
View, View,
Pressable, Pressable,
Dimensions,
Text,
} from "react-native"; } from "react-native";
import { useNavigation } from "@react-navigation/native"; import { useNavigation } from "@react-navigation/native";
import { Ionicons } from "@expo/vector-icons"; import { Ionicons, Entypo } from "@expo/vector-icons";
import tw from "tailwind-rn"; import tw from "tailwind-rn";
import Drawer from "./Drawer"; import { connect } from "react-redux";
const { width, height } = Dimensions.get("window");
//colors //colors
import Color from "../constants/Colors"; import Color from "../constants/Colors";
@ -19,7 +23,7 @@ import logoIcon from "../assets/icons/logo.png";
import qrLightIcon from "../assets/icons/qr-light.png"; import qrLightIcon from "../assets/icons/qr-light.png";
import arLightIcon from "../assets/icons/ar-light.png"; import arLightIcon from "../assets/icons/ar-light.png";
const Navbar = ({ notification, back, setBoxPosition }) => { const Navbar = ({ notification, setBoxPosition, headerOptions }) => {
const navigation = useNavigation(); const navigation = useNavigation();
const Button = useCallback(({ icon, route }) => { const Button = useCallback(({ icon, route }) => {
@ -42,40 +46,67 @@ const Navbar = ({ notification, back, setBoxPosition }) => {
}, []); }, []);
return ( return (
<View <View
style={tw( style={[tw(
"w-full flex flex-row-reverse justify-between h-16 bg-white items-center px-0" "w-full flex flex-row-reverse justify-between h-16 bg-white items-center px-0"
)} ), {backgroundColor : headerOptions.backgroundColor ? headerOptions.backgroundColor : 'white'}]}
> >
<Pressable style={tw("relative mr-4")} onPress={() => setBoxPosition()}> {!headerOptions.title && headerOptions.back ? (
<Image <Ionicons
source={hamburgerLightIcon} name="arrow-forward"
style={{ width: 29.5, height: 27 }} style={tw("mr-2")}
/> size={24}
{notification && ( color={"#196EC0"}
<View onPress={() => navigation.goBack()}
style={tw(
"h-2.5 w-2.5 absolute -left-1 -top-1 bg-red-500 rounded-full"
)}
></View>
)}
</Pressable>
<Pressable
onPress={() => navigation.navigate("Home")}
style={tw("absolute right-1/2 top-1/2")}
>
<Image
source={logoIcon}
style={[
{
width: 19.6,
height: 28.9,
transform: [{ translateX: 0 }, { translateY: -14.5 }],
},
]}
/> />
</Pressable> ) : null}
{headerOptions.title ? (
<Text
style={{
fontFamily: "bold",
fontSize: width / 21,
color: Color.theme1.light.blue5,
paddingRight: 16
}}
>
{headerOptions?.title}
</Text>
) : null}
{headerOptions.hamburgerMenu && (
<Pressable style={tw("relative mr-4")} onPress={() => setBoxPosition()}>
<Image
source={hamburgerLightIcon}
style={{ width: 29.5, height: 27 }}
/>
{notification && (
<View
style={tw(
"h-2.5 w-2.5 absolute -left-1 -top-1 bg-red-500 rounded-full"
)}
></View>
)}
</Pressable>
)}
{headerOptions.logo && (
<Pressable
onPress={() => navigation.navigate("Home")}
style={tw("absolute right-1/2 top-1/2")}
>
<Image
source={logoIcon}
style={[
{
width: 19.6,
height: 28.9,
transform: [{ translateX: 0 }, { translateY: -14.5 }],
},
]}
/>
</Pressable>
)}
<View style={tw("flex flex-row items-center ml-4")}> <View style={tw("flex flex-row items-center ml-4")}>
{back && ( {headerOptions.back && headerOptions.title ? (
<Ionicons <Ionicons
name="arrow-back" name="arrow-back"
style={tw("mr-2")} style={tw("mr-2")}
@ -83,14 +114,32 @@ const Navbar = ({ notification, back, setBoxPosition }) => {
color={"#196EC0"} color={"#196EC0"}
onPress={() => navigation.goBack()} onPress={() => navigation.goBack()}
/> />
) : null}
{headerOptions.qr && (
<>
<Button icon={qrLightIcon} route={"QR"} />
<Button icon={arLightIcon} route={"ar"} />
</>
)}
{headerOptions.bookmark && (
<Ionicons
name="bookmark-outline"
style={tw("mr-2")}
size={24}
color={"#196EC0"}
onPress={() => navigation.goBack()}
/>
)}
{headerOptions.menu && (
<Entypo name="dots-three-vertical" size={24} color="#196EC0" />
)} )}
<Button icon={qrLightIcon} route={"QR"} />
<Button icon={arLightIcon} route={"ar"} />
</View> </View>
</View> </View>
); );
}; };
export default Navbar; const mapStateToProps = (state) => ({});
export default connect(mapStateToProps)(Navbar);
const styles = StyleSheet.create({}); const styles = StyleSheet.create({});

@ -7,7 +7,7 @@ const width = Dimensions.get('window').width;
function Or(props) { function Or(props) {
return ( return (
<View <View
style={[tw.style('w-full flex flex-row justify-between items-center mt-3 mb-5')]}> style={[tw.style('w-full flex flex-row justify-between items-center my-3')]}>
<View <View
style={{width: '43%', height: 1, backgroundColor: '#EFEFEF'}}></View> style={{width: '43%', height: 1, backgroundColor: '#EFEFEF'}}></View>
<Text style={{fontSize: width / 27, color: '#C2C2C2'}}>یا</Text> <Text style={{fontSize: width / 27, color: '#C2C2C2'}}>یا</Text>

@ -22,7 +22,7 @@ export default function Pressable1({
width : width, width : width,
}, },
]}> ]}>
<Text style={{fontSize: fullWidth / 36, color: color, fontFamily : 'light'}}>{title}</Text> <Text style={{fontSize: fullWidth / 31, color: color, fontFamily : 'light'}}>{title}</Text>
</Pressable> </Pressable>
); );
} }

@ -26,12 +26,12 @@ export default function App() {
} }
return ( return (
<View style={{width : '100%', position : 'relative'}}> <>
<BarCodeScanner <BarCodeScanner
onBarCodeScanned={scanned ? undefined : handleBarCodeScanned} onBarCodeScanned={scanned ? undefined : handleBarCodeScanned}
style={{width : '100%', height : 300}} style={{width : '100%', height : 300}}
/> />
{scanned && <Button title={'Tap to Scan Again'} onPress={() => setScanned(false)} />} {scanned && <Button title={'Tap to Scan Again'} onPress={() => setScanned(false)} />}
</View> </>
); );
} }

@ -8,6 +8,7 @@ const Colors = {
blue5 : "#196EC0", blue5 : "#196EC0",
blue6 : '#05335F', blue6 : '#05335F',
blue7 : '#235A90', blue7 : '#235A90',
blue8 : '#86A0B9',
}, },
dark : { dark : {

@ -4,7 +4,6 @@ const publicApi = {
await dispatch({ type: "public/setIsDark", data: data }), await dispatch({ type: "public/setIsDark", data: data }),
getHomeData: (data) => async (dispatch) => getHomeData: (data) => async (dispatch) =>
await proxy.get("public/homePage", data, { dispatch }), await proxy.get("public/homePage", data, { dispatch }),
setFaqActive: (data) => async (dispatch) => setFaqActive: (data) => async (dispatch) =>
await dispatch({ type: "public/faq/activate", data: data }), await dispatch({ type: "public/faq/activate", data: data }),
bookInfo: bookInfo:
@ -22,7 +21,6 @@ const publicApi = {
getBlogList: (data) => async (dispatch) => getBlogList: (data) => async (dispatch) =>
await proxy.get("public/blogList", data, { dispatch }), await proxy.get("public/blogList", data, { dispatch }),
getBlogInfo: (data) => async (dispatch) => getBlogInfo: (data) => async (dispatch) =>
await proxy.get("public/blogInfo", data, { dispatch }), await proxy.get("public/blogInfo", data, { dispatch }),
setSubscribe: (data) => async (dispatch) => setSubscribe: (data) => async (dispatch) =>

@ -59,6 +59,6 @@ try {
// console.log(e); // console.log(e);
} }
// console.disableYellowBox = true; console.disableYellowBox = true;
export default store; export default store;

@ -1,19 +1,19 @@
import React, { useState } from "react"; import React, { useState, useEffect } from "react";
import { import {
View, View,
StyleSheet, StyleSheet,
Dimensions, Dimensions,
ScrollView, ScrollView,
Text,
Pressable,
Image, Image,
TextInput, TextInput,
SafeAreaView, SafeAreaView,
StatusBar, StatusBar,
Platform, Platform,
LayoutAnimation LayoutAnimation,
KeyboardAvoidingView,
} from "react-native"; } from "react-native";
import tw from "tailwind-react-native-classnames"; import { connect } from "react-redux";
import tw from "tailwind-rn";
import Header from "../../components/Header"; import Header from "../../components/Header";
import Navbar from "../../components/Navbar"; import Navbar from "../../components/Navbar";
import Drawer from "../../components/Drawer"; import Drawer from "../../components/Drawer";
@ -26,9 +26,9 @@ import qrIcon from "./assets/qr.png";
import alertIcon from "./assets/alert.png"; import alertIcon from "./assets/alert.png";
import bookIcon from "./assets/book.png"; import bookIcon from "./assets/book.png";
const width = Dimensions.get("window").width; const { width, height } = Dimensions.get("window");
function Activation(props) { function Activation({}) {
const [formData, setFormData] = useState({ const [formData, setFormData] = useState({
title: null, title: null,
department: null, department: null,
@ -53,96 +53,88 @@ function Activation(props) {
position: "relative", position: "relative",
}} }}
> >
<Navbar setBoxPosition={setBoxPosition} /> <Navbar
setBoxPosition={setBoxPosition}
headerOptions={{
logo: true,
menu: false,
hamburgerMenu: true,
title: "",
bookmark: false,
qr: true,
back: false,
backgroundColor: "#E9F0F7",
}}
/>
<Drawer setBoxPosition={setBoxPosition} position={position} /> <Drawer setBoxPosition={setBoxPosition} position={position} />
<Header
background={bgQr}
title={"فعالسازی کتاب دیجیتال"}
description={""}
icon={qrIcon}
/>
<ScrollView <ScrollView
contentContainerStyle={styles.contentContainerStyle} style={[
style={[tw.style("bg-white flex flex-col"), { width: width }]} tw("bg-white"),
// { height: height - 138 },
]}
keyboardShouldPersistTaps="handled"
showsVerticalScrollIndicator={false}
> >
<View style={tw.style("flex flex-col w-full flex-wrap p-2")}> <View
<View style={tw.style("w-full flex flex-row justify-center mb-7")}> style={[
<Image source={bookIcon} style={[{ width: 90, height: 90 }]} /> tw("flex flex-col justify-between items-center"),
{ height: height - 140 },
]}
>
<View style={tw("flex flex-col w-full")}>
<Header
background={bgQr}
title={"فعالسازی کتاب دیجیتال"}
description={""}
icon={qrIcon}
/>
<View style={tw("w-full flex flex-row justify-center mb-7")}>
<Image source={bookIcon} style={[{ width: 90, height: 90 }]} />
</View>
</View> </View>
{/* <Pressable <KeyboardAvoidingView style={tw("w-full flex flex-col px-4")} enabled>
style={[ <TextInput
tw.style( placeholder="کد فعالسازی"
"w-full rounded-md flex flex-row justify-end items-center py-3.5 px-3" placeholderTextColor="#70707070"
),
{ backgroundColor: "#196EC01a" },
]}
>
<Text
style={[ style={[
tw.style("text-right flex-1"), tw("w-full mt-4 mb-3 rounded-md text-center py-2"),
{ color: "#275077", fontSize: width / 30 }, {
backgroundColor: "#F9F9F9",
borderColor: "#DFDFDF",
borderWidth: 1,
fontSize: width / 31,
fontFamily: "light",
},
]} ]}
> />
دانش آموز گرامی پس از خرید فیزیکی کتاب، یک کارت فعالسازی در درون <CustomPressable
کتاب قرار داده شده که شما میتوانید با وارد کردن کد در قسمت زیر و title={"تایید کد"}
یا اسکن کد QR با دوربین موبایل خود اقدام به فعالسازی امکانات ویژه backgroundColor="#196EC0"
برای کتاب خود نمائید color={"white"}
</Text> border={{ color: "#196EC0", width: 0 }}
<View style={tw.style("p-2")}> width={"100%"}
<Image />
source={alertIcon} <Or />
style={{ width: 30, height: 30, marginLeft: 5 }} <CustomPressable
/> title={"فعالسازی با کد QR"}
</View> backgroundColor="#98B2CB"
</Pressable> */} color={"white"}
<TextInput border={{ color: "#196EC0", width: 0 }}
placeholder="کد فعالسازی" width={"100%"}
placeholderTextColor="#70707070" />
style={[ </KeyboardAvoidingView>
tw.style("w-full mt-4 mb-3 rounded-md text-center py-2"),
{
backgroundColor: "#F9F9F9",
borderColor: "#DFDFDF",
borderWidth: 1,
fontSize: width / 31,
fontFamily: "light",
},
]}
/>
<CustomPressable
title={"تایید کد"}
backgroundColor="#196EC0"
color={"white"}
border={{ color: "#196EC0", width: 0 }}
width={"100%"}
/>
<Or />
<CustomPressable
title={"فعالسازی با کد QR"}
backgroundColor="#98B2CB"
color={"white"}
border={{ color: "#196EC0", width: 0 }}
width={"100%"}
/>
</View> </View>
</ScrollView> </ScrollView>
</SafeAreaView> </SafeAreaView>
); );
} }
// Later on in your styles.. Activation.defaultProps = {
const styles = StyleSheet.create({ headerOptions: {},
contentContainerStyle: { };
paddingBottom: 50,
alignItems: "flex-end", const mapStateToProps = (state) => ({});
},
container: { const mapDispatchToProps = {};
width: Dimensions.get("window").width,
backgroundColor: "white",
flexDirection: "column",
paddingVertical: 5,
paddingHorizontal: 16,
},
});
export default Activation; export default connect(mapStateToProps, mapDispatchToProps)(Activation);

@ -1,5 +1,6 @@
import React, { useState, useEffect } from "react"; import React, { useState, useEffect } from "react";
import { connect } from "react-redux"; import { connect } from "react-redux";
import { publicApi } from "../../redux/actions";
import { import {
View, View,
StyleSheet, StyleSheet,
@ -21,7 +22,7 @@ import Drawer from "../../components/Drawer";
// import { SafeAreaView } from 'react-native-safe-area-context'; // import { SafeAreaView } from 'react-native-safe-area-context';
// Within your render function // Within your render function
const Home = ({ isLogin }) => { const Home = ({ isLogi, setHeaderOptions }) => {
const [position, setPosition] = useState("100%"); const [position, setPosition] = useState("100%");
const setBoxPosition = () => { const setBoxPosition = () => {
@ -36,7 +37,18 @@ const Home = ({ isLogin }) => {
position: "relative", position: "relative",
}} }}
> >
<Navbar setBoxPosition={setBoxPosition} /> <Navbar
setBoxPosition={setBoxPosition}
headerOptions={{
logo: true,
menu: false,
hamburgerMenu: true,
title: "",
bookmark: false,
qr: true,
back: false,
}}
/>
<Drawer setBoxPosition={setBoxPosition} position={position} /> <Drawer setBoxPosition={setBoxPosition} position={position} />
<ScrollView <ScrollView
contentContainerStyle={styles.contentContainerStyle} contentContainerStyle={styles.contentContainerStyle}

@ -49,7 +49,18 @@ function OrderDetails({ order }) {
position: "relative", position: "relative",
}} }}
> >
<Navbar setBoxPosition={setBoxPosition} back={true} /> <Navbar
setBoxPosition={setBoxPosition}
headerOptions={{
logo: true,
menu: false,
hamburgerMenu: true,
title: "",
bookmark: false,
qr: true,
back: false,
}}
/>
<Drawer setBoxPosition={setBoxPosition} position={position} /> <Drawer setBoxPosition={setBoxPosition} position={position} />
<ScrollView <ScrollView
contentContainerStyle={styles.contentContainerStyle} contentContainerStyle={styles.contentContainerStyle}

@ -139,7 +139,7 @@ function Order({order}) {
<TouchableOpacity <TouchableOpacity
onPress={() => navigation.navigate('Order')} onPress={() => navigation.navigate('Order')}
style={[ style={[
tw.style('rounded-md flex flex-row-reverse justify-center px-5 py-3'), tw.style('rounded-md flex flex-row-reverse justify-center px-5 py-2'),
{borderWidth: 1, borderColor: '#1999C0'}, {borderWidth: 1, borderColor: '#1999C0'},
]}> ]}>
<Text style={{fontSize: width / 36, color: '#1999C0', fontFamily: 'regular'}}> <Text style={{fontSize: width / 36, color: '#1999C0', fontFamily: 'regular'}}>

@ -1,4 +1,4 @@
import React, {useState} from "react"; import React, { useState } from "react";
import { import {
View, View,
Text, Text,
@ -34,7 +34,18 @@ function OrdersFollowUp({ orders }) {
position: "relative", position: "relative",
}} }}
> >
<Navbar setBoxPosition={setBoxPosition} back={true} /> <Navbar
setBoxPosition={setBoxPosition}
headerOptions={{
logo: true,
menu: false,
hamburgerMenu: true,
title: "",
bookmark: false,
qr: true,
back: false,
}}
/>
<Drawer setBoxPosition={setBoxPosition} position={position} /> <Drawer setBoxPosition={setBoxPosition} position={position} />
<ScrollView <ScrollView
contentContainerStyle={styles.contentContainerStyle} contentContainerStyle={styles.contentContainerStyle}

@ -1,4 +1,4 @@
import React, {useState} from "react"; import React, { useState } from "react";
import { import {
View, View,
StyleSheet, StyleSheet,
@ -6,7 +6,7 @@ import {
ScrollView, ScrollView,
SafeAreaView, SafeAreaView,
StatusBar, StatusBar,
LayoutAnimation LayoutAnimation,
} from "react-native"; } from "react-native";
import Book from "./components/Book"; import Book from "./components/Book";
import Video from "./components/Video"; import Video from "./components/Video";
@ -49,7 +49,7 @@ function Product({
"خالد حسینی تو رمان باد بادک باز مینویسه : ﻣﺮﺩ ﺁﻫﺴﺘﻪ ﺩﺭ ﮔﻮﺵ ﻓﺮﺯﻧﺪ ﺗﺎﺯﻩ ﺑﻪ ﺑﻠﻮﻍ ﺭﺳﯿﺪﻩ ﺍﺵ ﺑﺮﺍﯼ ﭘﻨﺪ ﭼﻨﯿﻦ ﻧﺠﻮﺍ ﮐﺮﺩ : ” ﭘﺴﺮﻡ ﺩﺭ ﺯﻧﺪﮔﯽ ﻫﺮﮔﺰ ﺩﺯﺩﯼ ﻧﮑﻦ ” ﭘﺴﺮ ﻣﺘﻌﺠﺐ ﻭ ﻣﺒﻬﻮﺕ ﺑﻪ ﭘﺪﺭ ﻧﮕﺎﻩ ﮐﺮﺩ ﺑﺪﯾﻦ ﻣﻌﻨﺎ ﮐﻪ ﺍﻭ ﻫﺮﮔﺰ ﺩﺳﺖ ﮐﺞ ﻧﺪﺍﺷﺘﻪ ﭘﺪﺭ ﺑﻪ ﻧﮕﺎﻩ ﻣﺘﻌﺠﺐ ﻓﺮﺯﻧﺪ ﻟﺒﺨﻨﺪﯼ ﺯﺩ ﻭ ﺍﺩﺍﻣﻪ ", "خالد حسینی تو رمان باد بادک باز مینویسه : ﻣﺮﺩ ﺁﻫﺴﺘﻪ ﺩﺭ ﮔﻮﺵ ﻓﺮﺯﻧﺪ ﺗﺎﺯﻩ ﺑﻪ ﺑﻠﻮﻍ ﺭﺳﯿﺪﻩ ﺍﺵ ﺑﺮﺍﯼ ﭘﻨﺪ ﭼﻨﯿﻦ ﻧﺠﻮﺍ ﮐﺮﺩ : ” ﭘﺴﺮﻡ ﺩﺭ ﺯﻧﺪﮔﯽ ﻫﺮﮔﺰ ﺩﺯﺩﯼ ﻧﮑﻦ ” ﭘﺴﺮ ﻣﺘﻌﺠﺐ ﻭ ﻣﺒﻬﻮﺕ ﺑﻪ ﭘﺪﺭ ﻧﮕﺎﻩ ﮐﺮﺩ ﺑﺪﯾﻦ ﻣﻌﻨﺎ ﮐﻪ ﺍﻭ ﻫﺮﮔﺰ ﺩﺳﺖ ﮐﺞ ﻧﺪﺍﺷﺘﻪ ﭘﺪﺭ ﺑﻪ ﻧﮕﺎﻩ ﻣﺘﻌﺠﺐ ﻓﺮﺯﻧﺪ ﻟﺒﺨﻨﺪﯼ ﺯﺩ ﻭ ﺍﺩﺍﻣﻪ ",
}, },
{ {
id : 1, id: 1,
name: "سورنا عابدی", name: "سورنا عابدی",
imageUrl: userImage, imageUrl: userImage,
vote: 4, vote: 4,
@ -73,7 +73,18 @@ function Product({
position: "relative", position: "relative",
}} }}
> >
<Navbar setBoxPosition={setBoxPosition} back={true} /> <Navbar
setBoxPosition={setBoxPosition}
headerOptions={{
logo: false,
menu: true,
hamburgerMenu: false,
title: "",
bookmark: true,
qr: false,
back: true,
}}
/>
<Drawer setBoxPosition={setBoxPosition} position={position} /> <Drawer setBoxPosition={setBoxPosition} position={position} />
<ScrollView <ScrollView
contentContainerStyle={styles.contentContainerStyle} contentContainerStyle={styles.contentContainerStyle}

@ -7,7 +7,7 @@ import {
Dimensions, Dimensions,
SafeAreaView, SafeAreaView,
StatusBar, StatusBar,
LayoutAnimation LayoutAnimation,
} from "react-native"; } from "react-native";
import tw from "tailwind-react-native-classnames"; import tw from "tailwind-react-native-classnames";
@ -37,7 +37,6 @@ function Products({ grades, productTypes }) {
position: "relative", position: "relative",
}} }}
> >
<Navbar setBoxPosition={setBoxPosition} />
<Drawer setBoxPosition={setBoxPosition} position={position} /> <Drawer setBoxPosition={setBoxPosition} position={position} />
<ScrollView <ScrollView
contentContainerStyle={styles.contentContainerStyle} contentContainerStyle={styles.contentContainerStyle}
@ -75,7 +74,11 @@ function Products({ grades, productTypes }) {
)} )}
> >
{[0, 1, 2, 3, 4, 5, 6, 7].map((item, index) => {[0, 1, 2, 3, 4, 5, 6, 7].map((item, index) =>
productType === "ویدئوها" ? <Video key={index} /> : <Book key={index} /> productType === "ویدئوها" ? (
<Video key={index} />
) : (
<Book key={index} />
)
)} )}
</View> </View>
</ScrollView> </ScrollView>

@ -1,23 +1,30 @@
import React from 'react'; import React from "react";
import {View, Text, Image, Pressable} from 'react-native'; import { View, Text, Image, Pressable, Dimensions } from "react-native";
import tw from 'tailwind-react-native-classnames'; import tw from "tailwind-rn";
import linkIcon from '../../../assets/icons/link.png'; import linkIcon from "../../../assets/icons/link.png";
export default function Links({links}) { const { width } = Dimensions.get("window");
export default function Links({ links }) {
return ( return (
<View <View
style={tw.style( style={tw(
'w-full flex-row-reverse justify-between items-center rounded-md bg-yellow-100 py-3 px-2 mt-5', "w-full flex-row-reverse justify-between items-center rounded-md bg-yellow-100 py-3 px-2 mt-5"
)}> )}
<View style={tw.style('flex flex-col items-end')}> >
<Text>لینک ها</Text> <View style={tw("flex flex-col items-end")}>
<Text style={{ fontSize: width / 31, fontFamily: "bold" }}>
لینک ها
</Text>
{links.map((link, i) => ( {links.map((link, i) => (
<Pressable style={tw.style('')} key={i}> <Pressable style={tw("mt-1")} key={i}>
<Text>{link}</Text> <Text style={{ fontSize: width / 34, fontFamily: "light" }}>
{link}
</Text>
</Pressable> </Pressable>
))} ))}
</View> </View>
<Image source={linkIcon} style={{width: 40, height: 40}} /> <Image source={linkIcon} style={{ width: 40, height: 40 }} />
</View> </View>
); );
} }

@ -1,18 +1,26 @@
import React from 'react'; import React from "react";
import {View, Text, Image} from 'react-native'; import { View, Text, Image, Dimensions } from "react-native";
import tw from 'tailwind-react-native-classnames'; import tw from "tailwind-rn";
import pdfIcon from '../../../assets/icons/pdf.png'; import pdfIcon from "../../../assets/icons/pdf.png";
export default function PDF({name, file}) { const {width} = Dimensions.get("window");
export default function PDF({ name, file }) {
return ( return (
<View <View
style={tw.style( style={tw(
'w-full flex-row-reverse justify-between items-center rounded-md bg-red-100 py-3 px-2 mt-5', "w-full flex-row-reverse justify-between items-center rounded-md bg-red-100 py-3 px-2 mt-5"
)}> )}
<Text style={tw.style('text-right text-xs text-red-900')}> >
<Text
style={[
tw("text-right text-red-900"),
{ fontSize: width / 34, fontFamily: "regular" },
]}
>
{name} {name}
</Text> </Text>
<Image source={pdfIcon} style={{width: 40, height: 40}} /> <Image source={pdfIcon} style={{ width: 40, height: 40 }} />
</View> </View>
); );
} }

@ -1,18 +1,26 @@
import React from 'react'; import React from "react";
import {View, Text, Image} from 'react-native'; import { View, Text, Image, Dimensions } from "react-native";
import tw from 'tailwind-react-native-classnames'; import tw from "tailwind-rn";
import pptIcon from '../../../assets/icons/ppt.png'; import pptIcon from "../../../assets/icons/ppt.png";
export default function PPT({name, file}) { const { width } = Dimensions.get("window");
export default function PPT({ name, file }) {
return ( return (
<View <View
style={tw.style( style={tw(
'w-full flex-row-reverse justify-between items-center rounded-md bg-green-100 py-3 px-2 mt-5', "w-full flex-row-reverse justify-between items-center rounded-md bg-green-100 py-3 px-2 mt-5"
)}> )}
<Text style={tw.style('text-right text-xs text-green-900')}> >
<Text
style={[
tw("text-right text-green-900"),
{ fontSize: width / 34, fontFamily: "regular" },
]}
>
{name} {name}
</Text> </Text>
<Image source={pptIcon} style={{width: 40, height: 40}} /> <Image source={pptIcon} style={{ width: 40, height: 40 }} />
</View> </View>
); );
} }

@ -1,14 +1,23 @@
import React from 'react'; import React from "react";
import {View, Text} from 'react-native'; import { View, Text, Dimensions } from "react-native";
import tw from 'tailwind-react-native-classnames'; import tw from "tailwind-rn";
export default function Video({name, file}) { const {width} = Dimensions.get("window");
return (
<View style={tw.style('w-full flex-col mt-5')}>
<Text style={tw.style('w-full text-right text-xs text-green-900 mb-2')}>{name}</Text>
<View style={[tw.style('w-full bg-blue-200 rounded-md'), {minHeight : 200}]}>
</View> export default function Video({ name, file }) {
return (
<View style={tw("w-full flex-col mt-5")}>
<Text
style={[
tw("w-full text-right text-green-900 mb-2"),
{ fontSize: width / 34, fontFamily: "bold" },
]}
>
{name}
</Text>
<View
style={[tw("w-full bg-blue-200 rounded-md"), { minHeight: 200 }]}
></View>
</View> </View>
); );
} }

@ -1,11 +1,22 @@
import React from 'react'; import React from "react";
import {View, Text} from 'react-native'; import { View, Text, Dimensions } from "react-native";
import tw from 'tailwind-react-native-classnames'; import tw from "tailwind-rn";
import MusicPlayer from "../../../components/MusicPlayer";
export default function Voice({name, file}) { const { width } = Dimensions.get("window");
export default function Voice({ name, file }) {
return ( return (
<View style={tw.style('w-full flex-col rounded-md bg-green-200 py-3 px-2 mt-4')}> <View style={tw("w-full flex-col rounded-md bg-green-200 py-3 px-2 mt-4")}>
<Text style={tw.style('w-full text-right text-xs text-green-900')}>{name}</Text> <Text
style={[
tw("w-full text-right text-xs text-green-900"),
{ fontSize: width / 34, fontFamily: "regular" },
]}
>
{name}
</Text>
<MusicPlayer />
</View> </View>
); );
} }

@ -1,44 +1,83 @@
import React from 'react'; import React from "react";
import {View, Text, ScrollView, SafeAreaView, Image} from 'react-native'; import { View, Text, Image, Dimensions } from "react-native";
import tw from 'tailwind-react-native-classnames'; import tw from "tailwind-rn";
import Tab from "../Tab";
import Colors from "../../../constants/Colors";
const { width, height } = Dimensions.get("window");
export default function Content({ data }) {
export default function Content({data}) {
return ( return (
<SafeAreaView> <View style={tw("flex-1 flex flex-col px-4 pb-20")}>
<ScrollView> <View style={tw("flex flex-1 flex-col")}>
<View style={tw.style('flex flex-1 flex-col px-3')}> <View style={tw("flex w-full flex-row-reverse justify-between")}>
<View <View style={tw("flex flex-row-reverse")}>
style={tw.style('flex w-full flex-row-reverse justify-between')}> <Image
<View style={tw.style('flex flex-row-reverse')}> source={{ uri: "https://dnvn.ir/api/v1/file/2105" }}
<Image style={[{ width: 80, height: 120 }, tw("rounded-md")]}
source={{uri: 'https://dnvn.ir/api/v1/file/2094'}} />
style={{width: 80, height: 120}} <View style={tw("flex flex-col items-end mr-3")}>
/> <Text
<View style={tw.style('flex flex-col items-end')}> style={{
<Text>{data.name}</Text> fontFamily: "bold",
<Text>{data.grade}</Text> fontSize: width / 27,
<Text>{`شما در حال مشاهده `}</Text> color: Colors.theme1.light.blue6,
</View> }}
>
{data.name}
</Text>
<Text
style={[
tw("mt-1"),
{
fontFamily: "regular",
fontSize: width / 34,
color: Colors.theme1.light.blue5,
},
]}
>
{data.grade}
</Text>
<Text
style={[
tw("mt-1"),
{
fontFamily: "regular",
fontSize: width / 34,
color: Colors.theme1.light.blue5,
},
]}
>{`شما در حال مشاهده صفحه ${data.page} هستید.`}</Text>
</View> </View>
{/* <Image source={} /> */}
</View> </View>
</View> </View>
</ScrollView> </View>
</SafeAreaView> <Tab
data={{
voice: data.voice,
video: data.video,
pdf: data.pdf,
ppt: data.ppt,
links: data.links,
}}
/>
</View>
); );
} }
Content.defaultProps = { Content.defaultProps = {
data: { data: {
name: 'ریاضیات گسسته خیلی پیشرفته', name: "ریاضیات گسسته خیلی پیشرفته",
grade: 'پایه هفتم ابتدایی', grade: "پایه هفتم ابتدایی",
page: '67', page: "67",
percent: '62', percent: "62",
voice: null, voice: { name: "استاد رضایی: فصل پنجم توضیح در مورد آتش فشان ها", file: 1 },
video: null, video: { name: "ویدئوی آزمایش آتشفشان سرکه ای", file: 1 },
pdf: null, pdf: { name: "فایل پاورپوینت ارائه درس آتشفشان ها", file: 1 },
ppt: null, ppt: { name: "فایل پاورپوینت ارائه درس آتشفشان ها", file: 1 },
links: null, links: [
"وبسایت آموزشی دانوین",
"وبسایت رسمی مدیریت راهبردی کشور",
"سازمان تبلیغات صنایع سبک ",
],
}, },
}; };

@ -0,0 +1,86 @@
import React, { useState, useEffect } from "react";
import {
View,
Text,
Image,
TouchableOpacity,
Dimensions,
ImageBackground,
} from "react-native";
import { useNavigation } from "@react-navigation/native";
import tw from "tailwind-rn";
import { BarCodeScanner } from "expo-barcode-scanner";
import Colors from "../../../constants/Colors";
const { width, height } = Dimensions.get("window");
//assets
import laptopImage from "../assets/laptop.png";
export default function Scan({}) {
const navigation = useNavigation();
const [hasPermission, setHasPermission] = useState(null);
const [scanned, setScanned] = useState(false);
useEffect(() => {
(async () => {
const { status } = await BarCodeScanner.requestPermissionsAsync();
setHasPermission(status === "granted");
})();
}, []);
const handleBarCodeScanned = ({ type, data }) => {
setScanned(true);
alert(`Bar code with type ${type} and data ${data} has been scanned!`);
};
if (hasPermission === null) {
return <Text>Requesting for camera permission</Text>;
}
if (hasPermission === false) {
return <Text>No access to camera</Text>;
}
return (
<ImageBackground
source={laptopImage}
resizeMode="cover"
style={[tw("w-full"), { height: height - 78 }]}
>
<View
style={tw(
"flex-1 flex flex-col justify-evenly items-center bg-gray-800 bg-opacity-80"
)}
>
{/* <View style={{width : '100%', height : 300}}>
<BarCodeScanner
onBarCodeScanned={scanned ? undefined : handleBarCodeScanned}
style={{ width: "100%", height: '100%' }}
/>
</View> */}
<View
style={[
{ width: height / 2.5, height: height / 2.5 },
tw("bg-white rounded-2xl"),
]}
></View>
{/* {scanned && ( */}
<TouchableOpacity
onPress={() => navigation.goBack()}
style={[
tw("py-2.5 rounded-full flex justify-center flex-row"),
{
width: height / 3.5,
borderWidth: 1,
borderColor: Colors.theme1.light.blue8,
},
]}
>
<Text style={{ color: "white", fontSize: width / 27 }}>بازگشت</Text>
</TouchableOpacity>
</View>
{/* )} */}
</ImageBackground>
);
}

@ -0,0 +1,289 @@
import React, { useState } from "react";
import { View, Text, TouchableOpacity, Dimensions } from "react-native";
import tw from "tailwind-rn";
import Colors from "../../../constants/Colors";
import Voice from "../Content/Voice";
import Video from "../Content/Video";
import PPT from "../Content/PPT";
import PDF from "../Content/PDF";
import Links from "../Content/Links";
const { width, height } = Dimensions.get("window");
//assets
export default function Tab({ data }) {
const [dataType, setDataType] = useState("all");
return (
<View
style={[
tw("w-full flex flex-col rounded-md overflow-hidden mt-4"),
{ borderWidth: 1, borderColor: Colors.theme1.light.blue5 },
]}
>
<View style={tw("w-full flex flex-row-reverse justify-between px-0.5")}>
<TouchableOpacity
onPress={() => setDataType("all")}
style={[
tw("py-2 w-1/6"),
{
borderBottomWidth: 1,
borderColor:
dataType === "all"
? Colors.theme1.light.blue3
: Colors.theme1.light.blue5,
backgroundColor:
dataType === "all" ? Colors.theme1.light.blue3 : "white",
},
]}
>
<Text
style={{
fontSize: width / 31,
color: "#707070",
fontFamily: "light",
}}
style={{
fontSize: width / 38,
fontFamily: dataType === "all" ? "bold" : "light",
textAlign: "center",
color: Colors.theme1.light.blue5,
}}
>
تمامی محتوا
</Text>
</TouchableOpacity>
<TouchableOpacity
onPress={() => setDataType("voice")}
style={[
tw("py-2 w-1/6"),
{
borderBottomWidth: 1,
borderColor:
dataType === "voice"
? Colors.theme1.light.blue3
: Colors.theme1.light.blue5,
backgroundColor:
dataType === "voice" ? Colors.theme1.light.blue3 : "white",
},
]}
>
<Text
style={{
fontSize: width / 38,
fontFamily: dataType === "voice" ? "bold" : "light",
textAlign: "center",
color: Colors.theme1.light.blue5,
}}
>
صوت
</Text>
</TouchableOpacity>
<TouchableOpacity
onPress={() => setDataType("video")}
style={[
tw("py-2 w-1/6"),
{
borderBottomWidth: 1,
borderColor:
dataType === "video"
? Colors.theme1.light.blue3
: Colors.theme1.light.blue5,
backgroundColor:
dataType === "video" ? Colors.theme1.light.blue3 : "white",
},
]}
>
<Text
style={{
fontSize: width / 38,
fontFamily: dataType === "video" ? "bold" : "light",
textAlign: "center",
color: Colors.theme1.light.blue5,
}}
>
ویدئو
</Text>
</TouchableOpacity>
<TouchableOpacity
onPress={() => setDataType("pdf")}
style={[
tw("py-2 w-1/6"),
{
borderBottomWidth: 1,
borderColor:
dataType === "pdf"
? Colors.theme1.light.blue3
: Colors.theme1.light.blue5,
backgroundColor:
dataType === "pdf" ? Colors.theme1.light.blue3 : "white",
},
]}
>
<Text
style={{
fontSize: width / 38,
fontFamily: dataType === "pdf" ? "bold" : "light",
textAlign: "center",
color: Colors.theme1.light.blue5,
}}
>
پی دی اف
</Text>
</TouchableOpacity>
<TouchableOpacity
onPress={() => setDataType("ppt")}
style={[
tw("py-2 w-1/6"),
{
borderBottomWidth: 1,
borderColor:
dataType === "ppt"
? Colors.theme1.light.blue3
: Colors.theme1.light.blue5,
backgroundColor:
dataType === "ppt" ? Colors.theme1.light.blue3 : "white",
},
]}
>
<Text
style={{
fontSize: width / 38,
fontFamily: dataType === "ppt" ? "bold" : "light",
textAlign: "center",
color: Colors.theme1.light.blue5,
}}
>
پاور پوینت
</Text>
</TouchableOpacity>
<TouchableOpacity
onPress={() => setDataType("links")}
style={[
tw("py-2 w-1/6"),
{
borderBottomWidth: 1,
borderColor:
dataType === "links"
? Colors.theme1.light.blue3
: Colors.theme1.light.blue5,
backgroundColor:
dataType === "links" ? Colors.theme1.light.blue3 : "white",
},
]}
>
<Text
style={{
fontSize: width / 38,
fontFamily: dataType === "links" ? "bold" : "light",
textAlign: "center",
color: Colors.theme1.light.blue5,
}}
>
لینک ها
</Text>
</TouchableOpacity>
</View>
<View style={tw("flex flex-col w-full p-4")}>
{dataType === "all" && (
<>
{data.voice && (
<Voice name={data.voice.name} file={data.voice.file} />
)}
{data.video && (
<Video name={data.video.name} file={data.voice.file} />
)}
{data.ppt && <PPT name={data.ppt.name} file={data.ppt.file} />}
{data.pdf && <PDF name={data.ppt.name} file={data.ppt.file} />}
{data.links && <Links links={data.links} />}
</>
)}
{dataType === "voice" && (
<>
{data.voice ? (
<Voice name={data.voice.name} file={data.voice.file} />
) : (
<Text
style={{
fontSize: width / 31,
color: "#707070",
fontFamily: "light",
}}
>
فایل صدا یافت نشد.
</Text>
)}
</>
)}
{dataType === "video" && (
<>
{data.video ? (
<Video name={data.video.name} file={data.voice.file} />
) : (
<Text
style={{
fontSize: width / 31,
color: "#707070",
fontFamily: "light",
}}
>
فایل تصویری یافت نشد.
</Text>
)}
</>
)}
{dataType === "ppt" && (
<>
{data.ppt ? (
<PPT name={data.ppt.name} file={data.ppt.file} />
) : (
<Text
style={{
fontSize: width / 31,
color: "#707070",
fontFamily: "light",
}}
>
فایل پاورپوینت یافت نشد.
</Text>
)}
</>
)}
{dataType === "pdf" && (
<>
{data.pdf ? (
<PDF name={data.pdf.name} file={data.pdf.file} />
) : (
<Text
style={{
fontSize: width / 31,
color: "#707070",
fontFamily: "light",
}}
>
فایل پی دی اف یافت نشد.
</Text>
)}
</>
)}
{dataType === "links" && (
<>
{data.links ? (
<Links name={data.links.name} links={data.links} />
) : (
<Text
style={{
fontSize: width / 31,
color: "#707070",
fontFamily: "light",
}}
>
لینکی پیدا نشد.
</Text>
)}
</>
)}
</View>
</View>
);
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 MiB

@ -1,97 +1,44 @@
import React, {useState} from "react"; import React, { useState } from "react";
import { import {
StyleSheet, StyleSheet,
View,
Text,
ScrollView, ScrollView,
SafeAreaView, SafeAreaView,
Image,
Dimensions, Dimensions,
StatusBar, StatusBar,
} from "react-native"; } from "react-native";
import { connect } from "react-redux"; import Content from "./Content";
import tw from "tailwind-react-native-classnames"; import Scan from "./Scan";
// import Content from './Content';
import Scanner from './Scanner';
import Navbar from "../../components/Navbar"; import Navbar from "../../components/Navbar";
import Voice from "./Content/Voice";
import Video from "./Content/Video";
import PPT from "./Content/PPT";
import PDF from "./Content/PDF";
import Links from "./Content/Links";
import bookmarkIcon from "../../assets/icons/bookmark.png";
const width = Dimensions.get("window").width; const width = Dimensions.get("window").width;
function QR({ data }) { function QR({ page }) {
const [currentPage, setCurrentPage] = useState(page);
return ( return (
<SafeAreaView <SafeAreaView
style={{ style={{
paddingTop: Platform.OS === "android" ? StatusBar.currentHeight : 0, paddingTop: Platform.OS === "android" ? StatusBar.currentHeight : 0,
}} }}
> >
<Navbar back={true} /> {currentPage === "content" && (
<Navbar
headerOptions={{
logo: false,
menu: true,
hamburgerMenu: false,
title: "",
bookmark: true,
qr: false,
back: true,
}}
/>
)}
<ScrollView <ScrollView
contentContainerStyle={styles.contentContainerStyle} contentContainerStyle={styles.contentContainerStyle}
style={styles.container} style={styles.container}
> >
<Scanner /> {currentPage === "scan" && <Scan />}
{/* <View style={tw.style("flex flex-1 flex-col px-3")}> {currentPage === "content" && <Content />}
<View
style={tw.style(
"flex w-full flex-row-reverse justify-between py-3"
)}
>
<View style={tw.style("flex flex-row-reverse")}>
<Image
source={{ uri: "https://dnvn.ir/api/v1/file/2094" }}
style={[tw.style("rounded"), { width: width / 5, height: 120 }]}
/>
<View
style={tw.style("flex flex-col items-end self-end pr-3")}
>
<Text style={tw.style("text-sm text-green-500 ")}>
{data.name}
</Text>
<Text
style={tw.style("text-xs text-gray-500 font-normal mt-1")}
>
{data.grade}
</Text>
<Text
style={tw.style("text-xs text-gray-500 font-normal mt-1")}
>
شما در حال مطالعه{" "}
<Text
style={tw.style("text-xs text-blue-500 font-medium mt-1")}
>
{"صفحه" + " " + data.page}
</Text>{" "}
هستید.
</Text>
<Text
style={tw.style("text-xs text-gray-500 font-normal mt-1")}
>
پیشرفت شما در مطالعه کتاب{" "}
<Text style={tw.style("text-xs text-green-500 font-medium")}>
{data.percent + "" + "درصد"}
</Text>{" "}
میباشد.
</Text>
</View>
</View>
<Image source={bookmarkIcon} style={{ width: 27, height: 33 }} />
</View>
{data.voice && (
<Voice name={data.voice.name} file={data.voice.file} />
)}
{data.video && (
<Video name={data.video.name} file={data.voice.file} />
)}
{data.ppt && <PPT name={data.ppt.name} file={data.ppt.file} />}
{data.pdf && <PDF name={data.ppt.name} file={data.ppt.file} />}
{data.links && <Links links={data.links} />}
</View> */}
</ScrollView> </ScrollView>
</SafeAreaView> </SafeAreaView>
); );
@ -99,35 +46,19 @@ function QR({ data }) {
export default QR; export default QR;
const styles = StyleSheet.create({ const styles = StyleSheet.create({
contentContainerStyle: { contentContainerStyle: {
paddingBottom: 100, paddingBottom: 0,
}, },
container: { container: {
width: Dimensions.get("window").width, width: Dimensions.get("window").width,
backgroundColor: "white", backgroundColor: "white",
flexDirection: "column", flexDirection: "column",
paddingVertical: 5, paddingVertical: 5,
paddingHorizontal: 10, paddingHorizontal: 0,
}, },
}); });
QR.defaultProps = { QR.defaultProps = {
data: { page: "scan",
name: "ریاضیات گسسته خیلی پیشرفته",
grade: "پایه هفتم ابتدایی",
page: "67",
percent: "62",
voice: { name: "استاد رضایی: فصل پنجم توضیح در مورد آتش فشان ها", file: 1 },
video: { name: "ویدئوی آزمایش آتشفشان سرکه ای", file: 1 },
pdf: { name: "فایل پاورپوینت ارائه درس آتشفشان ها", file: 1 },
ppt: { name: "فایل پاورپوینت ارائه درس آتشفشان ها", file: 1 },
links: [
"وبسایت آموزشی دانوین",
"وبسایت رسمی مدیریت راهبردی کشور",
"سازمان تبلیغات صنایع سبک ",
],
},
}; };

@ -1,36 +1,54 @@
import React from 'react'; import React from "react";
import {View, Text, Pressable, TextInput, Dimensions} from 'react-native'; import {
import tw from 'tailwind-react-native-classnames'; View,
const width = Dimensions.get('window').width; Text,
Pressable,
TextInput,
Dimensions,
KeyboardAvoidingView,
} from "react-native";
import tw from "tailwind-react-native-classnames";
const width = Dimensions.get("window").width;
export default function Code({}) { export default function Code({}) {
return ( return (
<View <KeyboardAvoidingView
style={tw.style('flex w-full flex-col items-end mt-5 overflow-hidden')}> enabled
style={tw.style("flex w-full flex-col items-end mt-5 overflow-hidden")}
>
<View <View
style={tw.style( style={tw.style(
'flex w-full flex-row-reverse border border-blue-300 rounded-md mt-3', "flex w-full flex-row-reverse border border-blue-300 rounded-md mt-3"
)}> )}
>
<TextInput <TextInput
style={[ style={[
tw.style('border-0 flex-1 text-right pr-4'), tw.style("border-0 flex-1 text-right pr-4"),
{fontSize: width / 36, fontFamily: 'light'}, { fontSize: width / 36, fontFamily: "light" },
]} ]}
placeholder={'کد تخفیف دارید ؟'} placeholder={"کد تخفیف دارید ؟"}
placeholderTextColor="#707070" placeholderTextColor="#707070"
/> />
<Pressable <Pressable
style={[ style={[
tw.style('py-2 px-5'), tw.style("py-2 px-5"),
{ {
backgroundColor: '#196EC0', backgroundColor: "#196EC0",
borderTopLeftRadius: 5, borderTopLeftRadius: 5,
borderBottomLeftRadius: 5, borderBottomLeftRadius: 5,
}, },
]}> ]}
<Text style={[tw.style('text-white'), {fontSize: width / 31, fontFamily: 'regular'}]}>ثبت کد</Text> >
<Text
style={[
tw.style("text-white"),
{ fontSize: width / 31, fontFamily: "regular" },
]}
>
ثبت کد
</Text>
</Pressable> </Pressable>
</View> </View>
</View> </KeyboardAvoidingView>
); );
} }

@ -9,9 +9,9 @@ import {
Image, Image,
SafeAreaView, SafeAreaView,
StatusBar, StatusBar,
LayoutAnimation LayoutAnimation,
} from "react-native"; } from "react-native";
import { Ionicons } from '@expo/vector-icons'; import { Ionicons } from "@expo/vector-icons";
import Product from "./components/Product"; import Product from "./components/Product";
import Code from "./components/Code"; import Code from "./components/Code";
import CustomPressable from "../../components/Pressable"; import CustomPressable from "../../components/Pressable";
@ -29,7 +29,7 @@ const PriceStatus = ({ name, value, type }) => {
<Text <Text
style={[ style={[
tw.style(""), tw.style(""),
{ fontSize: width / 31, color: "#132F52", fontFamily: "regular"}, { fontSize: width / 31, color: "#132F52", fontFamily: "regular" },
]} ]}
> >
{name} {name}
@ -40,7 +40,7 @@ const PriceStatus = ({ name, value, type }) => {
{ {
color: type === "error" ? "#F1420D" : "#246E8A", color: type === "error" ? "#F1420D" : "#246E8A",
fontSize: width / 31, fontSize: width / 31,
fontFamily: "bold" fontFamily: "bold",
}, },
]} ]}
> >
@ -65,7 +65,18 @@ function ShoppingCart({}) {
position: "relative", position: "relative",
}} }}
> >
<Navbar setBoxPosition={setBoxPosition} /> <Navbar
setBoxPosition={setBoxPosition}
headerOptions={{
logo: false,
menu: false,
hamburgerMenu: false,
title: "سبد خرید",
bookmark: false,
qr: false,
back: true,
}}
/>
<Drawer setBoxPosition={setBoxPosition} position={position} /> <Drawer setBoxPosition={setBoxPosition} position={position} />
<ScrollView <ScrollView
contentContainerStyle={styles.contentContainerStyle} contentContainerStyle={styles.contentContainerStyle}
@ -97,13 +108,18 @@ function ShoppingCart({}) {
"flex flex-row-reverse justify-between items-center w-full py-3" "flex flex-row-reverse justify-between items-center w-full py-3"
)} )}
> >
<Text style={[tw.style(""), { fontSize: width / 31, fontFamily: "regular"}]}> <Text
style={[
tw.style(""),
{ fontSize: width / 31, fontFamily: "regular" },
]}
>
جمع کل سبد خرید جمع کل سبد خرید
</Text> </Text>
<Text <Text
style={[ style={[
tw.style(""), tw.style(""),
{ fontSize: width / 31, color: "#246E8A", fontFamily: "bold"}, { fontSize: width / 31, color: "#246E8A", fontFamily: "bold" },
]} ]}
> >
235.000 تومان 235.000 تومان
@ -118,7 +134,10 @@ function ShoppingCart({}) {
]} ]}
> >
<Text <Text
style={[tw.style("mr-1"), { color: "#275077", fontSize: width / 36, fontFamily : 'light' }]} style={[
tw.style("mr-1"),
{ color: "#275077", fontSize: width / 36, fontFamily: "light" },
]}
> >
هزینه ارسال کالا پس از تعیین محل آدرس مشخص میشود هزینه ارسال کالا پس از تعیین محل آدرس مشخص میشود
</Text> </Text>

@ -30,7 +30,6 @@ const Season = ({ season }) => {
{ {
borderBottomWidth: 1, borderBottomWidth: 1,
borderColor: Colors.theme1.light.blue3, borderColor: Colors.theme1.light.blue3,
backgroundColor: Colors.theme1.light.blue8,
}, },
]} ]}
> >
@ -65,7 +64,6 @@ const Season = ({ season }) => {
{ {
borderLeftWidth: 1, borderLeftWidth: 1,
borderColor: Colors.theme1.light.blue3, borderColor: Colors.theme1.light.blue3,
backgroundColor: Colors.theme1.light.blue8,
}, },
]} ]}
onPress={() => navigation.navigate("VideoDisplay")} onPress={() => navigation.navigate("VideoDisplay")}
@ -94,7 +92,6 @@ const Season = ({ season }) => {
fontFamily: "regular", fontFamily: "regular",
fontSize: width / 34, fontSize: width / 34,
color: Colors.theme1.light.blue5, color: Colors.theme1.light.blue5,
backgroundColor: Colors.theme1.light.blue8,
}} }}
> >
دانلود دانلود

@ -70,7 +70,18 @@ function Product({
position: "relative", position: "relative",
}} }}
> >
<Navbar setBoxPosition={setBoxPosition} back={true} /> <Navbar
setBoxPosition={setBoxPosition}
headerOptions={{
logo: true,
menu: false,
hamburgerMenu: true,
title: "",
bookmark: false,
qr: true,
back: false,
}}
/>
<Drawer setBoxPosition={setBoxPosition} position={position} /> <Drawer setBoxPosition={setBoxPosition} position={position} />
<ScrollView <ScrollView
contentContainerStyle={styles.contentContainerStyle} contentContainerStyle={styles.contentContainerStyle}
@ -131,10 +142,10 @@ function Product({
<Divider type={"vertical"} /> <Divider type={"vertical"} />
</View> </View>
</View> </View>
<View style={tw('flex flex-col')}> <View style={tw("flex flex-col")}>
{ {product.seasons.map((season, index) => (
product.seasons.map((season, index) => <Season season={season} key={index} />) <Season season={season} key={index} />
} ))}
</View> </View>
</ScrollView> </ScrollView>
</SafeAreaView> </SafeAreaView>

@ -28,7 +28,6 @@ const Season = ({ season }) => {
{ {
borderBottomWidth: 1, borderBottomWidth: 1,
borderColor: Colors.theme1.light.blue3, borderColor: Colors.theme1.light.blue3,
backgroundColor: Colors.theme1.light.blue8,
}, },
]} ]}
> >
@ -49,6 +48,7 @@ const Season = ({ season }) => {
fontFamily: "regular", fontFamily: "regular",
fontSize: width / 36, fontSize: width / 36,
color: Colors.theme1.light.blue5, color: Colors.theme1.light.blue5,
backgroundColor : 'white',
}, },
]} ]}
> >
@ -63,7 +63,7 @@ const Season = ({ season }) => {
{ {
borderLeftWidth: 1, borderLeftWidth: 1,
borderColor: Colors.theme1.light.blue3, borderColor: Colors.theme1.light.blue3,
backgroundColor: Colors.theme1.light.blue8, backgroundColor: 'white',
}, },
]} ]}
onPress={() => navigation.navigate("VideoDisplay")} onPress={() => navigation.navigate("VideoDisplay")}
@ -92,7 +92,6 @@ const Season = ({ season }) => {
fontFamily: "regular", fontFamily: "regular",
fontSize: width / 34, fontSize: width / 34,
color: Colors.theme1.light.blue5, color: Colors.theme1.light.blue5,
backgroundColor: Colors.theme1.light.blue8,
}} }}
> >
دانلود دانلود

@ -11,9 +11,9 @@ import {
import { connect } from "react-redux"; import { connect } from "react-redux";
import Navbar from "../../components/Navbar"; import Navbar from "../../components/Navbar";
import Drawer from "../../components/Drawer"; import Drawer from "../../components/Drawer";
// import { Video, AVPlaybackStatus } from "expo-av"; import { Video, AVPlaybackStatus } from "expo-av";
import tw from "tailwind-rn"; import tw from "tailwind-rn";
import Season from './components/Season'; import Season from "./components/Season";
// import movie from "../../assets/video.mp4"; // import movie from "../../assets/video.mp4";
const { height, width } = Dimensions.get("window"); const { height, width } = Dimensions.get("window");
@ -64,14 +64,25 @@ function VideoDisplay({
position: "relative", position: "relative",
}} }}
> >
<Navbar setBoxPosition={setBoxPosition} back={true} /> <Navbar
setBoxPosition={setBoxPosition}
headerOptions={{
logo: false,
menu: true,
hamburgerMenu: false,
title: "",
bookmark: true,
qr: false,
back: true,
}}
/>
<Drawer setBoxPosition={setBoxPosition} position={position} /> <Drawer setBoxPosition={setBoxPosition} position={position} />
<ScrollView <ScrollView
contentContainerStyle={styles.contentContainerStyle} contentContainerStyle={styles.contentContainerStyle}
style={styles.container} style={styles.container}
> >
<View style={tw("flex flex-col")}> <View style={tw("flex flex-col")}>
{/* <Video <Video
ref={video} ref={video}
style={{ width: "100%", height: (width * 9) / 16 - 16 }} style={{ width: "100%", height: (width * 9) / 16 - 16 }}
source={product.video} source={product.video}
@ -79,7 +90,7 @@ function VideoDisplay({
resizeMode="cover" resizeMode="cover"
isLooping isLooping
onPlaybackStatusUpdate={(status) => setStatus(() => status)} onPlaybackStatusUpdate={(status) => setStatus(() => status)}
/> */} />
<Season season={product.season} /> <Season season={product.season} />
</View> </View>
</ScrollView> </ScrollView>
@ -99,4 +110,4 @@ const styles = StyleSheet.create({
paddingHorizontal: 16, paddingHorizontal: 16,
}, },
}); });
export default VideoDisplay; export default VideoDisplay;

@ -15,14 +15,14 @@ import Drawer from "../../components/Drawer";
import Search from "../../components/Search"; import Search from "../../components/Search";
import VerticalGradeFilter from "./components/VerticalGradeFilter"; import VerticalGradeFilter from "./components/VerticalGradeFilter";
import Divider from "../../components/Divider"; import Divider from "../../components/Divider";
import MostViewedVideo from './components/MostViewedVideo'; import MostViewedVideo from "./components/MostViewedVideo";
import NewestVideo from './components/NewestVideo'; import NewestVideo from "./components/NewestVideo";
//assets //assets
const width = Dimensions.get("window").width; const width = Dimensions.get("window").width;
function Videos(props) { function Videos(props) {
const [search, setSearch] = useState(""); const [search, setSearch] = useState("");
const [position, setPosition] = useState("100%"); const [position, setPosition] = useState("100%");
const setBoxPosition = () => { const setBoxPosition = () => {
@ -37,7 +37,18 @@ function Videos(props) {
position: "relative", position: "relative",
}} }}
> >
<Navbar setBoxPosition={setBoxPosition} /> <Navbar
setBoxPosition={setBoxPosition}
headerOptions={{
logo: true,
menu: false,
hamburgerMenu: true,
title: "",
bookmark: false,
qr: true,
back: false,
}}
/>
<Drawer setBoxPosition={setBoxPosition} position={position} /> <Drawer setBoxPosition={setBoxPosition} position={position} />
<ScrollView <ScrollView
contentContainerStyle={styles.contentContainerStyle} contentContainerStyle={styles.contentContainerStyle}
@ -49,9 +60,9 @@ function Videos(props) {
placeholder={"نام کتاب یا دوره را جستجو کنید"} placeholder={"نام کتاب یا دوره را جستجو کنید"}
/> />
<VerticalGradeFilter /> <VerticalGradeFilter />
<Divider type={'vertical'} /> <Divider type={"vertical"} />
<MostViewedVideo /> <MostViewedVideo />
<Divider type={'vertical'} /> <Divider type={"vertical"} />
<NewestVideo /> <NewestVideo />
</ScrollView> </ScrollView>
</SafeAreaView> </SafeAreaView>

@ -1446,6 +1446,11 @@
sudo-prompt "^9.0.0" sudo-prompt "^9.0.0"
wcwidth "^1.0.1" wcwidth "^1.0.1"
"@react-native-community/slider@4.1.12":
version "4.1.12"
resolved "https://registry.yarnpkg.com/@react-native-community/slider/-/slider-4.1.12.tgz#279ff7bbe487af92ad95ec758a029a54569e2a62"
integrity sha512-CiuLZ2orueBiWHYxfaJF57jQY6HY2Q3z5pdAE4MKH8EqIImr/jgDJrJ/UxOVZHK1Ng9P+XlGIKfVIcuWZ6guuA==
"@react-native/assets@1.0.0": "@react-native/assets@1.0.0":
version "1.0.0" version "1.0.0"
resolved "https://registry.yarnpkg.com/@react-native/assets/-/assets-1.0.0.tgz#c6f9bf63d274bafc8e970628de24986b30a55c8e" resolved "https://registry.yarnpkg.com/@react-native/assets/-/assets-1.0.0.tgz#c6f9bf63d274bafc8e970628de24986b30a55c8e"
@ -2842,6 +2847,13 @@ expo-asset@~8.4.5:
path-browserify "^1.0.0" path-browserify "^1.0.0"
url-parse "^1.4.4" url-parse "^1.4.4"
expo-av@^10.2.0:
version "10.2.0"
resolved "https://registry.yarnpkg.com/expo-av/-/expo-av-10.2.0.tgz#4bc4b1f409f3ad2e247586f22e4fb9e1aa666b0a"
integrity sha512-jo7Nv3IgJPAiOerKRwlL4guKkULZfvE5KIRZmgLurgPvJFHHAye4pFe2IlqQftKd66NHo1vq2zIGF3B3fsTPmw==
dependencies:
"@expo/config-plugins" "^4.0.2"
expo-barcode-scanner@~11.2.0: expo-barcode-scanner@~11.2.0:
version "11.2.0" version "11.2.0"
resolved "https://registry.yarnpkg.com/expo-barcode-scanner/-/expo-barcode-scanner-11.2.0.tgz#9d316a36962f74f117f19f7c722de1334a4fd8d2" resolved "https://registry.yarnpkg.com/expo-barcode-scanner/-/expo-barcode-scanner-11.2.0.tgz#9d316a36962f74f117f19f7c722de1334a4fd8d2"

Loading…
Cancel
Save