reza fixed some bugs

master
Reza_ashrafi 3 years ago
parent 5dc7b0d1bf
commit 95d927b727
  1. 4
      App.js
  2. 26
      navigation.js
  3. 54
      navigation/BottomNavigation.js
  4. 46
      navigation/index.js
  5. 6
      package.json
  6. 71
      src/components/Navbar.js
  7. 4
      src/components/Pressable.js
  8. 2
      src/components/Progress.js
  9. 4
      src/components/Search.js
  10. 2
      src/screens/Home/components/Blogs.js
  11. 2
      src/screens/Home/components/Header.js
  12. 40
      src/screens/Home/index.js
  13. 76
      src/screens/Product/index.js
  14. 12
      src/screens/Products/components/Book.js
  15. 65
      src/screens/Products/components/Video.js
  16. 102
      src/screens/Products/index.js
  17. 2
      src/screens/QR/Content/Links.js
  18. 2
      src/screens/QR/Content/PDF.js
  19. 2
      src/screens/QR/Content/PPT.js
  20. 40
      src/screens/QR/Scanner.js
  21. 145
      src/screens/QR/index.js
  22. 12
      src/screens/ShoppingCart/components/Product.js
  23. 110
      src/screens/ShoppingCart/index.js
  24. 6551
      yarn-error.log
  25. 59
      yarn.lock

@ -8,7 +8,7 @@ import thunk from "redux-thunk";
import { persistStore, persistReducer } from "redux-persist"; import { persistStore, persistReducer } from "redux-persist";
import autoMergeLevel2 from "redux-persist/lib/stateReconciler/autoMergeLevel2"; import autoMergeLevel2 from "redux-persist/lib/stateReconciler/autoMergeLevel2";
import allReducers from "./src/reducers"; import allReducers from "./src/reducers";
import Navigator from "./navigation"; import Navigation from "./navigation/index";
import AlertModal from "./src/components/AlertModal"; import AlertModal from "./src/components/AlertModal";
const persistConfig = { const persistConfig = {
@ -47,7 +47,7 @@ const App = () => {
return ( return (
<Provider store={store}> <Provider store={store}>
<Navigator /> <Navigation />
<AlertModal /> <AlertModal />
</Provider> </Provider>
); );

@ -10,7 +10,6 @@ import Product from './src/screens/Product';
import Products from './src/screens/Products'; import Products from './src/screens/Products';
import ShoppingCart from './src/screens/ShoppingCart'; import ShoppingCart from './src/screens/ShoppingCart';
import QR from './src/screens/QR/index'; import QR from './src/screens/QR/index';
import {connect} from 'react-redux';
import i18n from './src/services/i18n'; import i18n from './src/services/i18n';
import {useTranslation} from 'react-i18next'; import {useTranslation} from 'react-i18next';
import Profile from './src/screens/Profile'; import Profile from './src/screens/Profile';
@ -29,40 +28,27 @@ const Stack = createNativeStackNavigator();
const Tab = createBottomTabNavigator(); const Tab = createBottomTabNavigator();
function BottomTab(props) { function BottomTab(props) {
const {t} = useTranslation('translation', {keyPrefix: 'main'});
return ( return (
<Tab.Navigator initialRouteName={'Home'}> <Tab.Navigator initialRouteName={'Home'}>
<Tab.Screen <Tab.Screen
name={'Profile'} name={'Profile'}
component={Profile} component={Profile}
options={{
title: t('profile'),
}}
/> />
<Tab.Screen <Tab.Screen
name={'Exams'} name={'Exams'}
component={Exams} component={Exams}
options={{
title: t('exams'),
}}
/> />
<Tab.Screen <Tab.Screen
name={'Videos'} name={'Videos'}
component={Videos} component={Videos}
options={{
title: t('videos'),
}}
/> />
<Tab.Screen <Tab.Screen
name={'OrderDetails'} name={'محصولات'}
component={OrderDetails} component={Products}
options={{
title: t('books'),
}}
/> />
<Tab.Screen <Tab.Screen
name={'Home'} name={'خانه'}
component={Home} component={Home}
options={{ options={{
headerShown : false headerShown : false
@ -75,7 +61,7 @@ function BottomTab(props) {
function Navigator(props) { function Navigator(props) {
React.useEffect(() => { React.useEffect(() => {
i18n.changeLanguage(props.config.lan); // i18n.changeLanguage(props.config.lan);
}, [props.config]); }, [props.config]);
return ( return (
@ -113,7 +99,7 @@ function Navigator(props) {
/> />
<Stack.Screen <Stack.Screen
name="Products" name="Products"
component={Products} component={BottomTab}
options={{headerShown: false}} options={{headerShown: false}}
/> />
<Stack.Screen name="QR" component={QR} options={{headerShown: true}} /> <Stack.Screen name="QR" component={QR} options={{headerShown: true}} />
@ -127,4 +113,4 @@ function Navigator(props) {
); );
} }
export default connect(mapStateToProps)(Navigator); export default Navigator;

@ -0,0 +1,54 @@
import React from "react";
import { createBottomTabNavigator } from "@react-navigation/bottom-tabs";
import Home from "../src/screens/Home";
import ShoppingCart from '../src/screens/ShoppingCart';
import Products from "../src/screens/Products";
import { Entypo, FontAwesome } from "@expo/vector-icons";
const Tab = createBottomTabNavigator();
const BottomTabNavigator = () => {
return (
<Tab.Navigator
initialRouteName="Home"
screenOptions={{
headerShown: false,
tabBarActiveTintColor: "white",
tabBarInactiveTintColor: "grey",
tabBarStyle: {
backgroundColor: "#181818",
},
}}
>
<Tab.Screen
name="Home"
component={Home}
options={{
tabBarIcon: ({ focused, color }) => (
<Entypo name="home" size={focused ? 30 : 25} color={color} />
),
}}
/>
<Tab.Screen
name="Products"
component={Products}
options={{
tabBarIcon: ({ focused, color }) => (
<Entypo name="shop" size={focused ? 30 : 25} color={color} />
),
}}
/>
<Tab.Screen
name="ShoppingCart"
component={ShoppingCart}
options={{
tabBarIcon: ({ focused, color }) => (
<FontAwesome name="shopping-cart" size={focused ? 30 : 25} color={color} />
),
}}
/>
</Tab.Navigator>
);
};
export default BottomTabNavigator;

@ -0,0 +1,46 @@
import React from "react";
import { NavigationContainer } from "@react-navigation/native";
import { createNativeStackNavigator } from "@react-navigation/native-stack";
import BottomTabNavigator from "./BottomNavigation";
import Splash from "../src/screens/Splash";
import Home from "../src/screens/Home";
import Login from "../src/screens/Login";
import Otp from "../src/screens/Otp";
import Product from "../src/screens/Product";
import QR from "../src/screens/QR/index";
import { connect } from "react-redux";
import i18n from "../src/services/i18n";
import { useTranslation } from "react-i18next";
import Profile from "../src/screens/Profile";
import Videos from "../src/screens/Videos";
import Exams from "../src/screens/Exams";
import OrderDetails from "../src/screens/OrderDetails";
const Stack = createNativeStackNavigator();
const Navigation = () => {
return (
<NavigationContainer>
<Stack.Navigator
initialRouteName="Root"
screenOptions={{ headerShown: false }}
>
<Stack.Screen name="Root" component={BottomTabNavigator} />
<Stack.Screen name="Product" component={Product} />
<Stack.Screen name="Login" component={Login} />
<Stack.Screen name="Otp" component={Otp} />
<Stack.Screen name="Splash" component={Splash} />
<Stack.Screen name="QR" component={QR} />
</Stack.Navigator>
</NavigationContainer>
);
};
const mapStateToProps = (state) => {
return {
profile: state.profile,
config: state.config,
};
};
export default connect(mapStateToProps)(Navigation);

@ -14,16 +14,20 @@
"@react-navigation/bottom-tabs": "^6.0.9", "@react-navigation/bottom-tabs": "^6.0.9",
"@react-navigation/native": "^6.0.6", "@react-navigation/native": "^6.0.6",
"@react-navigation/native-stack": "^6.2.5", "@react-navigation/native-stack": "^6.2.5",
"expo": "~44.0.0", "expo": "^44.0.1",
"expo-barcode-scanner": "~11.2.0",
"expo-camera": "~12.1.0",
"expo-device": "~4.1.0", "expo-device": "~4.1.0",
"expo-status-bar": "~1.2.0", "expo-status-bar": "~1.2.0",
"i18next": "^21.6.3", "i18next": "^21.6.3",
"install": "^0.13.0",
"lodash": "^4.17.21", "lodash": "^4.17.21",
"react": "17.0.1", "react": "17.0.1",
"react-dom": "17.0.1", "react-dom": "17.0.1",
"react-i18next": "^11.15.1", "react-i18next": "^11.15.1",
"react-native": "0.64.3", "react-native": "0.64.3",
"react-native-awesome-alerts": "^1.5.2", "react-native-awesome-alerts": "^1.5.2",
"react-native-qrcode-scanner": "^1.5.4",
"react-native-restart": "^0.0.22", "react-native-restart": "^0.0.22",
"react-native-safe-area-context": "3.3.2", "react-native-safe-area-context": "3.3.2",
"react-native-screens": "~3.10.1", "react-native-screens": "~3.10.1",

@ -1,64 +1,79 @@
import React, {useCallback} from 'react'; import React, { useCallback } from "react";
import {Image, StyleSheet, View, TouchableOpacity} from 'react-native'; import {
import {useNavigation} from '@react-navigation/native'; Image,
import tw from 'tailwind-rn'; StyleSheet,
View,
Pressable,
} from "react-native";
import { useNavigation } from "@react-navigation/native";
import tw from "tailwind-rn";
//colors //colors
import Color from '../constants/Colors'; import Color from "../constants/Colors";
//assets //assets
import hamburgerLightIcon from '../assets/icons/hamburger-light.png'; import hamburgerLightIcon from "../assets/icons/hamburger-light.png";
import logoIcon from '../assets/icons/logo.png'; 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}) => { const Navbar = ({ notification }) => {
const navigation = useNavigation(); const navigation = useNavigation();
const Button = useCallback(({icon, route}) => { const Button = useCallback(({ icon, route }) => {
return ( return (
<TouchableOpacity <Pressable
style={[ style={[
tw('rounded-sm p-1'), tw("rounded-sm p-1"),
{ {
backgroundColor: Color.theme1.light.blue1, backgroundColor: Color.theme1.light.blue1,
borderColor: Color.theme1.light.blue2, borderColor: Color.theme1.light.blue2,
borderWidth: 1, borderWidth: 1,
marginLeft : route === 'ar' ? 10 : 0 marginLeft: route === "ar" ? 10 : 0,
}, },
]} ]}
onPress={() => navigation.navigate(route)}> onPress={() => navigation.navigate(route)}
<Image source={icon} style={{width: 20, height: 20}} /> >
</TouchableOpacity> <Image source={icon} style={{ width: 20, height: 20 }} />
</Pressable>
); );
}, []); }, []);
return ( return (
<View <View
style={tw( style={tw(
'w-full flex flex-row-reverse justify-between h-16 bg-white items-center px-4 relative', "w-full flex flex-row-reverse justify-between h-16 bg-white items-center px-4 relative"
)}> )}
<View style={tw('relative')}> >
<Image source={hamburgerLightIcon} style={{width: 29.5, height: 27}} /> <View style={tw("relative")}>
<Image
source={hamburgerLightIcon}
style={{ width: 29.5, height: 27 }}
/>
{notification && ( {notification && (
<View <View
style={tw( style={tw(
'h-2.5 w-2.5 absolute -left-1 -top-1 bg-red-500 rounded-full', "h-2.5 w-2.5 absolute -left-1 -top-1 bg-red-500 rounded-full"
)}></View> )}
></View>
)} )}
</View> </View>
<Pressable
onPress={() => navigation.navigate("Home")}
style={tw("absolute right-1/2 top-1/2")}
>
<Image <Image
source={logoIcon} source={logoIcon}
style={[ style={[
tw('absolute right-1/2 top-1/2'),
{ {
width: 19.6, width: 19.6,
height: 28.9, height: 28.9,
transform: [{translateX: 0}, {translateY: -14.5}], transform: [{ translateX: 0 }, { translateY: -14.5 }],
}, },
]} ]}
/> />
<View style={tw('flex flex-row items-center')}> </Pressable>
<Button icon={qrLightIcon} route={'qr'} /> <View style={tw("flex flex-row items-center")}>
<Button icon={arLightIcon} route={'ar'} /> <Button icon={qrLightIcon} route={"QR"} />
<Button icon={arLightIcon} route={"ar"} />
</View> </View>
</View> </View>
); );

@ -14,7 +14,7 @@ export default function Pressable1({
return ( return (
<Pressable <Pressable
style={[ style={[
tw.style('rounded-md py-4 flex flex-row justify-center mb-3'), tw.style('rounded-md py-3 flex flex-row justify-center mb-3'),
{ {
backgroundColor: backgroundColor, backgroundColor: backgroundColor,
borderWidth: border.width, borderWidth: border.width,
@ -22,7 +22,7 @@ export default function Pressable1({
width : width, width : width,
}, },
]}> ]}>
<Text style={{fontSize: fullWidth / 27, color: color}}>{title}</Text> <Text style={{fontSize: 14, color: color}}>{title}</Text>
</Pressable> </Pressable>
); );
} }

@ -20,7 +20,7 @@ function Progress({percent}) {
]}> ]}>
<View <View
style={[ style={[
tw('h-full transition-all duration-500 rounded-full'), tw('h-full rounded-full'),
{ {
backgroundColor: Color.theme1.light.blue3, backgroundColor: Color.theme1.light.blue3,
width: percent + '%', width: percent + '%',

@ -24,7 +24,7 @@ const Search = ({
color: '#000', color: '#000',
borderWidth: 0.5, borderWidth: 0.5,
borderColor: '#DBDBDB', borderColor: '#DBDBDB',
paddingVertical: 16, paddingVertical: 4,
paddingHorizontal: 10, paddingHorizontal: 10,
direction: direction, direction: direction,
textAlign: textAlign, textAlign: textAlign,
@ -40,7 +40,7 @@ const Search = ({
placeholderTextColor={'#cccccc'} placeholderTextColor={'#cccccc'}
value={value} value={value}
/> />
<Pressable style={tw.style('absolute left-3 top-0 transform inset-y-4')}> <Pressable style={tw.style('absolute left-3 top-0 transform inset-y-2')}>
<Image source={searchIcon} style={[{width: 20, height: 20}]} /> <Image source={searchIcon} style={[{width: 20, height: 20}]} />
</Pressable> </Pressable>
</View> </View>

@ -32,7 +32,7 @@ function Blogs({products}) {
<FlatList <FlatList
horizontal={true} horizontal={true}
inverted={true} inverted={true}
style={[tw('flex flex-col-reverse mt-3')]} style={[tw('flex flex-row mt-3')]}
data={products} data={products}
renderItem={({blog, index}) => <Blog blog={blog} key={index} />} renderItem={({blog, index}) => <Blog blog={blog} key={index} />}
/> />

@ -12,7 +12,7 @@ const Header = ({title, route}) => {
return ( return (
<View style={tw('w-full flex flex-row-reverse justify-between mb-2')}> <View style={tw('w-full flex flex-row-reverse justify-between mb-2')}>
<Text <Text
style={[tw('text-2xl font-bold'), {color: Color.theme1.light.blue5}]}> style={[tw('text-lg font-bold'), {color: Color.theme1.light.blue5}]}>
{title} {title}
</Text> </Text>
<Pressable onPress={() => navigation.navigate(route)}> <Pressable onPress={() => navigation.navigate(route)}>

@ -1,34 +1,36 @@
import React from 'react'; import React from "react";
import {useTranslation} from 'react-i18next'; import { useTranslation } from "react-i18next";
import { import {
View, View,
StyleSheet, StyleSheet,
Dimensions, Dimensions,
ScrollView, ScrollView,
SafeAreaView, SafeAreaView,
} from 'react-native'; Platform,
import Navbar from '../../components/Navbar'; StatusBar,
import tw from 'tailwind-rn'; } from "react-native";
import Scroll from './components/Scroll'; import Navbar from "../../components/Navbar";
import MyBooks from './components/MyBooks'; import tw from "tailwind-rn";
import Videos from './components/Videos'; import Scroll from "./components/Scroll";
import Blogs from './components/Blogs'; import MyBooks from "./components/MyBooks";
import Videos from "./components/Videos";
import Blogs from "./components/Blogs";
import qrIcon from './assets/qr.png';
import arIcon from './assets/ar.png';
// import { SafeAreaView } from 'react-native-safe-area-context'; // import { SafeAreaView } from 'react-native-safe-area-context';
// Within your render function // Within your render function
function Home(props) { function Home(props) {
return ( return (
<SafeAreaView> <SafeAreaView
style={{
paddingTop: Platform.OS === "android" ? StatusBar.currentHeight : 0
}}
>
<Navbar /> <Navbar />
<ScrollView <ScrollView
contentContainerStyle={styles.contentContainerStyle} contentContainerStyle={styles.contentContainerStyle}
style={[ style={[styles.container, tw("w-full flex flex-col")]}
styles.container, >
tw('w-full flex flex-col'),
]}>
<MyBooks /> <MyBooks />
<Scroll /> <Scroll />
<Videos /> <Videos />
@ -44,9 +46,9 @@ const styles = StyleSheet.create({
paddingBottom: 100, paddingBottom: 100,
}, },
container: { container: {
width: Dimensions.get('window').width, width: Dimensions.get("window").width,
backgroundColor: 'white', backgroundColor: "white",
flexDirection: 'column', flexDirection: "column",
paddingVertical: 0, paddingVertical: 0,
paddingHorizontal: 0, paddingHorizontal: 0,
}, },

@ -1,74 +1,90 @@
import React from 'react'; import React from "react";
import {View, StyleSheet, Dimensions, ScrollView} from 'react-native'; import {
import Book from './components/Book'; View,
import Video from './components/Video'; StyleSheet,
import {connect} from 'react-redux'; Dimensions,
import userImage from './assets/user.png'; ScrollView,
import poster from './assets/poster.png'; SafeAreaView,
StatusBar,
} from "react-native";
import Book from "./components/Book";
import Video from "./components/Video";
import { connect } from "react-redux";
import userImage from "./assets/user.png";
import poster from "./assets/poster.png";
import Navbar from "../../components/Navbar";
function Product({ function Product({
product = { product = {
type: 'ویدئوها', type: "ویدئوها",
name: 'ریاضی', name: "ریاضی",
price: '145.000 تومان', price: "145.000 تومان",
imageUrl: 'https://dnvn.ir/api/v1/file/2105', imageUrl: "https://dnvn.ir/api/v1/file/2105",
poster : poster, poster: poster,
grade: 'پایه هفتم ابتدایی', grade: "پایه هفتم ابتدایی",
text: 'خالد حسینی تو رمان باد بادک باز مینویسه : ﻣﺮﺩ ﺁﻫﺴﺘﻪ ﺩﺭ ﮔﻮﺵ ﻓﺮﺯﻧﺪ ﺗﺎﺯﻩ ﺑﻪ ﺑﻠﻮﻍ ﺭﺳﯿﺪﻩ ﺍﺵ ﺑﺮﺍﯼ ﭘﻨﺪ ﭼﻨﯿﻦ ﻧﺠﻮﺍ ﮐﺮﺩ : ” ﭘﺴﺮﻡ ﺩﺭ ﺯﻧﺪﮔﯽ ﻫﺮﮔﺰ ﺩﺯﺩﯼ ﻧﮑﻦ ” ﭘﺴﺮ ﻣﺘﻌﺠﺐ ﻭ ﻣﺒﻬﻮﺕ ﺑﻪ ﭘﺪﺭ ﻧﮕﺎﻩ ﮐﺮﺩ ﺑﺪﯾﻦ ', text: "خالد حسینی تو رمان باد بادک باز مینویسه : ﻣﺮﺩ ﺁﻫﺴﺘﻪ ﺩﺭ ﮔﻮﺵ ﻓﺮﺯﻧﺪ ﺗﺎﺯﻩ ﺑﻪ ﺑﻠﻮﻍ ﺭﺳﯿﺪﻩ ﺍﺵ ﺑﺮﺍﯼ ﭘﻨﺪ ﭼﻨﯿﻦ ﻧﺠﻮﺍ ﮐﺮﺩ : ” ﭘﺴﺮﻡ ﺩﺭ ﺯﻧﺪﮔﯽ ﻫﺮﮔﺰ ﺩﺯﺩﯼ ﻧﮑﻦ ” ﭘﺴﺮ ﻣﺘﻌﺠﺐ ﻭ ﻣﺒﻬﻮﺕ ﺑﻪ ﭘﺪﺭ ﻧﮕﺎﻩ ﮐﺮﺩ ﺑﺪﯾﻦ ",
description: description:
'خالد حسینی تو رمان باد بادک باز مینویسه : ﻣﺮﺩ ﺁﻫﺴﺘﻪ ﺩﺭ ﮔﻮﺵ ﻓﺮﺯﻧﺪ ﺗﺎﺯﻩ ﺑﻪ ﺑﻠﻮﻍ ﺭﺳﯿﺪﻩ ﺍﺵ ﺑﺮﺍﯼ ﭘﻨﺪ ﭼﻨﯿﻦ ﻧﺠﻮﺍ ﮐﺮﺩ : ” ﭘﺴﺮﻡ ﺩﺭ ﺯﻧﺪﮔﯽ ﻫﺮﮔﺰ ﺩﺯﺩﯼ ﻧﮑﻦ ” ﭘﺴﺮ ﻣﺘﻌﺠﺐ ﻭ ﻣﺒﻬﻮﺕ ﺑﻪ ﭘﺪﺭ ﻧﮕﺎﻩ ﮐﺮﺩ ﺑﺪﯾﻦ ﻣﻌﻨﺎ ﮐﻪ ﺍﻭ ﻫﺮﮔﺰ ﺩﺳﺖ ﮐﺞ ﻧﺪﺍﺷﺘﻪ ﭘﺪﺭ ﺑﻪ ﻧﮕﺎﻩ ﻣﺘﻌﺠﺐ ﻓﺮﺯﻧﺪ ﻟﺒﺨﻨﺪﯼ ﺯﺩ ﻭ ﺍﺩﺍﻣﻪ ﺩﺍﺩ : ﺩﺭ ﺯﻧﺪﮔﯽ ﺩﺭﻭﻍ ﻧﮕﻮ ﭼﺮﺍ ﮐﻪ ﺍﮔﺮ ﮔﻔﺘﯽ ﺻﺪﺍﻗﺖ ﺭﺍ ﺩﺯﺩﯾﺪﻩ ﺍﯼ، ﺧﯿﺎﻧﺖ ﻧﮑﻦ ﮐﻪ ﺍﮔﺮ ﮐﺮﺩﯼ ﻋﺸﻖ ﺭﺍ ﺩﺯﺩﯾﺪﻩ ﺍﯼ، ﺧﺸﻮﻧﺖ ﻧﮑﻦ ﺍﮔﺮ ﮐﺮﺩﯼ ﻣﺤﺒﺖ ﺭﺍ ﺩﺯﺩﯾﺪﻩ ﺍﯼ، ﻧﺎ ﺣﻖ ﻧﮕﻮ ﺍﮔﺮ ﮔﻔﺘﯽ ﺣﻖ ﺭﺍ ﺩﺯﺩﯾﺪﻩ ﺍﯼ، ﺑﯽ ﺣﯿﺎﯾﯽ ﻧﮑﻦ ﺍﮔﺮ ﮐﺮﺩﯼ ﺷﺮﺍﻓﺖ ﺭﺍ ﺩﺯﺩﯾﺪﻩ ﺍی... ﭘﺲ ﺩﺭ ﺯﻧﺪﮔﯽ ﻓﻘﻂ ﺩﺯﺩﯼ نکن ', "خالد حسینی تو رمان باد بادک باز مینویسه : ﻣﺮﺩ ﺁﻫﺴﺘﻪ ﺩﺭ ﮔﻮﺵ ﻓﺮﺯﻧﺪ ﺗﺎﺯﻩ ﺑﻪ ﺑﻠﻮﻍ ﺭﺳﯿﺪﻩ ﺍﺵ ﺑﺮﺍﯼ ﭘﻨﺪ ﭼﻨﯿﻦ ﻧﺠﻮﺍ ﮐﺮﺩ : ” ﭘﺴﺮﻡ ﺩﺭ ﺯﻧﺪﮔﯽ ﻫﺮﮔﺰ ﺩﺯﺩﯼ ﻧﮑﻦ ” ﭘﺴﺮ ﻣﺘﻌﺠﺐ ﻭ ﻣﺒﻬﻮﺕ ﺑﻪ ﭘﺪﺭ ﻧﮕﺎﻩ ﮐﺮﺩ ﺑﺪﯾﻦ ﻣﻌﻨﺎ ﮐﻪ ﺍﻭ ﻫﺮﮔﺰ ﺩﺳﺖ ﮐﺞ ﻧﺪﺍﺷﺘﻪ ﭘﺪﺭ ﺑﻪ ﻧﮕﺎﻩ ﻣﺘﻌﺠﺐ ﻓﺮﺯﻧﺪ ﻟﺒﺨﻨﺪﯼ ﺯﺩ ﻭ ﺍﺩﺍﻣﻪ ﺩﺍﺩ : ﺩﺭ ﺯﻧﺪﮔﯽ ﺩﺭﻭﻍ ﻧﮕﻮ ﭼﺮﺍ ﮐﻪ ﺍﮔﺮ ﮔﻔﺘﯽ ﺻﺪﺍﻗﺖ ﺭﺍ ﺩﺯﺩﯾﺪﻩ ﺍﯼ، ﺧﯿﺎﻧﺖ ﻧﮑﻦ ﮐﻪ ﺍﮔﺮ ﮐﺮﺩﯼ ﻋﺸﻖ ﺭﺍ ﺩﺯﺩﯾﺪﻩ ﺍﯼ، ﺧﺸﻮﻧﺖ ﻧﮑﻦ ﺍﮔﺮ ﮐﺮﺩﯼ ﻣﺤﺒﺖ ﺭﺍ ﺩﺯﺩﯾﺪﻩ ﺍﯼ، ﻧﺎ ﺣﻖ ﻧﮕﻮ ﺍﮔﺮ ﮔﻔﺘﯽ ﺣﻖ ﺭﺍ ﺩﺯﺩﯾﺪﻩ ﺍﯼ، ﺑﯽ ﺣﯿﺎﯾﯽ ﻧﮑﻦ ﺍﮔﺮ ﮐﺮﺩﯼ ﺷﺮﺍﻓﺖ ﺭﺍ ﺩﺯﺩﯾﺪﻩ ﺍی... ﭘﺲ ﺩﺭ ﺯﻧﺪﮔﯽ ﻓﻘﻂ ﺩﺯﺩﯼ نکن ",
rates: { rates: {
mid: 4.5, mid: 4.5,
allRates: 2456, allRates: 2456,
fields: [ fields: [
{name: 'field1', value: 49}, { name: "field1", value: 49 },
{name: 'field2', value: 31}, { name: "field2", value: 31 },
{name: 'field3', value: 9}, { name: "field3", value: 9 },
{name: 'field4', value: 5}, { name: "field4", value: 5 },
{name: 'field5', value: 4}, { name: "field5", value: 4 },
], ],
}, },
comments: [ comments: [
{ {
name: 'سورنا عابدی', name: "سورنا عابدی",
imageUrl: userImage, imageUrl: userImage,
vote: 4, vote: 4,
date: new Date(), date: new Date(),
message: message:
'خالد حسینی تو رمان باد بادک باز مینویسه : ﻣﺮﺩ ﺁﻫﺴﺘﻪ ﺩﺭ ﮔﻮﺵ ﻓﺮﺯﻧﺪ ﺗﺎﺯﻩ ﺑﻪ ﺑﻠﻮﻍ ﺭﺳﯿﺪﻩ ﺍﺵ ﺑﺮﺍﯼ ﭘﻨﺪ ﭼﻨﯿﻦ ﻧﺠﻮﺍ ﮐﺮﺩ : ” ﭘﺴﺮﻡ ﺩﺭ ﺯﻧﺪﮔﯽ ﻫﺮﮔﺰ ﺩﺯﺩﯼ ﻧﮑﻦ ” ﭘﺴﺮ ﻣﺘﻌﺠﺐ ﻭ ﻣﺒﻬﻮﺕ ﺑﻪ ﭘﺪﺭ ﻧﮕﺎﻩ ﮐﺮﺩ ﺑﺪﯾﻦ ﻣﻌﻨﺎ ﮐﻪ ﺍﻭ ﻫﺮﮔﺰ ﺩﺳﺖ ﮐﺞ ﻧﺪﺍﺷﺘﻪ ﭘﺪﺭ ﺑﻪ ﻧﮕﺎﻩ ﻣﺘﻌﺠﺐ ﻓﺮﺯﻧﺪ ﻟﺒﺨﻨﺪﯼ ﺯﺩ ﻭ ﺍﺩﺍﻣﻪ ', "خالد حسینی تو رمان باد بادک باز مینویسه : ﻣﺮﺩ ﺁﻫﺴﺘﻪ ﺩﺭ ﮔﻮﺵ ﻓﺮﺯﻧﺪ ﺗﺎﺯﻩ ﺑﻪ ﺑﻠﻮﻍ ﺭﺳﯿﺪﻩ ﺍﺵ ﺑﺮﺍﯼ ﭘﻨﺪ ﭼﻨﯿﻦ ﻧﺠﻮﺍ ﮐﺮﺩ : ” ﭘﺴﺮﻡ ﺩﺭ ﺯﻧﺪﮔﯽ ﻫﺮﮔﺰ ﺩﺯﺩﯼ ﻧﮑﻦ ” ﭘﺴﺮ ﻣﺘﻌﺠﺐ ﻭ ﻣﺒﻬﻮﺕ ﺑﻪ ﭘﺪﺭ ﻧﮕﺎﻩ ﮐﺮﺩ ﺑﺪﯾﻦ ﻣﻌﻨﺎ ﮐﻪ ﺍﻭ ﻫﺮﮔﺰ ﺩﺳﺖ ﮐﺞ ﻧﺪﺍﺷﺘﻪ ﭘﺪﺭ ﺑﻪ ﻧﮕﺎﻩ ﻣﺘﻌﺠﺐ ﻓﺮﺯﻧﺪ ﻟﺒﺨﻨﺪﯼ ﺯﺩ ﻭ ﺍﺩﺍﻣﻪ ",
}, },
{ {
name: 'سورنا عابدی', name: "سورنا عابدی",
imageUrl: userImage, imageUrl: userImage,
vote: 4, vote: 4,
date: new Date(), date: new Date(),
message: message:
'خالد حسینی تو رمان باد بادک باز مینویسه : ﻣﺮﺩ ﺁﻫﺴﺘﻪ ﺩﺭ ﮔﻮﺵ ﻓﺮﺯﻧﺪ ﺗﺎﺯﻩ ﺑﻪ ﺑﻠﻮﻍ ﺭﺳﯿﺪﻩ ﺍﺵ ﺑﺮﺍﯼ ﭘﻨﺪ ﭼﻨﯿﻦ ﻧﺠﻮﺍ ﮐﺮﺩ : ” ﭘﺴﺮﻡ ﺩﺭ ﺯﻧﺪﮔﯽ ﻫﺮﮔﺰ ﺩﺯﺩﯼ ﻧﮑﻦ ” ﭘﺴﺮ ﻣﺘﻌﺠﺐ ﻭ ﻣﺒﻬﻮﺕ ﺑﻪ ﭘﺪﺭ ﻧﮕﺎﻩ ﮐﺮﺩ ﺑﺪﯾﻦ ﻣﻌﻨﺎ ﮐﻪ ﺍﻭ ﻫﺮﮔﺰ ﺩﺳﺖ ﮐﺞ ﻧﺪﺍﺷﺘﻪ ﭘﺪﺭ ﺑﻪ ﻧﮕﺎﻩ ﻣﺘﻌﺠﺐ ﻓﺮﺯﻧﺪ ﻟﺒﺨﻨﺪﯼ ﺯﺩ ﻭ ﺍﺩﺍﻣﻪ ', "خالد حسینی تو رمان باد بادک باز مینویسه : ﻣﺮﺩ ﺁﻫﺴﺘﻪ ﺩﺭ ﮔﻮﺵ ﻓﺮﺯﻧﺪ ﺗﺎﺯﻩ ﺑﻪ ﺑﻠﻮﻍ ﺭﺳﯿﺪﻩ ﺍﺵ ﺑﺮﺍﯼ ﭘﻨﺪ ﭼﻨﯿﻦ ﻧﺠﻮﺍ ﮐﺮﺩ : ” ﭘﺴﺮﻡ ﺩﺭ ﺯﻧﺪﮔﯽ ﻫﺮﮔﺰ ﺩﺯﺩﯼ ﻧﮑﻦ ” ﭘﺴﺮ ﻣﺘﻌﺠﺐ ﻭ ﻣﺒﻬﻮﺕ ﺑﻪ ﭘﺪﺭ ﻧﮕﺎﻩ ﮐﺮﺩ ﺑﺪﯾﻦ ﻣﻌﻨﺎ ﮐﻪ ﺍﻭ ﻫﺮﮔﺰ ﺩﺳﺖ ﮐﺞ ﻧﺪﺍﺷﺘﻪ ﭘﺪﺭ ﺑﻪ ﻧﮕﺎﻩ ﻣﺘﻌﺠﺐ ﻓﺮﺯﻧﺪ ﻟﺒﺨﻨﺪﯼ ﺯﺩ ﻭ ﺍﺩﺍﻣﻪ ",
}, },
], ],
}, },
}) { }) {
return ( return (
<SafeAreaView
style={{
paddingTop: Platform.OS === "android" ? StatusBar.currentHeight : 0,
}}
>
<Navbar />
<ScrollView <ScrollView
contentContainerStyle={styles.contentContainerStyle} contentContainerStyle={styles.contentContainerStyle}
style={styles.container}> style={styles.container}
{product.type === 'ویدئوها' ? ( >
{product.type === "ویدئوها" ? (
<Video product={product} /> <Video product={product} />
) : ( ) : (
<Book product={product} /> <Book product={product} />
)} )}
</ScrollView> </ScrollView>
</SafeAreaView>
); );
} }
const styles = StyleSheet.create({ const styles = StyleSheet.create({
contentContainerStyle: { contentContainerStyle: {
paddingBottom: 50, paddingBottom: 100,
}, },
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: 10,
}, },

@ -1,5 +1,6 @@
import React from 'react'; import React from 'react';
import {View, Image, Text, Dimensions} from 'react-native'; import {View, Image, Text, Dimensions, Pressable} from 'react-native';
import { useNavigation } from '@react-navigation/native';
import tw from 'tailwind-react-native-classnames'; import tw from 'tailwind-react-native-classnames';
const width = Dimensions.get('window').width; const width = Dimensions.get('window').width;
const height = Dimensions.get('window').height; const height = Dimensions.get('window').height;
@ -12,8 +13,9 @@ function Book({
imageUrl: 'https://dnvn.ir/api/v1/file/2105', imageUrl: 'https://dnvn.ir/api/v1/file/2105',
}, },
}) { }) {
const navigation = useNavigation();
return ( return (
<View <Pressable
style={[ style={[
{ {
width: width / 2 - 20, width: width / 2 - 20,
@ -26,7 +28,9 @@ function Book({
borderColor: '#ddd', borderColor: '#ddd',
}, },
tw.style('flex flex-col items-end p-2 rounded-md'), tw.style('flex flex-col items-end p-2 rounded-md'),
]}> ]}
onPress={() => navigation.navigate('Product')}
>
<Image <Image
source={{uri: item.imageUrl}} source={{uri: item.imageUrl}}
style={[tw.style('w-full rounded-md'), {height: height / 3.8}]} style={[tw.style('w-full rounded-md'), {height: height / 3.8}]}
@ -36,7 +40,7 @@ function Book({
</Text> </Text>
<Text style={{ color : "#196EC0", fontSize : width / 32, marginTop : 5}}>{'پایه' + ' ' + item.grade }</Text> <Text style={{ color : "#196EC0", fontSize : width / 32, marginTop : 5}}>{'پایه' + ' ' + item.grade }</Text>
<Text style={[tw.style('w-full text-center font-semibold'), {marginTop : 10, color : "#132F52"}]}>{item.price}</Text> <Text style={[tw.style('w-full text-center font-semibold'), {marginTop : 10, color : "#132F52"}]}>{item.price}</Text>
</View> </Pressable>
); );
} }

@ -1,22 +1,24 @@
import React from 'react'; import React from "react";
import {View, Image, Text, Dimensions} from 'react-native'; import { View, Image, Text, Dimensions, Pressable } from "react-native";
import tw from 'tailwind-react-native-classnames'; import { useNavigation } from "@react-navigation/native";
import posterImage from '../assets/poster.png'; import tw from "tailwind-react-native-classnames";
import posterImage from "../assets/poster.png";
const width = Dimensions.get('window').width; const width = Dimensions.get("window").width;
const height = Dimensions.get('window').height; const height = Dimensions.get("window").height;
function Video({ function Video({
item = { item = {
name: 'ریاضی', name: "ریاضی",
price: '145.000 تومان', price: "145.000 تومان",
grade: '4', grade: "4",
imageUrl: 'https://dnvn.ir/api/v1/file/2105', imageUrl: "https://dnvn.ir/api/v1/file/2105",
poster: posterImage, poster: posterImage,
}, },
}) { }) {
const navigation = useNavigation();
return ( return (
<View <Pressable
style={[ style={[
{ {
// shadowColor : "#000", // shadowColor : "#000",
@ -25,17 +27,20 @@ function Video({
// shadowOpacity : 1, // shadowOpacity : 1,
marginBottom: 15, marginBottom: 15,
borderWidth: 1, borderWidth: 1,
borderColor: '#ddd', borderColor: "#ddd",
}, },
tw.style('w-full flex flex-col items-end p-2 rounded-md'), tw.style("w-full flex flex-col items-end p-2 rounded-md"),
]}> ]}
onPress={() => navigation.navigate("Product")}
>
<View <View
style={[ style={[
tw.style( tw.style(
'w-full flex flex-row flex-1 justify-between items-center relative overflow-hidden', "w-full flex flex-row flex-1 justify-between items-center relative overflow-hidden"
), ),
{height: height / 3.8}, { height: height / 3.8 },
]}> ]}
>
{/* <View {/* <View
style={[ style={[
tw.style('rounded-full bg-black bg-opacity-20 z-50'), tw.style('rounded-full bg-black bg-opacity-20 z-50'),
@ -43,34 +48,36 @@ function Video({
]}></View> */} ]}></View> */}
<Image <Image
source={item.poster} source={item.poster}
style={tw.style('w-full h-full absolute left-0 top-0')} style={tw.style("w-full h-full absolute left-0 top-0")}
/> />
<Image <Image
source={{uri: item.imageUrl}} source={{ uri: item.imageUrl }}
style={[ style={[
tw.style('rounded-md h-full absolute left-2 bottom-2 rounded-md'), tw.style("rounded-md h-full absolute left-2 bottom-2 rounded-md"),
{width: width / 5, height: height / 7}, { width: width / 5, height: height / 7 },
]} ]}
/> />
</View> </View>
<Text style={{fontSize: width / 22, marginTop: 5, color: '#05335F'}}> <Text style={{ fontSize: width / 22, marginTop: 5, color: "#05335F" }}>
{item.name} {item.name}
</Text> </Text>
<View <View
style={tw.style('w-full flex flex-row justify-between items-center')}> style={tw.style("w-full flex flex-row justify-between items-center")}
>
<Text <Text
style={[ style={[
tw.style('font-semibold'), tw.style("font-semibold"),
{marginTop: 10, color: '#132F52'}, { marginTop: 10, color: "#132F52" },
]}> ]}
>
{item.price} {item.price}
</Text> </Text>
<Text style={{color: '#196EC0', fontSize: width / 32, marginTop: 5}}> <Text style={{ color: "#196EC0", fontSize: width / 32, marginTop: 5 }}>
{'پایه' + ' ' + item.grade} {"پایه" + " " + item.grade}
</Text> </Text>
</View> </View>
</View> </Pressable>
); );
} }

@ -1,57 +1,75 @@
import React, {useState} from 'react'; import React, { useState } from "react";
import {View, ScrollView, StyleSheet, Dimensions} from 'react-native'; import {
import tw from 'tailwind-react-native-classnames'; View,
ScrollView,
StyleSheet,
Dimensions,
SafeAreaView,
StatusBar,
} from "react-native";
import tw from "tailwind-react-native-classnames";
import {connect} from 'react-redux'; import { connect } from "react-redux";
import Book from './components/Book'; import Book from "./components/Book";
import Video from './components/Video'; import Video from "./components/Video";
import Search from '../../components/Search'; import Search from "../../components/Search";
import Select from '../../components/Select'; import Select from "../../components/Select";
import Navbar from "../../components/Navbar";
function Products({grades, productTypes}) { function Products({ grades, productTypes }) {
const [productType, setProductType] = useState(''); const [productType, setProductType] = useState("");
const [grade, setGrade] = useState(''); const [grade, setGrade] = useState("");
const [search, setSearch] = useState(''); const [search, setSearch] = useState("");
const onChange = (name, value) => {}; const onChange = (name, value) => {};
return ( return (
<SafeAreaView
style={{
paddingTop: Platform.OS === "android" ? StatusBar.currentHeight : 0,
}}
>
<Navbar />
<ScrollView <ScrollView
contentContainerStyle={styles.contentContainerStyle} contentContainerStyle={styles.contentContainerStyle}
style={styles.container}> style={styles.container}
>
<Search <Search
value={search} value={search}
onChange={setSearch} onChange={setSearch}
placeholder={'نام کتاب یا دوره را جستجو کنید'} placeholder={"نام کتاب یا دوره را جستجو کنید"}
/> />
<View <View
style={[ style={[
tw.style('flex flex-1 flex-row justify-between items-center'), tw.style("flex flex-1 flex-row justify-between items-center"),
{marginTop: 10, width: '100%'}, { marginTop: 10, width: "100%" },
]}> ]}
>
<Select <Select
defaultValue={'کتاب فیزیکی'} defaultValue={"کتاب فیزیکی"}
value={productType} value={productType}
onChange={setProductType} onChange={setProductType}
options={productTypes} options={productTypes}
width={'48%'} width={"48%"}
/> />
<Select <Select
defaultValue={'همه پایه'} defaultValue={"همه پایه"}
value={grade} value={grade}
onChange={setGrade} onChange={setGrade}
options={grades} options={grades}
width={'48%'} width={"48%"}
/> />
</View> </View>
<View <View
style={tw.style( style={tw.style(
'flex flex-1 w-full py-5 flex-row flex-wrap justify-between bg-white', "flex flex-1 w-full py-5 flex-row flex-wrap justify-between bg-white"
)}> )}
>
{[0, 1, 2, 3, 4, 5, 6, 7].map((item, i) => {[0, 1, 2, 3, 4, 5, 6, 7].map((item, i) =>
productType === 'ویدئوها' ? <Video /> : <Book />, productType === "ویدئوها" ? <Video /> : <Book />
)} )}
</View> </View>
</ScrollView> </ScrollView>
</SafeAreaView>
); );
} }
@ -60,10 +78,10 @@ const styles = StyleSheet.create({
paddingBottom: 50, paddingBottom: 50,
}, },
container: { container: {
width: Dimensions.get('window').width, width: Dimensions.get("window").width,
backgroundColor: 'white', backgroundColor: "white",
flexDirection: 'column', flexDirection: "column",
paddingVertical: 5, paddingVertical: 0,
paddingHorizontal: 10, paddingHorizontal: 10,
}, },
}); });
@ -72,19 +90,19 @@ export default Products;
Products.defaultProps = { Products.defaultProps = {
grades: [ grades: [
'پیش دبستان', "پیش دبستان",
'اول', "اول",
'دوم', "دوم",
'سوم', "سوم",
'چهارم', "چهارم",
'پنجم', "پنجم",
'ششم', "ششم",
'هفتم', "هفتم",
'هشتم', "هشتم",
'نهم', "نهم",
'دهم', "دهم",
'یازدهم', "یازدهم",
'دوازدهم', "دوازدهم",
], ],
productTypes: ['کتاب فیزیکی', 'کتاب دیجیتال', 'ویدئوها', 'اشتراک'], productTypes: ["کتاب فیزیکی", "کتاب دیجیتال", "ویدئوها", "اشتراک"],
}; };

@ -17,7 +17,7 @@ export default function Links({links}) {
</Pressable> </Pressable>
))} ))}
</View> </View>
<Image source={linkIcon} style={{width: 45, height: 50}} /> <Image source={linkIcon} style={{width: 40, height: 40}} />
</View> </View>
); );
} }

@ -12,7 +12,7 @@ export default function PDF({name, file}) {
<Text style={tw.style('text-right text-xs text-red-900')}> <Text style={tw.style('text-right text-xs text-red-900')}>
{name} {name}
</Text> </Text>
<Image source={pdfIcon} style={{width: 47, height: 50}} /> <Image source={pdfIcon} style={{width: 40, height: 40}} />
</View> </View>
); );
} }

@ -12,7 +12,7 @@ export default function PPT({name, file}) {
<Text style={tw.style('text-right text-xs text-green-900')}> <Text style={tw.style('text-right text-xs text-green-900')}>
{name} {name}
</Text> </Text>
<Image source={pptIcon} style={{width: 45, height: 50}} /> <Image source={pptIcon} style={{width: 40, height: 40}} />
</View> </View>
); );
} }

@ -1,11 +1,37 @@
import React from 'react' import React, { useState, useEffect } from 'react';
import { View, Text } from 'react-native' import { Text, View, StyleSheet, Button } from 'react-native';
import tw from 'tailwind-react-native-classnames'; import { BarCodeScanner } from 'expo-barcode-scanner';
export default function App() {
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>;
}
export default function Scanner() {
return ( return (
<View> <View style={{width : '100%', position : 'relative'}}>
<Text></Text> <BarCodeScanner
onBarCodeScanned={scanned ? undefined : handleBarCodeScanned}
style={{width : '100%', height : 300}}
/>
{scanned && <Button title={'Tap to Scan Again'} onPress={() => setScanned(false)} />}
</View> </View>
) );
} }

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

@ -13,18 +13,18 @@ export default function Product({product}) {
return ( return (
<View <View
style={[ style={[
tw.style('flex flex-row justify-between py-5'), tw.style('flex flex-row-reverse justify-between py-5'),
{borderBottomWidth: 1, borderColor: '#7070701a', direction: 'rtl'}, {borderBottomWidth: 1, borderColor: '#7070701a', direction: 'rtl'},
]}> ]}>
<View style={tw.style('flex flex-row')}> <View style={tw.style('flex flex-row-reverse')}>
<Image <Image
source={bookImage} source={bookImage}
style={[ style={[
tw.style('rounded-md'), tw.style('rounded-md'),
{width: width / 4, height: height / 6}, {width: 80, height: 120},
]} ]}
/> />
<View style={tw.style('flex flex-col items-start pl-2')}> <View style={tw.style('flex flex-col items-end pr-2')}>
<Text <Text
style={{fontsize: width / 20, color: '#05335F', marginBottom: 5}}> style={{fontsize: width / 20, color: '#05335F', marginBottom: 5}}>
علوم اجتماعی علوم اجتماعی
@ -38,10 +38,10 @@ export default function Product({product}) {
</Text> </Text>
</View> </View>
</View> </View>
<View style={tw.style('flex flex-col justify-between items-end')}> <View style={tw.style('flex flex-col justify-between items-start')}>
<Image source={deleteIcon} style={{width: 17, height: 17}} /> <Image source={deleteIcon} style={{width: 17, height: 17}} />
<View style={tw.style('flex flex-col items-center')}> <View style={tw.style('flex flex-col items-center')}>
<View style={tw.style('flex flex-row items-center mb-3')}> <View style={tw.style('flex flex-row-reverse items-center mb-3')}>
<Pressable <Pressable
style={[ style={[
tw.style( tw.style(

@ -1,4 +1,4 @@
import React, {useState} from 'react'; import React, { useState } from "react";
import { import {
View, View,
Text, Text,
@ -6,36 +6,41 @@ import {
Dimensions, Dimensions,
StyleSheet, StyleSheet,
Pressable, Pressable,
Image Image,
} from 'react-native'; SafeAreaView,
import Product from './components/Product'; StatusBar,
import Code from './components/Code'; } from "react-native";
import CustomPressable from '../../components/Pressable'; import Product from "./components/Product";
import tw from 'tailwind-react-native-classnames'; import Code from "./components/Code";
import alertIcon from './assets/alert.png'; import CustomPressable from "../../components/Pressable";
import Navbar from "../../components/Navbar";
import tw from "tailwind-react-native-classnames";
import alertIcon from "./assets/alert.png";
import {connect} from 'react-redux'; import { connect } from "react-redux";
const width = Dimensions.get('window').width; const width = Dimensions.get("window").width;
const PriceStatus = ({name, value, type}) => { const PriceStatus = ({ name, value, type }) => {
return ( return (
<View style={tw.style('w-full flex flex-row-reverse justify-between py-2')}> <View style={tw.style("w-full flex flex-row-reverse justify-between py-2")}>
<Text <Text
style={[ style={[
tw.style('font-light'), tw.style("font-light"),
{fontSize: width / 27, color: '#132F52'}, { fontSize: width / 27, color: "#132F52" },
]}> ]}
>
{name} {name}
</Text> </Text>
<Text <Text
style={[ style={[
tw.style('font-normal'), tw.style("font-normal"),
{ {
color: type === 'error' ? '#F1420D' : '#246E8A', color: type === "error" ? "#F1420D" : "#246E8A",
fontSize: width / 27, fontSize: width / 27,
}, },
]}> ]}
>
{value} {value}
</Text> </Text>
</View> </View>
@ -44,18 +49,30 @@ const PriceStatus = ({name, value, type}) => {
function ShoppingCart({}) { function ShoppingCart({}) {
return ( return (
<SafeAreaView
style={{
paddingTop: Platform.OS === "android" ? StatusBar.currentHeight : 0,
}}
>
<Navbar />
<ScrollView <ScrollView
contentContainerStyle={styles.contentContainerStyle} contentContainerStyle={styles.contentContainerStyle}
style={styles.container}> style={styles.container}
>
{[0, 1].map((product, index) => ( {[0, 1].map((product, index) => (
<Product key={index} product={product} /> <Product key={index} product={product} />
))} ))}
<Code /> <Code />
<View <View
style={tw.style( style={tw.style(
'flex flex-col w-full border-t py-2 border-gray-300 border-b mt-6', "flex flex-col w-full border-t py-2 border-gray-300 border-b mt-6"
)}> )}
<PriceStatus name="مبلغ سبد خرید" value="265000 تومان" type="normal" /> >
<PriceStatus
name="مبلغ سبد خرید"
value="265000 تومان"
type="normal"
/>
<PriceStatus name="میزان تخفیف" value="0 تومان" type="error" /> <PriceStatus name="میزان تخفیف" value="0 تومان" type="error" />
<PriceStatus <PriceStatus
name="مالیات بر ارزش افزوده" name="مالیات بر ارزش افزوده"
@ -65,37 +82,48 @@ function ShoppingCart({}) {
</View> </View>
<View <View
style={tw.style( style={tw.style(
'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('font-medium'), {fontSize: width / 25}]}> >
<Text style={[tw.style("font-medium"), { fontSize: width / 25 }]}>
جمع کل سبد خرید جمع کل سبد خرید
</Text> </Text>
<Text <Text
style={[ style={[
tw.style('font-medium'), tw.style("font-medium"),
{fontSize: width / 27, color: '#246E8A'}, { fontSize: width / 27, color: "#246E8A" },
]}> ]}
>
235.000 تومان 235.000 تومان
</Text> </Text>
</View> </View>
<Pressable <Pressable
style={[ style={[
tw.style('w-full rounded-md flex flex-row justify-end items-center py-3.5 px-3 my-5'), tw.style(
{backgroundColor: '#196EC01a'}, "w-full rounded-md flex flex-row justify-center items-center py-3.5 px-3 my-5"
]}> ),
<Text style={[tw.style(''), {color: '#275077', fontSize: width / 30}]}> { backgroundColor: "#196EC01a" },
]}
>
<Text
style={[tw.style(""), { color: "#275077", fontSize: width / 30 }]}
>
هزینه ارسال کالا پس از تعیین محل آدرس مشخص میشود هزینه ارسال کالا پس از تعیین محل آدرس مشخص میشود
</Text> </Text>
<Image source={alertIcon} style={{width: 18, height: 18, marginLeft : 5}} /> <Image
source={alertIcon}
style={{ width: 18, height: 18, marginLeft: 5 }}
/>
</Pressable> </Pressable>
<CustomPressable <CustomPressable
title={'ادامه فرایند خرید'} title={"ادامه فرایند خرید"}
backgroundColor="#196EC0" backgroundColor="#196EC0"
color={'white'} color={"white"}
border={{color: '#196EC0', width: 0}} border={{ color: "#196EC0", width: 0 }}
width={'100%'} width={"100%"}
/> />
</ScrollView> </ScrollView>
</SafeAreaView>
); );
} }
@ -103,12 +131,12 @@ export default ShoppingCart;
const styles = StyleSheet.create({ const styles = StyleSheet.create({
contentContainerStyle: { contentContainerStyle: {
paddingBottom: 50, paddingBottom: 100,
}, },
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: 10,
}, },

File diff suppressed because it is too large Load Diff

@ -1227,6 +1227,13 @@
"@types/yargs" "^15.0.0" "@types/yargs" "^15.0.0"
chalk "^4.0.0" chalk "^4.0.0"
"@koale/useworker@^4.0.2":
version "4.0.2"
resolved "https://registry.yarnpkg.com/@koale/useworker/-/useworker-4.0.2.tgz#cb540a2581cd6025307c3ca6685bc60748773e58"
integrity sha512-xPIPADtom8/3/4FLNj7MvNcBM/Z2FleH85Fdx2O869eoKW8+PoEgtSVvoxWjCWMA46Sm9A5/R1TyzNGc+yM0wg==
dependencies:
dequal "^1.0.0"
"@nodelib/fs.scandir@2.1.5": "@nodelib/fs.scandir@2.1.5":
version "2.1.5" version "2.1.5"
resolved "https://registry.yarnpkg.com/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz#7619c2eb21b25483f6d167548b4cfd5a7488c3d5" resolved "https://registry.yarnpkg.com/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz#7619c2eb21b25483f6d167548b4cfd5a7488c3d5"
@ -1248,7 +1255,7 @@
"@nodelib/fs.scandir" "2.1.5" "@nodelib/fs.scandir" "2.1.5"
fastq "^1.6.0" fastq "^1.6.0"
"@react-native-async-storage/async-storage@~1.15.0": "@react-native-async-storage/async-storage@^1.13.4", "@react-native-async-storage/async-storage@~1.15.0":
version "1.15.14" version "1.15.14"
resolved "https://registry.yarnpkg.com/@react-native-async-storage/async-storage/-/async-storage-1.15.14.tgz#8165d3f78798b46e693169795b62e40142064273" resolved "https://registry.yarnpkg.com/@react-native-async-storage/async-storage/-/async-storage-1.15.14.tgz#8165d3f78798b46e693169795b62e40142064273"
integrity sha512-eJF2horabXazwszCyyXDe4w7sBSWlB0WPA8akKXuN2n7WXKHYeQJPN41lS9OahrhSZuZwqftNFE9VWgPXA8wyA== integrity sha512-eJF2horabXazwszCyyXDe4w7sBSWlB0WPA8akKXuN2n7WXKHYeQJPN41lS9OahrhSZuZwqftNFE9VWgPXA8wyA==
@ -2565,6 +2572,11 @@ depd@~1.1.2:
resolved "https://registry.yarnpkg.com/depd/-/depd-1.1.2.tgz#9bcd52e14c097763e749b274c4346ed2e560b5a9" resolved "https://registry.yarnpkg.com/depd/-/depd-1.1.2.tgz#9bcd52e14c097763e749b274c4346ed2e560b5a9"
integrity sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak= integrity sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak=
dequal@^1.0.0:
version "1.0.1"
resolved "https://registry.yarnpkg.com/dequal/-/dequal-1.0.1.tgz#dbbf9795ec626e9da8bd68782f4add1d23700d8b"
integrity sha512-Fx8jxibzkJX2aJgyfSdLhr9tlRoTnHKrRJuu2XHlAgKioN2j19/Bcbe0d4mFXYZ3+wpE2KVobUVTfDutcD17xQ==
destroy@~1.0.4: destroy@~1.0.4:
version "1.0.4" version "1.0.4"
resolved "https://registry.yarnpkg.com/destroy/-/destroy-1.0.4.tgz#978857442c44749e4206613e37946205826abd80" resolved "https://registry.yarnpkg.com/destroy/-/destroy-1.0.4.tgz#978857442c44749e4206613e37946205826abd80"
@ -2737,6 +2749,23 @@ 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-barcode-scanner@~11.2.0:
version "11.2.0"
resolved "https://registry.yarnpkg.com/expo-barcode-scanner/-/expo-barcode-scanner-11.2.0.tgz#9d316a36962f74f117f19f7c722de1334a4fd8d2"
integrity sha512-Dmp6KTzkMa9E561gR7kRP8ZXfVdAn9SLUwQ5DdeEGTC7D1NIqEO8WmyfVtWSLUUSArF6QxL+oYOZyzJ+LVjkHA==
dependencies:
"@expo/config-plugins" "^4.0.2"
expo-image-loader "~3.1.0"
expo-camera@~12.1.0:
version "12.1.0"
resolved "https://registry.yarnpkg.com/expo-camera/-/expo-camera-12.1.0.tgz#d968b282d2155956655e217b35bade66ed361ad7"
integrity sha512-FWzgexrsd1v2XYmtXpeZsXMJf2G6ctX7wmU3xi2KEL7vYMdrCCZi+aX5vj7WQz5DDEu/TH1fkHnqU/hek8ZGMA==
dependencies:
"@expo/config-plugins" "^4.0.2"
"@koale/useworker" "^4.0.2"
invariant "^2.2.4"
expo-constants@~13.0.0: expo-constants@~13.0.0:
version "13.0.0" version "13.0.0"
resolved "https://registry.yarnpkg.com/expo-constants/-/expo-constants-13.0.0.tgz#e167b0e4d064029e53a0bc89c8cffcb7cb8f2a0a" resolved "https://registry.yarnpkg.com/expo-constants/-/expo-constants-13.0.0.tgz#e167b0e4d064029e53a0bc89c8cffcb7cb8f2a0a"
@ -2772,6 +2801,11 @@ expo-font@~10.0.4:
dependencies: dependencies:
fontfaceobserver "^2.1.0" fontfaceobserver "^2.1.0"
expo-image-loader@~3.1.0:
version "3.1.0"
resolved "https://registry.yarnpkg.com/expo-image-loader/-/expo-image-loader-3.1.0.tgz#d60d57d6d36d1ea9b07ed2e8bed87574edd2ad1e"
integrity sha512-86oT25SDTO018hWO61HGnoB4l+DEgT9sOoW24rvXX99VBe/MPheGo+DDNKtLNf6k06n/OFL3LgtR0m9YpOCT8Q==
expo-keep-awake@~10.0.1: expo-keep-awake@~10.0.1:
version "10.0.1" version "10.0.1"
resolved "https://registry.yarnpkg.com/expo-keep-awake/-/expo-keep-awake-10.0.1.tgz#9f1176216c41eee20843c8232acfdca2bc32d334" resolved "https://registry.yarnpkg.com/expo-keep-awake/-/expo-keep-awake-10.0.1.tgz#9f1176216c41eee20843c8232acfdca2bc32d334"
@ -2801,7 +2835,7 @@ expo-status-bar@~1.2.0:
resolved "https://registry.yarnpkg.com/expo-status-bar/-/expo-status-bar-1.2.0.tgz#16e73205da563f9536f562e439081e30e318a82e" resolved "https://registry.yarnpkg.com/expo-status-bar/-/expo-status-bar-1.2.0.tgz#16e73205da563f9536f562e439081e30e318a82e"
integrity sha512-pVZZ/kDCXFK79E4dCtRecs3XLC8aiwlciutSd/fFmUPJSQZ1Txia6hlKajPt0GAYft8/YnT0V3URXzWZOBniYQ== integrity sha512-pVZZ/kDCXFK79E4dCtRecs3XLC8aiwlciutSd/fFmUPJSQZ1Txia6hlKajPt0GAYft8/YnT0V3URXzWZOBniYQ==
expo@~44.0.0: expo@^44.0.1:
version "44.0.1" version "44.0.1"
resolved "https://registry.yarnpkg.com/expo/-/expo-44.0.1.tgz#998a29c8e7eeab1c72d4e51d907494e16a49ed1c" resolved "https://registry.yarnpkg.com/expo/-/expo-44.0.1.tgz#998a29c8e7eeab1c72d4e51d907494e16a49ed1c"
integrity sha512-r3UXg8d2ypcK2I8ds5r9WP6luOLKH4tTqtdgOS+rQt3jpMpkF89VRnNB/Ux3GnzxHnxIHcEmTYBmfoI3qA4abg== integrity sha512-r3UXg8d2ypcK2I8ds5r9WP6luOLKH4tTqtdgOS+rQt3jpMpkF89VRnNB/Ux3GnzxHnxIHcEmTYBmfoI3qA4abg==
@ -3381,6 +3415,11 @@ inline-style-prefixer@^6.0.0:
dependencies: dependencies:
css-in-js-utils "^2.0.0" css-in-js-utils "^2.0.0"
install@^0.13.0:
version "0.13.0"
resolved "https://registry.yarnpkg.com/install/-/install-0.13.0.tgz#6af6e9da9dd0987de2ab420f78e60d9c17260776"
integrity sha512-zDml/jzr2PKU9I8J/xyZBQn8rPCAY//UOYNmR01XwNwyfhEWObo2SWfSl1+0tm1u6PhxLwDnfsT/6jB7OUxqFA==
interpret@^1.0.0: interpret@^1.0.0:
version "1.4.0" version "1.4.0"
resolved "https://registry.yarnpkg.com/interpret/-/interpret-1.4.0.tgz#665ab8bc4da27a774a40584e812e3e0fa45b1a1e" resolved "https://registry.yarnpkg.com/interpret/-/interpret-1.4.0.tgz#665ab8bc4da27a774a40584e812e3e0fa45b1a1e"
@ -4933,7 +4972,7 @@ prompts@^2.4.0:
kleur "^3.0.3" kleur "^3.0.3"
sisteransi "^1.0.5" sisteransi "^1.0.5"
prop-types@^15.6.0, prop-types@^15.7.2: prop-types@^15.5.10, prop-types@^15.6.0, prop-types@^15.7.2:
version "15.8.0" version "15.8.0"
resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.8.0.tgz#d237e624c45a9846e469f5f31117f970017ff588" resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.8.0.tgz#d237e624c45a9846e469f5f31117f970017ff588"
integrity sha512-fDGekdaHh65eI3lMi5OnErU6a8Ighg2KjcjQxO7m8VHyWjcPyj5kiOgV1LQDOOOgVy3+5FgjXvdSSX7B8/5/4g== integrity sha512-fDGekdaHh65eI3lMi5OnErU6a8Ighg2KjcjQxO7m8VHyWjcPyj5kiOgV1LQDOOOgVy3+5FgjXvdSSX7B8/5/4g==
@ -5052,6 +5091,20 @@ react-native-codegen@^0.0.6:
jscodeshift "^0.11.0" jscodeshift "^0.11.0"
nullthrows "^1.1.1" nullthrows "^1.1.1"
react-native-permissions@^2.0.2:
version "2.2.2"
resolved "https://registry.yarnpkg.com/react-native-permissions/-/react-native-permissions-2.2.2.tgz#3d2a63f6b7d6be52fc86e30f77412a9566283028"
integrity sha512-ihf4shQDSX5Oo9ChQXb9kr13mmyyNem5MaEvOpr3dCjhBOBWyEMztXm9/uPK1Qg5PsNpaYLa1KpcPZDCw87LXg==
react-native-qrcode-scanner@^1.5.4:
version "1.5.4"
resolved "https://registry.yarnpkg.com/react-native-qrcode-scanner/-/react-native-qrcode-scanner-1.5.4.tgz#5e96189260942db3287739545eb3f6a16f7c0178"
integrity sha512-FqY6C+vi+1u7XUunCfCBoBGTjEhK9mIOhthOBgmCWH2xAXZkytrRV7ycCmnkTIFMqOIWzomlfSc7l+2vF01BzA==
dependencies:
"@react-native-async-storage/async-storage" "^1.13.4"
prop-types "^15.5.10"
react-native-permissions "^2.0.2"
react-native-restart@^0.0.22: react-native-restart@^0.0.22:
version "0.0.22" version "0.0.22"
resolved "https://registry.yarnpkg.com/react-native-restart/-/react-native-restart-0.0.22.tgz#81fcb7f31e35951d85410c68b9556acf3ab88705" resolved "https://registry.yarnpkg.com/react-native-restart/-/react-native-restart-0.0.22.tgz#81fcb7f31e35951d85410c68b9556acf3ab88705"

Loading…
Cancel
Save